2016-07-26 12:28:52 +02:00
|
|
|
---
|
2017-01-21 21:21:06 +01:00
|
|
|
services: docker
|
2016-07-26 12:28:52 +02:00
|
|
|
|
|
|
|
env:
|
2017-01-21 21:21:06 +01:00
|
|
|
- distro: centos6
|
|
|
|
version: latest
|
|
|
|
init: /sbin/init
|
2018-12-27 17:13:50 +01:00
|
|
|
test_playbook: test.yml
|
2019-04-30 14:33:07 +02:00
|
|
|
|
2017-01-21 21:21:06 +01:00
|
|
|
- distro: centos7
|
2018-08-15 18:16:50 +02:00
|
|
|
init: /lib/systemd/systemd
|
2017-01-21 21:21:06 +01:00
|
|
|
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
|
|
|
|
version: latest
|
2018-12-27 17:13:50 +01:00
|
|
|
test_playbook: test.yml
|
2017-01-21 21:21:06 +01:00
|
|
|
|
|
|
|
- distro: oracle6
|
|
|
|
version: latest
|
|
|
|
init: /sbin/init
|
2018-12-27 17:13:50 +01:00
|
|
|
test_playbook: test.yml
|
|
|
|
|
|
|
|
- distro: ubuntu1604
|
|
|
|
version: latest
|
|
|
|
init: /lib/systemd/systemd
|
|
|
|
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
|
|
|
|
test_playbook: test.yml
|
|
|
|
|
|
|
|
- distro: ubuntu1804
|
|
|
|
version: latest
|
|
|
|
init: /lib/systemd/systemd
|
|
|
|
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
|
|
|
|
test_playbook: test.yml
|
|
|
|
|
|
|
|
- distro: debian9
|
|
|
|
version: latest
|
|
|
|
init: /lib/systemd/systemd
|
|
|
|
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
|
|
|
|
test_playbook: test.yml
|
2017-01-21 21:21:06 +01:00
|
|
|
|
2019-10-10 21:14:30 +02:00
|
|
|
- distro: debian10
|
|
|
|
version: latest
|
|
|
|
init: /lib/systemd/systemd
|
|
|
|
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
|
|
|
|
test_playbook: test.yml
|
|
|
|
|
2020-08-24 10:45:13 +02:00
|
|
|
# - distro: amazon
|
|
|
|
# init: /lib/systemd/systemd
|
|
|
|
# version: latest
|
|
|
|
# run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
|
|
|
|
# test_playbook: test.yml
|
|
|
|
#
|
|
|
|
# - distro: fedora
|
|
|
|
# init: /lib/systemd/systemd
|
|
|
|
# version: latest
|
|
|
|
# run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
|
|
|
|
# test_playbook: test.yml
|
2019-04-30 14:33:07 +02:00
|
|
|
|
2018-12-27 17:13:50 +01:00
|
|
|
- distro: centos6
|
|
|
|
version: latest
|
|
|
|
init: /sbin/init
|
|
|
|
test_playbook: official-nginx-role-redhat.yml
|
|
|
|
|
|
|
|
- distro: centos7
|
|
|
|
init: /lib/systemd/systemd
|
|
|
|
container_id: $(mktemp)
|
|
|
|
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
|
|
|
|
version: latest
|
|
|
|
test_playbook: official-nginx-role-redhat.yml
|
|
|
|
|
|
|
|
- distro: oracle6
|
|
|
|
version: latest
|
|
|
|
init: /sbin/init
|
|
|
|
test_playbook: official-nginx-role-redhat.yml
|
2017-01-21 21:21:06 +01:00
|
|
|
|
|
|
|
- distro: ubuntu1604
|
|
|
|
version: latest
|
|
|
|
init: /lib/systemd/systemd
|
|
|
|
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
|
2018-12-27 17:13:50 +01:00
|
|
|
test_playbook: official-nginx-role-debian.yml
|
2017-01-21 21:21:06 +01:00
|
|
|
|
2018-10-11 09:33:01 +02:00
|
|
|
- distro: ubuntu1804
|
2017-01-21 21:21:06 +01:00
|
|
|
version: latest
|
2018-10-11 09:33:01 +02:00
|
|
|
init: /lib/systemd/systemd
|
|
|
|
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
|
2018-12-27 17:13:50 +01:00
|
|
|
test_playbook: official-nginx-role-debian.yml
|
2017-01-21 21:21:06 +01:00
|
|
|
|
|
|
|
- distro: debian9
|
|
|
|
version: latest
|
|
|
|
init: /lib/systemd/systemd
|
|
|
|
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
|
2018-12-27 17:13:50 +01:00
|
|
|
test_playbook: official-nginx-role-debian.yml
|
2016-07-26 12:28:52 +02:00
|
|
|
|
|
|
|
before_install:
|
2017-01-21 21:21:06 +01:00
|
|
|
# Pull container
|
|
|
|
- 'docker pull rndmh3ro/docker-${distro}-ansible:${version}'
|
2016-07-26 12:28:52 +02:00
|
|
|
|
|
|
|
script:
|
2020-02-18 17:52:53 +01:00
|
|
|
- pip install --user ansible-lint
|
|
|
|
- ansible-lint ./
|
|
|
|
|
2017-01-21 21:21:06 +01:00
|
|
|
- container_id=$(mktemp)
|
2018-12-27 17:13:50 +01:00
|
|
|
# Run container in detached state
|
2017-01-21 21:21:06 +01:00
|
|
|
- 'docker run --detach --volume="${PWD}":/etc/ansible/roles/ansible-nginx-hardening:ro ${run_opts} rndmh3ro/docker-${distro}-ansible:${version} "${init}" > "${container_id}"'
|
|
|
|
|
|
|
|
# Install ansible galaxy requirements
|
2018-09-08 14:56:45 +02:00
|
|
|
- 'docker exec "$(cat ${container_id})" ansible-galaxy -c install -r /etc/ansible/roles/ansible-nginx-hardening/requirements.yml -p /etc/ansible/roles/'
|
2020-08-24 10:45:13 +02:00
|
|
|
|
2018-12-27 17:13:50 +01:00
|
|
|
# Test role
|
|
|
|
- 'docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/ansible-nginx-hardening/tests/"${test_playbook}" -vv'
|
2017-01-21 21:21:06 +01:00
|
|
|
|
|
|
|
# Verify role
|
2018-09-08 14:56:45 +02:00
|
|
|
- 'inspec exec https://github.com/dev-sec/nginx-baseline/ -t docker://$(cat ${container_id}) --controls=nginx-01 nginx-02 nginx-03 nginx-05 nginx-06 nginx-07 nginx-08 nginx-09 nginx-10 nginx-12 nginx-13 nginx-15 nginx-17 --no-distinct-exit'
|
2017-01-21 21:21:06 +01:00
|
|
|
|
|
|
|
notifications:
|
2019-04-30 14:33:07 +02:00
|
|
|
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|