Skip to content

Commit a9c8dfc

Browse files
authored
Merge branch 'master' into master
2 parents d9ecbdd + d67d570 commit a9c8dfc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+495
-223
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
5+
---
6+
7+
**Describe the bug**
8+
A clear and concise description of what the bug is.
9+
10+
**Expected behavior**
11+
A clear and concise description of what you expected to happen.
12+
13+
**Actual behavior**
14+
<!--- Paste verbatim command output between quotes -->
15+
```paste below
16+
17+
```
18+
**Example Playbook**
19+
<!--- Paste an example playbook that can be used to reproduce the problem between quotes -->
20+
```paste below
21+
22+
```
23+
24+
**OS / Environment**
25+
<!--- Provide all relevant information below, e.g. target OS versions, network device firmware, etc. -->
26+
27+
**Ansible Version**
28+
<!--- Paste verbatim output from "ansible --version" between quotes -->
29+
```paste below
30+
31+
```
32+
33+
**Role Version**
34+
<!--- Paste version of the role between quotes -->
35+
```paste below
36+
37+
```
38+
39+
**Additional context**
40+
Add any other context about the problem here.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
5+
---
6+
7+
**Is your feature request related to a problem? Please describe.**
8+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
9+
10+
**Describe the solution you'd like**
11+
A clear and concise description of what you want to happen.
12+
13+
**Describe alternatives you've considered**
14+
A clear and concise description of any alternative solutions or features you've considered.
15+
16+
**Additional context**
17+
Add any other context or screenshots about the feature request here.

.kitchen.vagrant.yml

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,44 +16,38 @@ provisioner:
1616
require_ruby_for_busser: false
1717
ansible_verbose: true
1818
roles_path: ../ansible-os-hardening/
19-
playbook: default.yml
19+
playbook: tests/test.yml
2020
http_proxy: <%= ENV['http_proxy'] || nil %>
2121
https_proxy: <%= ENV['https_proxy'] || nil %>
2222

2323
transport:
2424
max_ssh_sessions: 5
2525

2626
platforms:
27-
- name: ubuntu14.04
27+
- name: ubuntu-16.04
2828
driver_config:
29-
box: opscode-ubuntu-14.04
30-
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-14.04_chef-provisionerless.box
31-
- name: ubuntu16.04
29+
box: bento/ubuntu-16.04
30+
- name: ubuntu-18.04
3231
driver_config:
33-
box: opscode-ubuntu-16.04
34-
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-16.04_chef-provisionerless.box
35-
- name: centos6
32+
box: bento/ubuntu-18.04
33+
- name: centos-6
3634
driver_config:
37-
box: bento/centos-6.9
38-
- name: centos7
35+
box: bento/centos-6.7
36+
- name: centos-7
3937
driver_config:
40-
box: bento/centos-7.3
41-
- name: oracle6
38+
box: bento/centos-7
39+
- name: oracle-6
4240
driver_config:
43-
box: oracle-6.5
44-
box_url: https://storage.us2.oraclecloud.com/v1/istoilis-istoilis/vagrant/oel65-64.box
45-
- name: oracle7
41+
box: bento/oracle-6
42+
- name: oracle-7
4643
driver_config:
47-
box: boxcutter/ol72
48-
- name: debian7
44+
box: bento/oracle-7
45+
- name: debian-9
4946
driver_config:
50-
box: bento/debian-7.11
51-
- name: debian8
47+
box: bento/debian-9
48+
- name: amazon
5249
driver_config:
53-
box: bento/debian-8.8
54-
- name: debian9
55-
driver_config:
56-
box: bento/debian-9.0
50+
box: bento/amazonlinux-2
5751

5852
verifier:
5953
name: inspec

