File tree Expand file tree Collapse file tree 5 files changed +21
-11
lines changed Expand file tree Collapse file tree 5 files changed +21
-11
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ script:
5555 - ' docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/ansible-os-hardening/default.yml --skip-tags "sysctl"'
5656
5757 # Verify role
58- - ' 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 package-01 package-02 package-03 package-04 package-05 package-06'
58+ - ' 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 '
5959
6060notifications :
6161 webhooks : https://galaxy.ansible.com/api/v1/notifications/
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ os_chfn_restrict: ''
2222# may contain: change_user
2323os_security_users_allow : []
2424# specify system accounts those login should not be disabled and password not changed
25- os_ignore_users : ['vagrant']
25+ os_ignore_users : ['vagrant', 'kitchen' ]
2626os_security_kernel_enable_module_loading : true
2727os_security_kernel_enable_core_dump : false
2828os_security_suid_sgid_enforce : true
@@ -182,9 +182,3 @@ sysctl_config:
182182# Do not delete the following line or otherwise the playbook will fail
183183# at task 'create a combined sysctl-dict if overwrites are defined'
184184sysctl_overwrite :
185-
186- sysctl_rhel_config :
187- # ExecShield protection against buffer overflows | sysctl-33
188- kernel.exec-shield : 1
189- # Syncookies is used to prevent SYN-flooding attacks. | sysctl-11
190- net.ipv4.tcp_syncookies : 1
Original file line number Diff line number Diff line change 11---
2- - name : add the OS specific variables
2+ - name : Set OS family dependent variables
33 include_vars : ' {{ ansible_os_family }}.yml'
44 tags : always
55
6+ - name : Set OS dependent variables
7+ include_vars : ' {{ item }}'
8+ with_first_found :
9+ - files :
10+ - ' {{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml'
11+ - ' {{ ansible_distribution }}.yml'
12+ - ' {{ ansible_os_family }}-{{ ansible_distribution_major_version }}.yml'
13+ skip : true
14+ tags : always
15+
616- include : limits.yml
717 tags : limits
818
Original file line number Diff line number Diff line change 5151 ignoreerrors : yes
5252 with_dict : ' {{ sysctl_config }}'
5353
54- - name : Change various sysctl-settings on rhel -hosts, look at the sysctl-vars file for documentation
54+ - name : Change various sysctl-settings on rhel6 -hosts or older , look at the sysctl-vars file for documentation
5555 sysctl :
5656 name : ' {{ item.key }}'
5757 value : ' {{ item.value }}'
5858 state : present
5959 reload : yes
6060 ignoreerrors : yes
6161 with_dict : ' {{ sysctl_rhel_config }}'
62- when : ansible_distribution == 'RedHat' or ansible_distribution == 'Fedora' or ansible_distribution == 'CentOS'
62+ when : ( ansible_distribution == 'RedHat' or ansible_distribution == 'Fedora' or ansible_distribution == 'CentOS') and ansible_distribution_major_version < '7 '
6363
6464- name : Apply ufw defaults
6565 template :
Original file line number Diff line number Diff line change 1+ ---
2+ sysctl_rhel_config :
3+ # ExecShield protection against buffer overflows
4+ kernel.exec-shield : 1
5+ # Syncookies is used to prevent SYN-flooding attacks.
6+ net.ipv4.tcp_syncookies : 1
You can’t perform that action at this time.
0 commit comments