Skip to content

Commit b09f5c9

Browse files
committed
Merge pull request #36 from hardening-io/dr/fix-sysctl
prevent nil in flags
2 parents 2801dd6 + 93cb67d commit b09f5c9

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
sudo: false
2+
cache: bundler
3+
14
rvm:
25
- 1.9.3
36
- 2.0.0
7+
- 2.2.0
48
language: ruby

Gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
source 'https://rubygems.org'
44

5+
if Gem::Version.new(RUBY_VERSION) <= Gem::Version.new('1.9.3')
6+
gem 'net-ssh', '~> 2.9'
7+
end
8+
59
gem 'rake'
610
gem 'inspec', '~> 0.9'
711
gem 'rubocop', '~> 0.23'

default/inspec/sysctl_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@
337337
impact 1.0
338338
title 'CPU No execution Flag or Kernel ExecShield'
339339
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.'
340-
flags = parse_config_file('/proc/cpuinfo', assignment_re: /^([^:]*?)\s+:\s+(.*?)$/).flags.split(' ')
340+
flags = parse_config_file('/proc/cpuinfo', assignment_re: /^([^:]*?)\s+:\s+(.*?)$/).flags.to_s.split(' ')
341341
describe '/proc/cpuinfo' do
342342
it 'Flags should include NX' do
343343
expect(flags).to include('nx')

0 commit comments

Comments
 (0)