Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cpu flags and change default for net.ipv4.conf.all.log_martians #39

Merged
merged 2 commits into from
Apr 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions controls/sysctl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
title 'Disable log martians'
desc 'log_martians can cause a denial of service attack to the host'
describe kernel_parameter('net.ipv4.conf.all.log_martians') do
its(:value) { should eq 0 }
its(:value) { should eq 1 }
end
end

Expand Down Expand Up @@ -338,17 +338,17 @@
title 'CPU No execution Flag or Kernel ExecShield'
desc 'Kernel features and CPU flags provide a protection against buffer overflows. The CPU NX Flag and the kernel parameter exec-shield prevents code execution on a per memory page basis. If the CPU supports the NX-Flag then this should be used instead of the kernel parameter exec-shield.'

# parse for cpu flags
flags = parse_config_file('/proc/cpuinfo', assignment_re: /^([^:]*?)\s+:\s+(.*?)$/).flags
flags ||= ''
flags = flags.split(' ')

describe '/proc/cpuinfo' do
it 'Flags should include NX' do
expect(flags).to include('nx')
end
end

# parse for cpu flags
flags = parse_config_file('/proc/cpuinfo', assignment_re: /^([^:]*?)\s+:\s+(.*?)$/).flags
flags ||= ''
flags = flags.split(' ')

unless flags.include?('nx')
# if no nx flag is present, we require exec-shield
describe kernel_parameter('kernel.exec-shield') do
Expand Down
352 changes: 0 additions & 352 deletions lockdown/inspec/sysctl_spec.rb

This file was deleted.