Add arg_minimal_value variable to grub2_bootloader_argument template#14626
Add arg_minimal_value variable to grub2_bootloader_argument template#14626macko1 wants to merge 3 commits intoComplianceAsCode:masterfrom
Conversation
|
Skipping CI for Draft Pull Request. |
|
This datastream diff is auto generated by the check Click here to see the full diffOVAL for rule 'xccdf_org.ssgproject.content_rule_grub2_audit_backlog_limit_argument' differs.
--- oval:ssg-grub2_audit_backlog_limit_argument:def:1
+++ oval:ssg-grub2_audit_backlog_limit_argument:def:1
@@ -1,6 +1,6 @@
criteria OR
criteria AND
-criterion oval:ssg-test_grub2_audit_backlog_limit_entries_expanded_or_referenced:tst:1
+criterion oval:ssg-test_grub2_audit_backlog_limit_entries_numeric:tst:1
criteria OR
criterion oval:ssg-test_grub2_audit_backlog_limit_at_least_one_entry_referenced:tst:1
criteria OR |
|
Change in Ansible Please consider using more suitable Ansible module than |
5d68582 to
117ce41
Compare
d72131a to
315103b
Compare
|
Hello @macko1 and thank you.
|
5359579 to
13a4ebc
Compare
…mparison - audit_backlog_limit needs >= comparison - Test scenarios now use TEST_CORRECT_VALUE/TEST_WRONG_VALUE instead of hardcoded strings.
…parison - See inline documentation in the oval.template for more details. - Test scenarios now use TEST_CORRECT_VALUE/TEST_WRONG_VALUE instead of hardcoded strings. - Two new numeric test scenarios added: arg_value_meets_minimal.pass.sh and arg_value_below_minimal.fail.sh.
- Add operation "greater than or equal" to the rule so the OVAL check accepts any value meeting the threshold, not just the exact default. - Document the operation parameter in template_reference.md.
|
@vojtapolasek you were right, thanks for pointing this out. I've re-implemented the check, and made it extensible - "greater than or equal" can be extended with more OVAL operations in the future, when needed. I have divided the changes into several commits, as you have asked, I hope this will make it more readable. PR description updated. Thanks for a review! |
Description:
operationparameter to thegrub2_bootloader_argumenttemplate so rules can use numeric comparisons (currently only
"greater than or equal" is supported)
grub2_audit_backlog_limit_argumentrule to use thenew
operationparameter.template_reference.md.Rationale:
audit_backlog_limit=8192was failing on systems with a highervalue like 16384, because the OVAL check did an exact string match
instead of a >= comparison.
Fixes xccdf_org.ssgproject.content_rule_audit_backlog_limit resets backlog limit even if set to valid value #13923
Review Hints:
template.pyfirst (preprocessing), thenoval.template+ tests (the OVAL plumbing), thenrule.yml+ docs.automatus.py- this needs to be run in a VM, not a container.Using multiple parallel VMs is recommended (
--sliceautomatus argument).oval.templatehas extensive inline comments explaining thenumeric branching — the header TOC (lines 1–72) is a good
starting point.
entries_numerictest+object (section 4a) is thetrickiest part — it exists because the wide-capture object must
stay for
$kerneloptsdetection.