-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #470 from ansible-lockdown/workflow_audit
Workflow audit
- Loading branch information
Showing
16 changed files
with
520 additions
and
353 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
--- | ||
- hosts: all # noqa: name[play] | ||
- name: Ansible Lockdown Remediation Role | ||
hosts: all | ||
become: true | ||
vars: | ||
is_container: false | ||
|
||
roles: | ||
- role: "{{ playbook_dir }}" | ||
rhel7stig_system_is_container: "{{ is_container | default(false) }}" | ||
rhel7stig_skip_for_travis: false | ||
- role: "{{ playbook_dir }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,32 @@ | ||
--- | ||
|
||
- name: Download audit binary | ||
- name: Pre Audit Setup | Set audit package name | ||
block: | ||
- name: Pre Audit Setup | Set audit package name | 64bit | ||
when: ansible_facts.machine == "x86_64" | ||
ansible.builtin.set_fact: | ||
audit_pkg_arch_name: AMD64 | ||
|
||
- name: Pre Audit Setup | Set audit package name | ARM64 | ||
when: ansible_facts.machine == "arm64" | ||
ansible.builtin.set_fact: | ||
audit_pkg_arch_name: ARM64 | ||
|
||
- name: Pre Audit Setup | Download audit binary | ||
when: get_audit_binary_method == 'download' | ||
ansible.builtin.get_url: | ||
url: "{{ audit_bin_url }}" | ||
url: "{{ audit_bin_url }}{{ audit_pkg_arch_name }}" | ||
dest: "{{ audit_bin }}" | ||
owner: root | ||
group: root | ||
checksum: "{{ audit_bin_version.checksum }}" | ||
mode: 0555 | ||
when: | ||
- get_audit_binary_method == 'download' | ||
checksum: "{{ audit_bin_version[audit_pkg_arch_name + '_checksum'] }}" | ||
mode: '0555' | ||
|
||
- name: copy audit binary | ||
- name: Pre Audit Setup | Copy audit binary | ||
when: get_audit_binary_method == 'copy' | ||
ansible.builtin.copy: | ||
src: "{{ audit_bin_copy_location }}" | ||
dest: "{{ audit_bin }}" | ||
mode: 0555 | ||
mode: '0555' | ||
owner: root | ||
group: root | ||
when: | ||
- get_audit_binary_method == 'copy' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
|
||
- name: Audit_Only | Create local Directories for hosts | ||
when: fetch_audit_files | ||
delegate_to: localhost | ||
become: false | ||
ansible.builtin.file: | ||
mode: '0755' | ||
path: "{{ audit_capture_files_dir }}/{{ inventory_hostname }}" | ||
recurse: true | ||
state: directory | ||
|
||
- name: Audit_only | Get audits from systems and put in group dir | ||
when: fetch_audit_files | ||
ansible.builtin.fetch: | ||
dest: "{{ audit_capture_files_dir }}/{{ inventory_hostname }}/" | ||
flat: true | ||
mode: '0644' | ||
src: "{{ pre_audit_outfile }}" | ||
|
||
- name: Audit_only | Show Audit Summary | ||
when: | ||
- audit_only | ||
ansible.builtin.debug: | ||
msg: "{{ audit_results.split('\n') }}" | ||
|
||
- name: Audit_only | Stop Playbook Audit Only selected | ||
when: | ||
- audit_only | ||
ansible.builtin.meta: end_play |
Oops, something went wrong.