forked from ansible-lockdown/RHEL9-CIS
Initial
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
This commit is contained in:
commit
a54b5216eb
87 changed files with 7693 additions and 0 deletions
43
tasks/post_remediation_audit.yml
Normal file
43
tasks/post_remediation_audit.yml
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
---
|
||||
|
||||
- name: "Post Audit | Run post_remediation {{ benchmark }} audit"
|
||||
shell: "{{ audit_conf_dir }}/run_audit.sh -v {{ audit_vars_path }} -o {{ post_audit_outfile }} -g {{ group_names }}"
|
||||
vars:
|
||||
warn: false
|
||||
|
||||
- name: Post Audit | ensure audit files readable by users
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
mode: 0644
|
||||
state: file
|
||||
loop:
|
||||
- "{{ post_audit_outfile }}"
|
||||
- "{{ pre_audit_outfile }}"
|
||||
|
||||
- name: Post Audit | Capture audit data if json format
|
||||
block:
|
||||
- name: "capture data {{ post_audit_outfile }}"
|
||||
command: "cat {{ post_audit_outfile }}"
|
||||
register: post_audit
|
||||
changed_when: false
|
||||
|
||||
- name: Capture post-audit result
|
||||
set_fact:
|
||||
post_audit_summary: "{{ post_audit.stdout | from_json |json_query(summary) }}"
|
||||
vars:
|
||||
summary: 'summary."summary-line"'
|
||||
when:
|
||||
- audit_format == "json"
|
||||
|
||||
- name: Post Audit | Capture audit data if documentation format
|
||||
block:
|
||||
- name: "Post Audit | capture data {{ post_audit_outfile }}"
|
||||
command: "tail -2 {{ post_audit_outfile }}"
|
||||
register: post_audit
|
||||
changed_when: false
|
||||
|
||||
- name: Post Audit | Capture post-audit result
|
||||
set_fact:
|
||||
post_audit_summary: "{{ post_audit.stdout_lines }}"
|
||||
when:
|
||||
- audit_format == "documentation"
|
||||
Loading…
Add table
Add a link
Reference in a new issue