ComplianceAsCode / content

Security automation content in SCAP, Bash, Ansible, and other formats
https://complianceascode.readthedocs.io/en/latest/
Other
2.17k stars 685 forks source link

Profiles and Controls with invalid rule IDs build successfuly when they shouldn't #8870

Closed yuumasato closed 11 months ago

yuumasato commented 2 years ago

Description of problem:

The build system silently ignores invalid rule IDs in profiles and controls.

SCAP Security Guide Version:

Latest master (ab510556f587bf0140da78593c46b86450778ab5)

Operating System Version:

Any

Steps to Reproduce:

  1. Checkout master
  2. Add a invalid IDs to a Profile and build
  3. Add a invalid IDs to a Control and build

Actual Results:

Build succeeds without error, warning or traceback.

Expected Results:

Additional Information/Debugging Steps:

yuumasato commented 2 years ago

Ping @matejak @jan-cerny I'm not sure how to fix this issue.

One way I can think of is for the BuildLoader to also keep track of all rules, not just the applicable ones. So that the build system can warn of invalid rule IDs, but not get tricked by valid rule IDs if a control adds a rule that is not applicable to the product being currently built.