Skip to content

Commit 2882a15

Browse files
authored
Merge pull request #427 from dev-sec/snoopotic-fix/add_auditd_restart_handler
add restart-auditd handler after configuration change
2 parents d1d12ca + 458dfa2 commit 2882a15

File tree

6 files changed

+13
-4
lines changed

6 files changed

+13
-4
lines changed

molecule/mysql_hardening/verify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
shell: "bash /tmp/install.sh -s -- -P cinc-auditor -v 4"
4545

4646
- name: Execute cinc-auditor tests
47-
command: "/opt/cinc-auditor/bin/cinc-auditor exec --no-show-progress --no-color --no-distinct-exit https://github.com/dev-sec/mysql-baseline.git"
47+
command: "/opt/cinc-auditor/bin/cinc-auditor exec --no-show-progress --no-color --no-distinct-exit supermarket://dev-sec/mysql-baseline"
4848
register: test_results
4949
changed_when: false
5050
ignore_errors: true

molecule/nginx_hardening/verify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
shell: "bash /tmp/install.sh -s -- -P cinc-auditor -v 4"
4848

4949
- name: Execute cinc-auditor tests
50-
command: "/opt/cinc-auditor/bin/cinc-auditor exec --no-show-progress --no-color --no-distinct-exit https://github.com/dev-sec/nginx-baseline.git"
50+
command: "/opt/cinc-auditor/bin/cinc-auditor exec --no-show-progress --no-color --no-distinct-exit supermarket://dev-sec/nginx-baseline"
5151
register: test_results
5252
changed_when: false
5353
ignore_errors: true

molecule/os_hardening/verify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
shell: "bash /tmp/install.sh -s -- -P cinc-auditor -v 4"
5252

5353
- name: Execute cinc-auditor tests
54-
command: "/opt/cinc-auditor/bin/cinc-auditor exec --no-show-progress --no-color --no-distinct-exit https://github.com/dev-sec/linux-baseline.git"
54+
command: "/opt/cinc-auditor/bin/cinc-auditor exec --no-show-progress --no-color --no-distinct-exit supermarket://dev-sec/linux-baseline"
5555
register: test_results
5656
changed_when: false
5757
ignore_errors: true

molecule/ssh_hardening/verify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
shell: "bash /tmp/install.sh -s -- -P cinc-auditor -v 4"
4343

4444
- name: Execute cinc-auditor tests
45-
command: "/opt/cinc-auditor/bin/cinc-auditor exec --no-show-progress --no-color --no-distinct-exit https://github.com/dev-sec/ssh-baseline.git"
45+
command: "/opt/cinc-auditor/bin/cinc-auditor exec --no-show-progress --no-color --no-distinct-exit supermarket://dev-sec/nginx-baseline"
4646
register: test_results
4747
changed_when: false
4848
ignore_errors: true
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
---
22
- name: Update-initramfs
33
command: 'update-initramfs -u'
4+
5+
- name: restart-auditd
6+
command:
7+
cmd: 'service auditd restart' # rhel: see: https://access.redhat.com/solutions/2664811
8+
warn: false # sadly 'service' module fails in that case also by using 'use: service'
9+
when: molecule_yml is not defined # restarting auditd in a container does not work

roles/os_hardening/tasks/auditd.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
package:
44
name: '{{ auditd_package }}'
55
state: 'present'
6+
tags: auditd
67

78
- name: Configure auditd | package-08
89
template:
@@ -11,3 +12,5 @@
1112
owner: 'root'
1213
group: 'root'
1314
mode: '0640'
15+
notify: 'restart-auditd'
16+
tags: auditd

0 commit comments

Comments
 (0)