Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancements for template audit_rules_watch #11869

Merged
merged 2 commits into from Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions shared/templates/audit_rules_watch/ansible.template
Expand Up @@ -4,5 +4,5 @@
# complexity = low
# disruption = low

{{{ ansible_audit_augenrules_add_watch_rule(path=PATH, permissions="wa", key=rule_id) }}}
{{{ ansible_audit_auditctl_add_watch_rule(path=PATH, permissions="wa", key=rule_id) }}}
{{{ ansible_audit_augenrules_add_watch_rule(path=PATH, permissions="wa", key=KEY) }}}
{{{ ansible_audit_auditctl_add_watch_rule(path=PATH, permissions="wa", key=KEY) }}}
4 changes: 2 additions & 2 deletions shared/templates/audit_rules_watch/bash.template
@@ -1,4 +1,4 @@
# platform = multi_platform_all

{{{ bash_fix_audit_watch_rule("auditctl", PATH, "wa", rule_id) }}}
{{{ bash_fix_audit_watch_rule("augenrules", PATH, "wa", rule_id) }}}
{{{ bash_fix_audit_watch_rule("auditctl", PATH, "wa", KEY) }}}
{{{ bash_fix_audit_watch_rule("augenrules", PATH, "wa", KEY) }}}
14 changes: 10 additions & 4 deletions shared/templates/audit_rules_watch/oval.template
Expand Up @@ -3,10 +3,16 @@
{{{ oval_metadata("Check if actions on '" ~ PATH ~ "' are configured to be audited") }}}

<criteria operator="OR">
<!-- Test the augenrules case -->
<criterion comment="audit {{{ PATH }}} augenrules" test_ref="test_{{{ rule_id }}}_augenrules" />
<!-- Test the auditctl case -->
<criterion comment="audit {{{ PATH }}} auditctl" test_ref="test_{{{ rule_id }}}_auditctl" />
<criteria operator="AND">
<!-- Test the augenrules case -->
<extend_definition comment="audit augenrules" definition_ref="audit_rules_augenrules" />
<criterion comment="audit {{{ PATH }}} augenrules" test_ref="test_{{{ rule_id }}}_augenrules" />
</criteria>
<criteria operator="AND">
<!-- Test the auditctl case -->
<extend_definition comment="audit auditctl" definition_ref="audit_rules_auditctl" />
<criterion comment="audit {{{ PATH }}} auditctl" test_ref="test_{{{ rule_id }}}_auditctl" />
</criteria>
</criteria>

</definition>
Expand Down
2 changes: 2 additions & 0 deletions shared/templates/audit_rules_watch/template.py
@@ -1,2 +1,4 @@
def preprocess(data, lang):
if "key" not in data:
data["key"] = data["_rule_id"]
return data