.kitchen.yml

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ provisioner:
1717
require_ruby_for_busser: false
1818
ansible_verbose: true
1919
ansible_diff: true
20-
hosts: all
20+
2121
roles_path: ../ansible-os-hardening/
2222
http_proxy: <%= ENV['http_proxy'] || nil %>
2323
https_proxy: <%= ENV['https_proxy'] || nil %>
24-
playbook: default.yml
24+
playbook: tests/test.yml
2525

2626
platforms:
2727
- name: centos6-ansible-latest
@@ -32,34 +32,61 @@ platforms:
3232
driver:
3333
image: rndmh3ro/docker-centos7-ansible:latest
3434
platform: centos
35+
run_command: /sbin/init
36+
provision_command:
37+
- sed -i 's/UsePAM yes/UsePAM no/g' /etc/ssh/sshd_config
38+
- systemctl enable sshd.service
3539
- name: oracle6-ansible-latest
3640
driver:
3741
image: rndmh3ro/docker-oracle6-ansible:latest
3842
platform: centos
3943
- name: oracle7-ansible-latest
4044
driver:
4145
image: rndmh3ro/docker-oracle7-ansible:latest
46+
run_command: /sbin/init
4247
platform: centos
43-
- name: ubuntu1404-ansible-latest
44-
driver:
45-
image: rndmh3ro/docker-ubuntu1404-ansible:latest
46-
platform: ubuntu
48+
provision_command:
49+
- sed -i 's/UsePAM yes/UsePAM no/g' /etc/ssh/sshd_config
50+
- systemctl enable sshd.service
4751
- name: ubuntu1604-ansible-latest
4852
driver:
4953
image: rndmh3ro/docker-ubuntu1604-ansible:latest
5054
platform: ubuntu
51-
- name: debian7-ansible-latest
52-
driver:
53-
image: rndmh3ro/docker-debian7-ansible:latest
54-
platform: debian
55-
- name: debian8-ansible-latest
55+
run_command: /sbin/init
56+
provision_command:
57+
- systemctl enable ssh.service
58+
- name: ubuntu1804-ansible-latest
5659
driver:
57-
image: rndmh3ro/docker-debian8-ansible:latest
58-
platform: debian
60+
image: rndmh3ro/docker-ubuntu1804-ansible:latest
61+
platform: ubuntu
62+
run_command: /sbin/init
63+
provision_command:
64+
- systemctl enable ssh.service
5965
- name: debian9-ansible-latest
6066
driver:
6167
image: rndmh3ro/docker-debian9-ansible:latest
6268
platform: debian
69+
run_command: /sbin/init
70+
provision_command:
71+
- apt install -y systemd-sysv
72+
- systemctl enable ssh.service
73+
- name: amazon-ansible-latest
74+
driver:
75+
image: rndmh3ro/docker-amazon-ansible:latest
76+
platform: centos
77+
run_command: /sbin/init
78+
provision_command:
79+
- sed -i 's/UsePAM yes/UsePAM no/g' /etc/ssh/sshd_config
80+
- systemctl enable sshd.service
81+
- name: fedora-ansible-latest
82+
driver:
83+
image: rndmh3ro/docker-fedora-ansible:latest
84+
platform: centos
85+
run_command: /sbin/init
86+
provision_command:
87+
- dnf install -y python
88+
- sed -i 's/UsePAM yes/UsePAM no/g' /etc/ssh/sshd_config
89+
- systemctl enable sshd.service
6390

6491
verifier:
6592
name: inspec

.travis.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,21 @@ env:
77
init: /sbin/init
88

99
- distro: centos7
10-
init: /usr/lib/systemd/systemd
10+
init: /lib/systemd/systemd
11+
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
12+
version: latest
13+
14+
- distro: fedora
15+
init: /lib/systemd/systemd
1116
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
1217
version: latest
1318

1419
- distro: oracle6
1520
version: latest
1621
init: /sbin/init
1722

18-
# oracle 7 does not support ansible 2.4 yet
19-
# check oracle-epel if it is supported
20-
# http://yum.oracle.com/repo/OracleLinux/OL7/developer_EPEL/x86_64/index.html
2123
# - distro: oracle7
22-
# init: /usr/lib/systemd/systemd
24+
# init: /lib/systemd/systemd
2325
# run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
2426
# version: latest
2527

