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

A fix into ansible part of the rule audit_rules_suid_privilege_function #11170

Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@
- name: Service facts
ansible.builtin.service_facts:

- name: Check the rules script being used
ansible.builtin.command:
grep '^ExecStartPost' /usr/lib/systemd/system/auditd.service
register: check_rules_scripts_result
changed_when: false
failed_when: false

- name: Set suid_audit_rules fact
ansible.builtin.set_fact:
suid_audit_rules:
Expand All @@ -52,8 +45,8 @@
regexp: "{{ item.regex }}"
create: yes
when:
- '"auditd.service" in ansible_facts.services'
- '"augenrules" in check_rules_scripts_result.stdout'
- ('"auditd.service" in ansible_facts.services' or
rumch-se marked this conversation as resolved.
Show resolved Hide resolved
'"augenrules.service" in ansible_facts.services')
register: augenrules_audit_rules_privilege_function_update_result
with_items: "{{ suid_audit_rules }}"

Expand All @@ -64,10 +57,11 @@
regexp: "{{ item.regex }}"
create: yes
when:
- '"auditd.service" in ansible_facts.services'
- '"auditctl" in check_rules_scripts_result.stdout'
- ('"auditd.service" in ansible_facts.services' or
'"augenrules.service" in ansible_facts.services')
register: auditctl_audit_rules_privilege_function_update_result
with_items: "{{ suid_audit_rules }}"

{{%- if product in ['sle12', 'sle15'] %}}
- name: Restart auditd.service
ansible.builtin.systemd:
Expand Down
Loading