Skip to content

Commit af943a8

Browse files
authored
Merge pull request #168 from dev-sec/fix-exec--shield
Fix: do not touch exec-shield on RHEL 7
2 parents e8df095 + 4d00264 commit af943a8

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

attributes/sysctl.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,12 @@
9292
default['sysctl']['params']['net']['ipv6']['conf']['default']['accept_ra'] = 0
9393

9494
# ExecShield protection against buffer overflows
95-
# unless node['platform'] == "ubuntu" # ["nx"].include?(node['cpu'][0]['flags']) or
9695
case node['platform_family']
9796
when 'rhel', 'fedora'
98-
default['sysctl']['params']['kernel']['exec-shield'] = 1
97+
# on RHEL 7 its enabled per default and can't be disabled
98+
if node['platform_version'].to_f < 7
99+
default['sysctl']['params']['kernel']['exec-shield'] = 1
100+
end
99101
end
100102

101103
# Virtual memory regions protection

metadata.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
supports 'redhat', '>= 5.0'
3333
supports 'oracle', '>= 6.4'
3434

35-
depends 'sysctl', '>= 0.6.0'
35+
# temporary version pinning of sysctl
36+
# https://github.com/dev-sec/chef-os-hardening/issues/166#issuecomment-322433264
37+
depends 'sysctl', '<= 0.9.0'
3638
depends 'compat_resource', '>= 12.16.3'
3739

3840
recipe 'os-hardening::default', 'harden the operating system (all recipes)'

0 commit comments

Comments
 (0)