Skip to content

Commit 0779022

Browse files
authored
Merge pull request #113 from tyrken/rhel7
Rhel7
2 parents a8f8cd0 + 1cacbf4 commit 0779022

File tree

8 files changed

+55
-16
lines changed

8 files changed

+55
-16
lines changed

.kitchen.vagrant.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
---
22
driver:
33
name: vagrant
4+
driver_config:
5+
http_proxy: <%= ENV['http_proxy'] || nil %>
6+
https_proxy: <%= ENV['https_proxy'] || nil %>
7+
vagrantfiles:
8+
- kitchen_vagrant_block.rb
49

510
provisioner:
611
name: ansible_playbook
@@ -13,6 +18,8 @@ provisioner:
1318
ansible_verbose: true
1419
roles_path: ../ansible-os-hardening/
1520
playbook: default.yml
21+
http_proxy: <%= ENV['http_proxy'] || nil %>
22+
https_proxy: <%= ENV['https_proxy'] || nil %>
1623

1724
platforms:
1825
- name: ubuntu-12.04
@@ -31,6 +38,12 @@ platforms:
3138
driver_config:
3239
box: opscode-centos-6.5
3340
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5_chef-provisionerless.box
41+
- name: centos-6.8
42+
driver_config:
43+
box: bento/centos-6.8
44+
- name: centos-7
45+
driver_config:
46+
box: bento/centos-7.2
3447
- name: oracle-6.4
3548
driver_config:
3649
box: oracle-6.4
@@ -39,6 +52,9 @@ platforms:
3952
driver_config:
4053
box: oracle-6.5
4154
box_url: https://storage.us2.oraclecloud.com/v1/istoilis-istoilis/vagrant/oel65-64.box
55+
- name: oracle-7
56+
driver_config:
57+
box: boxcutter/ol72
4258
- name: debian-7
4359
driver_config:
4460
box: debian-7

.kitchen.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ driver:
33
name: docker
44
use_sudo: false
55
privileged: true
6+
http_proxy: <%= ENV['http_proxy'] || nil %>
7+
https_proxy: <%= ENV['https_proxy'] || nil %>
68

79
transport:
810
max_ssh_sessions: 5
@@ -18,6 +20,8 @@ provisioner:
1820
ansible_diff: true
1921
hosts: all
2022
roles_path: ../ansible-os-hardening/
23+
http_proxy: <%= ENV['http_proxy'] || nil %>
24+
https_proxy: <%= ENV['https_proxy'] || nil %>
2125
playbook: default.yml
2226
ansible_extra_flags:
2327
- "--skip-tags=sysctl"
@@ -45,6 +49,16 @@ platforms:
4549
image: centos:7
4650
privileged: true
4751
run_command: /usr/sbin/init
52+
- name: oracle-6
53+
driver:
54+
image: oraclelinux:6
55+
platform: rhel
56+
- name: oracle-7
57+
driver:
58+
image: oraclelinux:7
59+
platform: rhel
60+
privileged: true
61+
run_command: /usr/sbin/init
4862
- name: debian-7
4963
driver:
5064
image: debian:7

default.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
- ansible-os-hardening
66
vars:
77
os_security_users_allow: change_user
8-
os_security_kernel_enable_core_dump: true
8+
os_security_kernel_enable_core_dump: false
99
os_security_suid_sgid_remove_from_unknown: true
1010
os_auth_pam_passwdqc_enable: false
1111
os_desktop_enable: true
1212
os_env_extra_user_paths: ['/home']
1313
os_auth_allow_homeless: true
14-
os_security_kernel_enable_core_dump: true
1514
os_security_suid_sgid_blacklist: ['/bin/umount']
1615
os_security_suid_sgid_whitelist: ['/usr/bin/rlogin']
1716

kitchen_vagrant_block.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This is a Vagrant block to allow proxy settings to be carried into Kitchen
2+
# You need this for all of yum/apt etc. to work!
3+
unless ENV['http_proxy'].empty? || Vagrant.has_plugin?("vagrant-proxyconf")
4+
raise "Missing required plugin 'vagrant-proxyconf' to support HTTP(S) proxies, run `vagrant plugin install vagrant-proxyconf`"
5+
end
6+
7+
Vagrant.configure(2) do |config|
8+
config.proxy.http = "#{ENV['http_proxy']}"
9+
config.proxy.https = "#{ENV['https_proxy']}"
10+
config.proxy.no_proxy = "localhost,127.0.0.1"
11+
12+
# You may have vagrant-vbguest plugin installed to keep your images up to date
13+
# - but will probably have VBoxAddition build issues with the foreign boxes listed in .kitchen.vagrant.yml
14+
config.vbguest.auto_update = false
15+
end

