Skip to content

Commit 3a83bad

Browse files
authored
Merge pull request #64 from dev-sec/ap/assignment_re-update
Use assignment_regex, only_if and bump profile version
2 parents 6563cb3 + 4f5fc94 commit 3a83bad

3 files changed

Lines changed: 11 additions & 12 deletions

File tree

controls/os_spec.rb

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -171,17 +171,16 @@
171171
impact 1.0
172172
title 'Check login.defs - RedHat specific'
173173
desc 'Check owner and permissions for login.defs. Also check the configured PATH variable and umask in login.defs'
174-
if os.redhat?
175-
describe file('/etc/login.defs') do
176-
it { should_not be_writable }
177-
end
178-
describe login_defs do
179-
its('SYS_UID_MIN') { should eq '100' }
180-
its('SYS_UID_MAX') { should eq '999' }
181-
its('SYS_GID_MIN') { should eq '100' }
182-
its('SYS_GID_MAX') { should eq '999' }
183-
end
174+
describe file('/etc/login.defs') do
175+
it { should_not be_writable }
176+
end
177+
describe login_defs do
178+
its('SYS_UID_MIN') { should eq '100' }
179+
its('SYS_UID_MAX') { should eq '999' }
180+
its('SYS_GID_MIN') { should eq '100' }
181+
its('SYS_GID_MAX') { should eq '999' }
184182
end
183+
only_if { os.redhat? }
185184
end
186185

187186
control 'os-06' do

controls/sysctl_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@
354354
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.'
355355

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

inspec.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ copyright: DevSec Hardening Framework Team
55
copyright_email: hello@dev-sec.io
66
license: Apache 2 license
77
summary: Test-suite for best-preactice Linux OS hardening
8-
version: 2.1.0
8+
version: 2.1.1
99
supports:
1010
- os-family: linux

0 commit comments

Comments
 (0)