Skip to content

Commit

Permalink
If rule ID is not printed by comparison script, print CCE identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
mildas authored and comps committed Apr 5, 2024
1 parent b03cc0d commit d1e767d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scanning/disa-alignment/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ def comparison_report(comparison_output):
Same result format: CCE CCI - DISA_RULE_ID SSG_RULE_ID RESULT
Different result format: CCE CCI - DISA_RULE_ID SSG_RULE_ID SSG_RESULT - DISA_RESULT
"""
result_regex = re.compile(r'[\w-]+ [\w-]+ - [\w-]+ (\w*)\s+(\w+)(?: - *(\w+))*')
result_regex = re.compile(r'([\w-]+) [\w-]+ - [\w-]+ (\w*)\s+(\w+)(?: - *(\w+))*')
for match in result_regex.finditer(comparison_output):
rule_id, ssg_result, disa_result = match.groups()
rule_cce, rule_id, ssg_result, disa_result = match.groups()
if not rule_id:
rule_id = 'rule_id_not_found'
rule_id = rule_cce
# Only 1 result matched - same results
if not disa_result:
results.report('pass', rule_id)
Expand Down

0 comments on commit d1e767d

Please sign in to comment.