2015-05-04 21:37:22 +00:00
|
|
|
---
|
2016-12-30 19:54:16 +00:00
|
|
|
services: docker
|
2016-03-05 20:19:13 +00:00
|
|
|
|
|
|
|
env:
|
2016-12-30 19:54:16 +00:00
|
|
|
- distro: centos6
|
|
|
|
version: latest
|
|
|
|
init: /sbin/init
|
|
|
|
|
|
|
|
- distro: centos7
|
|
|
|
init: /usr/lib/systemd/systemd
|
|
|
|
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
|
|
|
|
version: latest
|
|
|
|
|
|
|
|
- distro: oracle6
|
|
|
|
version: latest
|
|
|
|
init: /sbin/init
|
|
|
|
|
|
|
|
- distro: oracle7
|
|
|
|
init: /usr/lib/systemd/systemd
|
|
|
|
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
|
|
|
|
version: latest
|
|
|
|
|
|
|
|
- distro: ubuntu1604
|
|
|
|
version: latest
|
|
|
|
init: /lib/systemd/systemd
|
|
|
|
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
|
|
|
|
|
|
|
|
- distro: ubuntu1404
|
|
|
|
version: latest
|
|
|
|
init: /sbin/init
|
|
|
|
|
|
|
|
- distro: debian7
|
|
|
|
version: latest
|
|
|
|
init: /sbin/init
|
|
|
|
|
|
|
|
- distro: debian8
|
|
|
|
version: latest
|
|
|
|
init: /sbin/init
|
|
|
|
|
|
|
|
- distro: debian9
|
|
|
|
version: latest
|
|
|
|
init: /lib/systemd/systemd
|
|
|
|
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
|
2016-03-05 20:19:13 +00:00
|
|
|
|
2015-05-04 21:37:22 +00:00
|
|
|
before_install:
|
2016-12-30 19:54:16 +00:00
|
|
|
# Pull container
|
|
|
|
- 'docker pull rndmh3ro/docker-${distro}-ansible:${version}'
|
2015-06-10 20:16:46 +00:00
|
|
|
|
2015-05-04 21:37:22 +00:00
|
|
|
script:
|
2016-12-30 19:54:16 +00:00
|
|
|
- container_id=$(mktemp)
|
|
|
|
# Run container in detached state.
|
|
|
|
- 'docker run --detach --volume="${PWD}":/etc/ansible/roles/ansible-os-hardening:ro ${run_opts} rndmh3ro/docker-${distro}-ansible:${version} "${init}" > "${container_id}"'
|
|
|
|
|
2017-04-23 15:04:18 +00:00
|
|
|
# Test role.
|
2016-12-30 19:54:16 +00:00
|
|
|
- 'docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/ansible-os-hardening/default.yml --skip-tags "sysctl"'
|
|
|
|
|
2017-04-23 15:04:18 +00:00
|
|
|
# Verify role
|
2017-08-06 13:43:55 +00:00
|
|
|
- 'inspec exec https://github.com/dev-sec/linux-baseline/ -t docker://$(cat ${container_id}) --controls=os-01 os-02 os-03 os-04 os-05 os-06 os-07 os-09 os-10 package-01 package-02 package-03 package-04 package-05 package-06 package-09'
|
2016-12-30 19:54:16 +00:00
|
|
|
|
|
|
|
notifications:
|
|
|
|
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|