Closed ggbecker closed 2 years ago
Apparently there's even more and on a rule level as well:
:: [ 04:25:00 ] :: [ BEGIN ] :: Testing 'xccdf_org.ssgproject.content_rule_audit_delete_success_ppc64le' applicability on x86_64 :: actually running 'oscap xccdf eval --progress --profile '(all)' --rule xccdf_org.ssgproject.content_rule_audit_delete_success_ppc64le /usr/share/xml/scap/ssg/content/ssg-rhel9-ds.xml 1>std.out 2>std.err'
:: [ 04:25:02 ] :: [ PASS ] :: Testing 'xccdf_org.ssgproject.content_rule_audit_delete_success_ppc64le' applicability on x86_64 (Expected 0,2, got 2)
:: [ 04:25:02 ] :: [ BEGIN ] :: Running 'cat std.out'
xccdf_org.ssgproject.content_rule_audit_delete_success_ppc64le:fail
:: [ 04:25:02 ] :: [ PASS ] :: Command 'cat std.out' (Expected 0, got 0)
:: [ 04:25:02 ] :: [ PASS ] :: File 'std.err' should not contain '(^E:|error)'
:: [ 04:25:02 ] :: [ FAIL ] :: File 'std.out' should contain 'xccdf_org.ssgproject.content_rule_audit_delete_success_ppc64le:notapplicable$'
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Verify there are no unexpected rules with info severity in OSPP profile
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
xccdf_org.ssgproject.content_rule_audit_access_success_aarch64:informational
xccdf_org.ssgproject.content_rule_audit_access_success_ppc64le:informational
:: [ 04:25:02 ] :: [ FAIL ] :: File 'stdout' should not contain ':informational'
I probably know where is the problem. The inherited_cpe_names should be kept separate out of cpe_names structure for Rule class. However, during processing they get mixed together. Therefore they appear in resulting XCCDF rule element. This should not happen. I am working on a fix.
I agree, Bash and Ansible are fine, but XCCDF needs to take into the account explicit platforms and inherited platforms.
I probably know where is the problem. The inherited_cpe_names should be kept separate out of cpe_names structure for Rule class. However, during processing they get mixed together. Therefore they appear in resulting XCCDF rule element. This should not happen. I am working on a fix.
Moreover, inherited_cpe_names
and cpe_names
from the Rule itself should form a single platform with all conditions joined by CPE-ALs and
.
Well, this is IMO still just planed, but not implemented.
Ah, so it wasn't supposed to be working until CPE-AL is merged?
Description of problem:
Rule that should be evaluated as notapplicable are returning fail/pass.
Potentially related to https://github.com/ComplianceAsCode/content/pull/9465