@@ -28,23 +30,21 @@ env:
2830
init: /lib/systemd/systemd
2931
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
3032

31-
- distro: ubuntu1404
32-
version: latest
33-
init: /sbin/init
34-
35-
- distro: debian7
36-
version: latest
37-
init: /sbin/init
38-
39-
- distro: debian8
33+
- distro: ubuntu1804
4034
version: latest
41-
init: /sbin/init
35+
init: /lib/systemd/systemd
36+
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
4237

4338
- distro: debian9
4439
version: latest
4540
init: /lib/systemd/systemd
4641
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
4742

43+
- distro: amazon
44+
init: /lib/systemd/systemd
45+
version: latest
46+
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
47+
4848
before_install:
4949
# Pull container
5050
- 'docker pull rndmh3ro/docker-${distro}-ansible:${version}'
@@ -55,10 +55,10 @@ script:
5555
- 'docker run --detach --volume="${PWD}":/etc/ansible/roles/ansible-os-hardening:ro ${run_opts} rndmh3ro/docker-${distro}-ansible:${version} "${init}" > "${container_id}"'
5656

5757
# Test role.
58-
- 'docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/ansible-os-hardening/default.yml --skip-tags "sysctl"'
58+
- 'docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/ansible-os-hardening/tests/test.yml --diff --skip-tags "sysctl"'
5959

6060
# Verify role
61-
- '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'
61+
- '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-05b os-06 os-07 os-09 os-10 os-11 package-01 package-02 package-03 package-05 package-06 package-08 package-09 --no-distinct-exit'
6262

6363
notifications:
6464
webhooks: https://galaxy.ansible.com/api/v1/notifications/

CHANGELOG.md

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,62 @@
11
# Change Log
22

