Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor, enhance and fix bugs in ScanTemplate #183

Merged
merged 9 commits into from
Sep 29, 2015
Prev Previous commit
Next Next commit
Allow checks types/categories to be enabled in a template if none had…
… been before
  • Loading branch information
jhart-r7 committed Aug 22, 2015
commit 1515c9efb28e326a2690097392851c72e6d1ea06
3 changes: 2 additions & 1 deletion lib/nexpose/scan_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,8 @@ def remove_checks_by_type(type)
def _enable_check(check, elem)
checks = REXML::XPath.first(@xml, '//VulnerabilityChecks')
checks.elements.delete("Disabled/#{elem}[@name='#{check}']")
checks.elements['Enabled'].add_element(elem, { 'name' => check })
enabled_checks = checks.elements['Enabled'] || checks.add_element('Enabled')
enabled_checks.add_element(elem, { 'name' => check })
end

def _disable_check(check, elem)
Expand Down