stig icon indicating copy to clipboard operation
stig copied to clipboard

Add ability to check multiple lines of text per rule

Open tthomas77 opened this issue 5 years ago • 1 comments

Right now we have v14691a-v14691k or so to match each individual subnet that has to be blocked, so when the script runs I have to go back and consolidate 10ish results to determine the correct pass/fail status of V14691. If we could take this:

---
severity: 2
desc: Deny unauthorized packets inbound from 100.64.0.0/10
check:
  text: deny\s+ip\s+100[.]64[.]0[.]0\s+0[.]63[.]255[.]255\s+any\s+log
  text_cnt: 1
  parent: ^ip\s+access-list\s+extended\s+ACL_EXTERNAL_IN
  when: true
part_of_stig:
  - l3ps
  - l3pr
...

And change it to something like :

---
severity: 2
desc: Deny unauthorized packets inbound from 100.64.0.0/10
check:
  text: [deny ip 0.0.0.0 0.255.255.255 any log,
deny ip 100.64.0.0 0.0.63.255 any log,
deny ip 192.0.0.0 0.0.0.255 any log,
deny ip 192.0.2.0 0.0.0.255 any log,
deny ip 198.18.0.0 0.1.255.255 any log,
deny ip 198.51.100.0 0.0.0.255 any log,
deny ip 203.0.113.0 0.0.0.255 any log,
deny ip 224.0.0.0 15.255.255.255 any log,
deny ip 240.0.0.0 15.255.255.255 any log,
deny ip 100.64.0.0 255.192.0.0 any log]
  text_cnt: 1
  parent: ^ip\s+access-list\s+extended\s+ACL_EXTERNAL_IN
  when: true
part_of_stig:
  - l3ps
  - l3pr
...

That way we could do a for loop or something for each line to check and return an overall pass/fail

tthomas77 avatar Sep 23 '19 18:09 tthomas77

Addressed in commit 28d0ee4

nickrusso42518 avatar Sep 23 '19 20:09 nickrusso42518