-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
mandeepdhiman123
committed
Aug 25, 2020
1 parent
f52d491
commit 49aaa3e
Showing
12 changed files
with
51 additions
and
83 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
27 changes: 15 additions & 12 deletions
27
mosip-security-playbook/playbooks/docker-security-cluster.yml
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,14 +1,17 @@ | ||
--- | ||
- hosts: "{{cluster1}}" | ||
# This play perform all the tasks needed for docker security scanning. | ||
# Here we have split tasks and roles into seperate | ||
# play as tasks only run after roles if they are in the same play (for some reason) | ||
# and for us sequencing is important. | ||
|
||
- hosts: security-console | ||
gather_facts: true | ||
tasks: | ||
- name: running scan for docker configurations | ||
command: docker run -it --net host --pid host --userns host --cap-add audit_control \ | ||
-e DOCKER_CONTENT_TRUST=$DOCKER_CONTENT_TRUST \ | ||
-v /var/lib:/var/lib \ | ||
-v /var/run/docker.sock:/var/run/docker.sock \ | ||
-v /usr/lib/systemd:/usr/lib/systemd \ | ||
-v /etc:/etc --label docker_bench_security \ | ||
-v /tmp:/tmp \ | ||
mandeepdhiman90/docker-bench-security:latest | ||
ignore_errors: yes | ||
- {name: 'Create docker bench security report folder', file: {name: "{{ dbs_report_dir }}", state: directory}} | ||
|
||
- hosts: scancluster | ||
gather_facts: true | ||
become_user: root | ||
become: yes | ||
roles: | ||
- {role: docker-security/scanning, tags: [scanning]} | ||
- {role: docker-security/reporting, tags: [reporting]} |
61 changes: 0 additions & 61 deletions
61
mosip-security-playbook/playbooks/docker-security-report.yml
This file was deleted.
Oops, something went wrong.
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
7 changes: 0 additions & 7 deletions
7
mosip-security-playbook/roles/cluster-hardening/setup/tasks/main.yml
This file was deleted.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
mosip-security-playbook/roles/docker-security/reporting/tasks/main.yml
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,11 @@ | ||
- name: copy log from remote | ||
fetch: | ||
src: /tmp/docker.log | ||
dest: "{{ dbs_report_dir }}/{{ inventory_hostname }}-docker.log" | ||
flat: yes | ||
|
||
- name: copy json log from remote | ||
fetch: | ||
src: /tmp/docker.log.json | ||
dest: "{{ dbs_report_dir }}/{{ inventory_hostname }}-docker.log.json" | ||
flat: yes |
10 changes: 10 additions & 0 deletions
10
mosip-security-playbook/roles/docker-security/scanning/tasks/main.yml
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,10 @@ | ||
- name: running scan for docker configurations | ||
command: "docker run -it --net host --pid host --userns host --cap-add audit_control \ | ||
-e DOCKER_CONTENT_TRUST=$DOCKER_CONTENT_TRUST \ | ||
-v /var/lib:/var/lib \ | ||
-v /var/run/docker.sock:/var/run/docker.sock \ | ||
-v /usr/lib/systemd:/usr/lib/systemd \ | ||
-v /etc:/etc --label docker_bench_security \ | ||
-v /tmp:/tmp \ | ||
mandeepdhiman90/docker-bench-security:latest" | ||
ignore_errors: yes |
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions
7
mosip-security-playbook/roles/os-hardening/setup/tasks/main.yml
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,7 @@ | ||
- name: install openscap scanner on cluster machines | ||
yum: | ||
name: "{{ packages }}" | ||
vars: | ||
packages: | ||
- openscap-scanner | ||
- scap-security-guide |
File renamed without changes.
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