Skip to content

Commit a54b61a

Browse files
authored
Merge pull request #95 from ossys/issue_93_fix
Updated fapolicyd Rules Directory Support - Issue 93 Fix
2 parents b98e28c + 21e4b5d commit a54b61a

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

handlers/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@
4646
name: rsyslog
4747
state: restarted
4848

49+
- name: generate fapolicyd rules
50+
command: fagenrules --load
51+
when: rhel_08_040137_rules_dir.stat.exists
52+
4953
- name: restart fapolicyd
5054
service:
5155
name: fapolicyd

tasks/fix-cat2.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6281,14 +6281,21 @@
62816281

62826282
- name: "MEDIUM | RHEL-08-040137 | PATCH | The RHEL 8 fapolicy module must be configured to employ a deny-all, permit-by-exception policy to allow the execution of authorized software programs."
62836283
block:
6284+
- name: "MEDIUM | RHEL-08-040137 | PATCH | The RHEL 8 fapolicy module must be configured to employ a deny-all, permit-by-exception policy to allow the execution of authorized software programs. | Check for rules.d/ directory"
6285+
stat:
6286+
path: /etc/fapolicyd/rules.d/
6287+
register: rhel_08_040137_rules_dir
6288+
62846289
- name: "MEDIUM | RHEL-08-040137 | PATCH | The RHEL 8 fapolicy module must be configured to employ a deny-all, permit-by-exception policy to allow the execution of authorized software programs. | Set fapolicy whitelist "
62856290
lineinfile:
6286-
path: /etc/fapolicyd/fapolicyd.rules
6291+
path: "{{ '/etc/fapolicyd/rules.d/99-stig.rules' if rhel_08_040137_rules_dir.stat.exists else '/etc/fapolicyd/fapolicyd.rules' }}"
62876292
line: "{{ item }}"
6293+
create: yes
62886294
with_items:
62896295
- "allow exe={{ ansible_python.executable }} : ftype=text/x-python"
62906296
- "{{ rhel8stig_fapolicy_white_list }}"
62916297
notify:
6298+
- generate fapolicyd rules
62926299
- restart fapolicyd
62936300

62946301
- name: "MEDIUM | RHEL-08-040137 | PATCH | The RHEL 8 fapolicy module must be configured to employ a deny-all, permit-by-exception policy to allow the execution of authorized software programs. | Set fapolicy permissive 0"

0 commit comments

Comments
 (0)