mirror of
https://github.com/dev-sec/linux-baseline
synced 2025-02-17 02:08:23 +00:00
serverspec has a contract on running commands remote. this fixes the local execution and adds a conditional context depending on the presence of the nx flag
This commit is contained in:
parent
f944aaab35
commit
2e7dfc229a
1 changed files with 7 additions and 2 deletions
|
@ -173,11 +173,16 @@ describe 'System sysctl' do
|
|||
end
|
||||
|
||||
describe 'ExecShield' do
|
||||
%x( cat /proc/cpuinfo | egrep "^flags" | grep -q ' nx ' )
|
||||
if $CHILD_STATUS.exitstatus != 0
|
||||
if command('cat /proc/cpuinfo').return_stdout?(/^flags.*?: .*? nx .*?$/)
|
||||
context linux_kernel_parameter('kernel.exec-shield') do
|
||||
its(:value) { should eq 1 }
|
||||
end
|
||||
else
|
||||
context 'No nx flag detected' do
|
||||
it 'no kernel.exec-shield required' do
|
||||
true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context linux_kernel_parameter('kernel.randomize_va_space') do
|
||||
|
|
Loading…
Add table
Reference in a new issue