-
Notifications
You must be signed in to change notification settings - Fork 303
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 #333 from ansible-lockdown/audit_only
Audit only and lint
- Loading branch information
Showing
16 changed files
with
315 additions
and
196 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,22 +1,34 @@ | ||
--- | ||
|
||
- name: Download goss binary | ||
- name: Pre Audit Setup | Set audit package name | ||
block: | ||
- name: Pre Audit Setup | Set audit package name | 64bit | ||
ansible.builtin.set_fact: | ||
audit_pkg_arch_name: AMD64 | ||
when: ansible_facts.machine == "x86_64" | ||
|
||
- name: Pre Audit Setup | Set audit package name | ARM64 | ||
ansible.builtin.set_fact: | ||
audit_pkg_arch_name: ARM64 | ||
when: ansible_facts.machine == "arm64" | ||
|
||
- name: Pre Audit Setup | Download audit binary | ||
ansible.builtin.get_url: | ||
url: "{{ goss_url }}" | ||
url: "{{ audit_bin_url }}{{ audit_pkg_arch_name }}" | ||
dest: "{{ audit_bin }}" | ||
owner: root | ||
group: root | ||
checksum: "{{ goss_version.checksum }}" | ||
mode: 0555 | ||
checksum: "{{ audit_bin_version[audit_pkg_arch_name + '_checksum'] }}" | ||
mode: '0555' | ||
when: | ||
- get_goss_file == 'download' | ||
- get_audit_binary_method == 'download' | ||
|
||
- name: Copy goss binary | ||
- name: Pre Audit Setup | Copy audit binary | ||
ansible.builtin.copy: | ||
src: "{{ copy_goss_from_path }}" | ||
src: "{{ audit_bin_copy_location }}" | ||
dest: "{{ audit_bin }}" | ||
mode: 0555 | ||
mode: '0555' | ||
owner: root | ||
group: root | ||
when: | ||
- get_goss_file == 'copy' | ||
- 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 | ||
ansible.builtin.file: | ||
mode: '0755' | ||
path: "{{ audit_capture_files_dir }}/{{ inventory_hostname }}" | ||
recurse: true | ||
state: directory | ||
when: fetch_audit_files | ||
delegate_to: localhost | ||
become: false | ||
|
||
- name: Audit_only | Get audits from systems and put in group dir | ||
ansible.builtin.fetch: | ||
dest: "{{ audit_capture_files_dir }}/{{ inventory_hostname }}/" | ||
flat: true | ||
mode: '0644' | ||
src: "{{ pre_audit_outfile }}" | ||
when: fetch_audit_files | ||
|
||
- name: Audit_only | Show Audit Summary | ||
when: | ||
- audit_only | ||
ansible.builtin.debug: | ||
msg: "The Audit results are: {{ pre_audit_summary }}." | ||
|
||
- name: Audit_only | Stop Playbook Audit Only selected | ||
when: | ||
- audit_only | ||
ansible.builtin.meta: end_play |
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
Oops, something went wrong.