tasks/main.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,9 @@
3535
tags: rhosts
3636

3737
- include: yum.yml
38-
when: ansible_os_family == 'RedHat' or ansible_os_family == 'Oracle Linux'
38+
when: ansible_os_family == 'RedHat'
3939
tags: yum
4040

4141
- include: apt.yml
4242
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
4343
tags: apt
44-

tasks/pam.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
- name: remove pam ccreds on Redhat systems
1414
yum: name='{{os_packages_pam_ccreds}}' state=absent
15-
when: ansible_os_family == 'RedHat' or ansible_os_family == 'Oracle Linux'
15+
when: ansible_os_family == 'RedHat'
1616

1717
- name: remove pam_cracklib, because it does not play nice with passwdqc
1818
apt: name='{{os_packages_pam_cracklib}}' state=absent
@@ -44,19 +44,15 @@
4444

4545
- name: remove pam_cracklib, because it does not play nice with passwdqc
4646
yum: name='{{os_packages_pam_cracklib}}' state='absent'
47-
when: ((ansible_distribution == 'RedHat' or ansible_distribution == 'Oracle Linux' and ansible_distribution_version <= '7')) and os_auth_pam_passwdqc_enable
47+
when: (ansible_os_family == 'RedHat' and ansible_distribution_version < '7') and os_auth_pam_passwdqc_enable
4848

4949
- name: install the package for strong password checking
5050
yum: name='{{os_packages_pam_passwdqc}}' state='installed'
51-
when: ((ansible_distribution == 'RedHat' or ansible_distribution == 'Oracle Linux' and ansible_distribution_version <= '7')) and os_auth_pam_passwdqc_enable
52-
53-
- name: install pam_pwquality on rhel7, replacement for pam_passwdqc and pam_cracklib
54-
yum: name='{{os_packages_pam_pwquality}}' state='installed'
55-
when: ((ansible_distribution == 'RedHat' or ansible_distribution == 'Oracle Linux' and ansible_distribution_version >= '7')) and os_auth_pam_passwdqc_enable
51+
when: (ansible_os_family == 'RedHat' and ansible_distribution_version < '7') and os_auth_pam_passwdqc_enable
5652

5753
- name: remove passwdqc
5854
yum: name='{{os_packages_pam_passwdqc}}' state='absent'
59-
when: (ansible_distribution == 'RedHat' or ansible_distribution == 'Oracle Linux') and not os_auth_pam_passwdqc_enable
55+
when: ansible_os_family == 'RedHat' and not os_auth_pam_passwdqc_enable
6056

6157
- name: configure passwdqc and tally via central system-auth confic
6258
template: src='rhel_system_auth.j2' dest='/etc/pam.d/system-auth-ac' mode=0640 owner=root group=root

templates/rhel_system_auth.j2

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,16 @@ account sufficient pam_succeed_if.so uid < 500 quiet
1919
account required pam_permit.so
2020

2121
{% if os_auth_pam_passwdqc_enable %}
22-
{% if ansible_distribution == 'RedHat' or ansible_distribution == 'Oracle Linux' and ansible_distribution_version >= '7' %}
22+
{%- if ansible_os_family == 'RedHat' and ansible_distribution_version >= '7' %}
2323
password required pam_pwquality.so {{os_auth_pam_pwquality_options}}
24-
{% else %}
24+
{%- else %}
2525
password requisite pam_passwdqc.so {{os_auth_pam_passwdqc_options}}
26-
{% endif %}
26+
{%- endif %}
2727
{% else %}
2828
password requisite pam_cracklib.so try_first_pass retry=3 type=
2929
{% endif %}
3030

31+
3132
# NSA 2.3.3.5 Upgrade Password Hashing Algorithm to SHA-512
3233
# NSA 2.3.3.6 Limit Password Reuse
3334
password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok remember=5

vars/RedHat.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
os_packages_pam_ccreds: 'pam_ccreds'
22
os_packages_pam_passwdqc: 'pam_passwdqc'
33
os_packages_pam_cracklib: 'pam_cracklib'
4-
os_packages_pam_pwquality: 'pam_pwfamily'
54
os_nologin_shell_path: '/sbin/nologin'

0 commit comments

Comments
 (0)