Previously, CTF was taking products only from prodtype. That was wrong as it ignored implicit "all products".
Now, with https://github.com/ComplianceAsCode/content/pull/11378 prodtype removal, all rules must be part of some profile (at least the default.profile) to get to benchmark. And to get to profile, they might get there via controls (that was ignored as well by CTF).
This PR adds support for searching rules in control files (works with control_dirs as well) and changes the prodtype search to new approach - products are determined based on used profiles.
Previously, CTF was taking products only from
prodtype
. That was wrong as it ignored implicit "all products".Now, with https://github.com/ComplianceAsCode/content/pull/11378 prodtype removal, all rules must be part of some profile (at least the
default.profile
) to get to benchmark. And to get to profile, they might get there via controls (that was ignored as well by CTF).This PR adds support for searching rules in control files (works with control_dirs as well) and changes the prodtype search to new approach - products are determined based on used profiles.
Test changes come from https://github.com/ComplianceAsCode/content-test-filtering/pull/47
For testing, you can for example try:
to check that ocp4 product is selected (the rule introduced in this PR is only in controls file). (related to https://github.com/ComplianceAsCode/content/pull/11501#issuecomment-1916764237)