2020-11-07 20:19:43 +00:00
|
|
|
---
|
|
|
|
- name: Verify
|
2023-04-10 21:04:46 +00:00
|
|
|
hosts: localhost
|
2021-03-19 14:45:06 +00:00
|
|
|
environment:
|
|
|
|
http_proxy: "{{ lookup('env', 'http_proxy') | default(omit) }}"
|
|
|
|
https_proxy: "{{ lookup('env', 'https_proxy') | default(omit) }}"
|
|
|
|
no_proxy: "{{ lookup('env', 'no_proxy') | default(omit) }}"
|
2020-11-07 20:19:43 +00:00
|
|
|
tasks:
|
|
|
|
- name: Execute cinc-auditor tests
|
2023-12-06 10:18:56 +00:00
|
|
|
ansible.builtin.command: >
|
2023-04-10 20:58:28 +00:00
|
|
|
docker run
|
|
|
|
--volume /run/docker.sock:/run/docker.sock
|
|
|
|
docker.io/cincproject/auditor exec
|
|
|
|
-t docker://instance
|
2023-04-10 21:04:46 +00:00
|
|
|
--no-show-progress --no-color
|
2023-04-10 20:58:28 +00:00
|
|
|
--no-distinct-exit https://github.com/dev-sec/ssh-baseline/archive/refs/heads/master.zip
|
2020-11-07 20:19:43 +00:00
|
|
|
register: test_results
|
|
|
|
changed_when: false
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- name: Display details about the cinc-auditor results
|
2023-12-06 10:18:56 +00:00
|
|
|
ansible.builtin.debug:
|
2020-11-07 20:19:43 +00:00
|
|
|
msg: "{{ test_results.stdout_lines }}"
|
|
|
|
|
|
|
|
- name: Fail when tests fail
|
2023-12-06 10:18:56 +00:00
|
|
|
ansible.builtin.fail:
|
2023-12-06 13:37:09 +00:00
|
|
|
msg: Inspec failed to validate
|
2020-11-07 20:19:43 +00:00
|
|
|
when: test_results.rc != 0
|