Skip to content

Commit

Permalink
Merge pull request #11170 from rumch-se/fix_in_audit_rules_suid_privi…
Browse files Browse the repository at this point in the history
…lege_function

A fix into ansible part of the rule audit_rules_suid_privilege_function
  • Loading branch information
vojtapolasek authored Dec 5, 2023
2 parents 13bbd54 + c1b87fd commit c69454d
Showing 1 changed file with 5 additions and 11 deletions.
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
'"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

0 comments on commit c69454d

Please sign in to comment.