3+
## [5.1.0](https://github.com/dev-sec/ansible-os-hardening/tree/5.1.0) (2018-10-17)
4+
[Full Changelog](https://github.com/dev-sec/ansible-os-hardening/compare/5.0.0...5.1.0)
5+
6+
**Implemented enhancements:**
7+
8+
- add ubuntu 1804 support [\#196](https://github.com/dev-sec/ansible-os-hardening/pull/196) ([rndmh3ro](https://github.com/rndmh3ro))
9+
- add option to disable auditd [\#192](https://github.com/dev-sec/ansible-os-hardening/pull/192) ([rndmh3ro](https://github.com/rndmh3ro))
10+
11+
**Fixed bugs:**
12+
13+
- auditd causing v5.0 to fail on unpriviledged LXC's [\#191](https://github.com/dev-sec/ansible-os-hardening/issues/191)
14+
- Setting os\_security\_users\_allow has no effect [\#175](https://github.com/dev-sec/ansible-os-hardening/issues/175)
15+
- add /usr/bin/su to suid\_guid whitelist [\#199](https://github.com/dev-sec/ansible-os-hardening/pull/199) ([ccolic](https://github.com/ccolic))
16+
- ensure that permissions to su-binary are not restricted to root user and group only, if os\_security\_users\_allow contains the value change\_user [\#197](https://github.com/dev-sec/ansible-os-hardening/pull/197) ([szEvEz](https://github.com/szEvEz))
17+
18+
## [5.0.0](https://github.com/dev-sec/ansible-os-hardening/tree/5.0.0) (2018-09-02)
19+
[Full Changelog](https://github.com/dev-sec/ansible-os-hardening/compare/4.3.0...5.0.0)
20+
21+
**Implemented enhancements:**
22+
23+
- Warning about "include" for tasks for ansible-playbook 2.4.0 \(devel f0a5854e39\) [\#131](https://github.com/dev-sec/ansible-os-hardening/issues/131)
24+
- fix problems with efi and vfat [\#190](https://github.com/dev-sec/ansible-os-hardening/pull/190) ([rndmh3ro](https://github.com/rndmh3ro))
25+
- added os\_hardening\_enabled flag [\#186](https://github.com/dev-sec/ansible-os-hardening/pull/186) ([jcheroske](https://github.com/jcheroske))
26+
- add amazon run opts to travis [\#183](https://github.com/dev-sec/ansible-os-hardening/pull/183) ([rndmh3ro](https://github.com/rndmh3ro))
27+
- use package instead of yum and apt [\#180](https://github.com/dev-sec/ansible-os-hardening/pull/180) ([rndmh3ro](https://github.com/rndmh3ro))
28+
- add oracle7 to travis [\#178](https://github.com/dev-sec/ansible-os-hardening/pull/178) ([rndmh3ro](https://github.com/rndmh3ro))
29+
- fix wrong permissions passwdqc \#170 [\#176](https://github.com/dev-sec/ansible-os-hardening/pull/176) ([rndmh3ro](https://github.com/rndmh3ro))
30+
- ipv4 forwarding comment is inconsistent with example [\#174](https://github.com/dev-sec/ansible-os-hardening/pull/174) ([carchrae](https://github.com/carchrae))
31+
- Rename pam\_passwdqd.j2 to pam\_passwdqc.j2 [\#172](https://github.com/dev-sec/ansible-os-hardening/pull/172) ([martinbydefault](https://github.com/martinbydefault))
32+
- Use package state 'present' since 'installed' is deprecated [\#168](https://github.com/dev-sec/ansible-os-hardening/pull/168) ([Normo](https://github.com/Normo))
33+
- Update syntax to Ansible 2.4 [\#161](https://github.com/dev-sec/ansible-os-hardening/pull/161) ([thomasjpfan](https://github.com/thomasjpfan))
34+
- add amazon linux testing [\#160](https://github.com/dev-sec/ansible-os-hardening/pull/160) ([rndmh3ro](https://github.com/rndmh3ro))
35+
- Add support for Amazon Linux [\#158](https://github.com/dev-sec/ansible-os-hardening/pull/158) ([woneill](https://github.com/woneill))
36+
- install and configure auditd - fix inspec package-08 [\#144](https://github.com/dev-sec/ansible-os-hardening/pull/144) ([rndmh3ro](https://github.com/rndmh3ro))
37+
- Remove deprecated include for static tasks and use instead import\_tasks fix \#131 [\#132](https://github.com/dev-sec/ansible-os-hardening/pull/132) ([HelioCampos](https://github.com/HelioCampos))
38+
39+
**Fixed bugs:**
40+
41+
- minimize\_access: maximum recursion depth exceeded on Ansible 2.5 [\#171](https://github.com/dev-sec/ansible-os-hardening/issues/171)
42+
- wrong permissions passwdqc [\#170](https://github.com/dev-sec/ansible-os-hardening/issues/170)
43+
- Update deprecated `include` statements [\#166](https://github.com/dev-sec/ansible-os-hardening/issues/166)
44+
- Strongly recommend against disabling vfat by default [\#162](https://github.com/dev-sec/ansible-os-hardening/issues/162)
45+
- System completely unresponsive after role execution [\#145](https://github.com/dev-sec/ansible-os-hardening/issues/145)
46+
- do not install passwdqc on amazon linux [\#189](https://github.com/dev-sec/ansible-os-hardening/pull/189) ([rndmh3ro](https://github.com/rndmh3ro))
47+
- add back run opts for debian 8 in travis [\#184](https://github.com/dev-sec/ansible-os-hardening/pull/184) ([rndmh3ro](https://github.com/rndmh3ro))
48+
- Fix core dump config file creation when core dumps are disabled [\#182](https://github.com/dev-sec/ansible-os-hardening/pull/182) ([Normo](https://github.com/Normo))
49+
- change minimize access method [\#181](https://github.com/dev-sec/ansible-os-hardening/pull/181) ([rndmh3ro](https://github.com/rndmh3ro))
50+
351
## [4.3.0](https://github.com/dev-sec/ansible-os-hardening/tree/4.3.0) (2018-01-03)
4-
[Full Changelog](https://github.com/dev-sec/ansible-os-hardening/compare/4.2.0...4.3.0)
52+
[Full Changelog](https://github.com/dev-sec/ansible-os-hardening/compare/4.3.1...4.3.0)
553

654
**Implemented enhancements:**
755

856
- Update some RH settings in this role [\#155](https://github.com/dev-sec/ansible-os-hardening/issues/155)
957
- Removal of core dump hardening configuration if core dumps are allowed [\#129](https://github.com/dev-sec/ansible-os-hardening/issues/129)
1058
- Don't create home for system accounts [\#156](https://github.com/dev-sec/ansible-os-hardening/pull/156) ([oakey-b1](https://github.com/oakey-b1))
11-
- Prevent disabling of filesystems via whitelist [\#153](https://github.com/dev-sec/ansible-os-hardening/pull/153) ([pinguinkiste](https://github.com/pinguinkiste))
59+
- Prevent disabling of filesystems via whitelist [\#153](https://github.com/dev-sec/ansible-os-hardening/pull/153) ([manuelprinz](https://github.com/manuelprinz))
1260
- Add kernel hardening settings from Ubuntu /etc/sysctl.d [\#150](https://github.com/dev-sec/ansible-os-hardening/pull/150) ([kravietz](https://github.com/kravietz))
1361
- Removal of core dump hardening configuration if core dumps are allowed [\#146](https://github.com/dev-sec/ansible-os-hardening/pull/146) ([martinbydefault](https://github.com/martinbydefault))
1462
- add missing sysctl parameter [\#143](https://github.com/dev-sec/ansible-os-hardening/pull/143) ([rndmh3ro](https://github.com/rndmh3ro))
@@ -17,7 +65,6 @@
1765
**Fixed bugs:**
1866

1967
- bug in ufw.j2 template [\#151](https://github.com/dev-sec/ansible-os-hardening/issues/151)
20-
- os\_security\_kernel\_enable\_sysrq is not implemented [\#115](https://github.com/dev-sec/ansible-os-hardening/issues/115)
2168
- replace single ticks with double ticks. fix \#151 [\#152](https://github.com/dev-sec/ansible-os-hardening/pull/152) ([rndmh3ro](https://github.com/rndmh3ro))
2269
- fixed tag [\#149](https://github.com/dev-sec/ansible-os-hardening/pull/149) ([martinbydefault](https://github.com/martinbydefault))
2370

@@ -30,6 +77,13 @@
3077

3178
- move defaults to os-specific vars [\#157](https://github.com/dev-sec/ansible-os-hardening/pull/157) ([rndmh3ro](https://github.com/rndmh3ro))
3279

80+
## [4.3.1](https://github.com/dev-sec/ansible-os-hardening/tree/4.3.1) (2017-09-13)
81+
[Full Changelog](https://github.com/dev-sec/ansible-os-hardening/compare/4.2.0...4.3.1)
82+
83+
**Fixed bugs:**
84+
85+
- os\_security\_kernel\_enable\_sysrq is not implemented [\#115](https://github.com/dev-sec/ansible-os-hardening/issues/115)
86+
3387
## [4.2.0](https://github.com/dev-sec/ansible-os-hardening/tree/4.2.0) (2017-08-08)
3488
[Full Changelog](https://github.com/dev-sec/ansible-os-hardening/compare/4.1.0...4.2.0)
3589

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ group :integration do
1111
gem 'kitchen-sync'
1212
gem 'kitchen-transport-rsync'
1313
gem 'kitchen-docker'
14+
gem 'inspec', '~> 3'
1415
end
1516

1617
group :tools do

0 commit comments

Comments
 (0)