Skip to content

Commit

Permalink
Merge pull request #110 from mitre/mapNessusWarningsAndErrors
Browse files Browse the repository at this point in the history
  • Loading branch information
rx294 authored Aug 11, 2021
2 parents 4d00608 + a710ae3 commit 5da2c79
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 11 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,15 @@ jobs:
- name: Test nessus_mapper
run: |
heimdall_tools nessus_mapper -x ./sample_jsons/nessus_mapper/sample_input_report/nessus_sample.nessus -o nessus.json
jq 'del(.version, .platform.release)' nessus.json-ip-10-10-23-102.json > nessus_jq.json
jq 'del(.version, .platform.release)' ./sample_jsons/nessus_mapper/nessus_sample_hdf.json > nessus_sample_hdf.json
diff nessus_sample_hdf.json nessus_jq.json
jq 'del(.version, .platform.release)' nessus.json-ip-10-10-23-102.json > nessus-jq.json-ip-10-10-23-102.json
jq 'del(.version, .platform.release)' ./sample_jsons/nessus_mapper/nessus.json-ip-10-10-23-102.json > nessus-sample-jq.json-ip-10-10-23-102.json
diff nessus-sample-jq.json-ip-10-10-23-102.json nessus-jq.json-ip-10-10-23-102.json
jq 'del(.version, .platform.release)' nessus.json-ip-10-10-24-231.json > nessus-jq.json-ip-10-10-24-231.json
jq 'del(.version, .platform.release)' ./sample_jsons/nessus_mapper/nessus.json-ip-10-10-24-231.json > nessus-sample-jq.json-ip-10-10-24-231.json
diff nessus-sample-jq.json-ip-10-10-24-231.json nessus-jq.json-ip-10-10-24-231.json
jq 'del(.version, .platform.release)' nessus.json-ip-10-10-37-43.json > nessus-jq.json-ip-10-10-37-43.json
jq 'del(.version, .platform.release)' ./sample_jsons/nessus_mapper/nessus.json-ip-10-10-37-43.json > nessus-sample-jq.json-ip-10-10-37-43.json
diff nessus-sample-jq.json-ip-10-10-37-43.json nessus-jq.json-ip-10-10-37-43.json
- name: Test scoutsuite mapper
run: |
heimdall_tools scoutsuite_mapper -i ./sample_jsons/scoutsuite_mapper/sample_input_jsons/scoutsuite_sample.js -o scoutsuite_output.json
Expand Down
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ AllCops:
- 'test/**/*'
- 'examples/plugins/train-*/test/**/*'
- 'vendor/**/*'
- 'sample_jsons/**/*'
Style/Documentation:
Enabled: false
Layout/ParameterAlignment:
Expand All @@ -26,6 +27,8 @@ Style/NumericLiterals:
MinDigits: 10
Metrics/ModuleLength:
Enabled: false
Metrics/ClassLength:
Enabled: false
Style/PercentLiteralDelimiters:
PreferredDelimiters:
'%': '{}'
Expand Down
14 changes: 10 additions & 4 deletions lib/heimdall_tools/nessus_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,17 @@ def format_desc(issue)

def finding(issue, timestamp)
finding = {}
# if compliance-result field, this is a policy compliance result entry
# nessus policy compliance result provides a pass/fail data
# For non policy compliance results are defaulted to failed
if issue['compliance-result']
finding['status'] = issue['compliance-result'].eql?('PASSED') ? 'passed' : 'failed'
case issue['compliance-result']
when 'PASSED'
finding['status'] = 'passed'
when 'ERROR'
finding['status'] = 'error'
when 'WARNING'
finding['status'] = 'skipped'
else
finding['status'] = 'failed'
end
else
finding['status'] = 'failed'
end
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions sample_jsons/nessus_mapper/nessus.json-ip-10-10-37-43.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion sample_jsons/nessus_mapper/nessus_sample_hdf.json

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 5da2c79

Please sign in to comment.