Skip to content

Commit b5284b9

Browse files
use input instead of attribute (#166)
* use input instead of attribute In the last versions of Inspec and cinc-auditor, attribute is deprecated and input should be used. https://docs.chef.io/workstation/cookstyle/inspec_deprecations_attributehelper/ Signed-off-by: Michée Lengronne <[email protected]> * Update sysctl_spec.rb Signed-off-by: Michée Lengronne <[email protected]> * Update inspec.yml Signed-off-by: Michée Lengronne <[email protected]> * Update Rakefile Signed-off-by: Michée Lengronne <[email protected]>
1 parent fd9581a commit b5284b9

File tree

4 files changed

+7
-27
lines changed

4 files changed

+7
-27
lines changed

Rakefile

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,3 @@ namespace :test do
2525
pp profile.check
2626
end
2727
end
28-
29-
task :changelog do
30-
# Automatically generate a changelog for this project. Only loaded if
31-
# the necessary gem is installed. By default its picking up the version from
32-
# inspec.yml. You can override that behavior with `rake changelog to=1.2.0`
33-
34-
require 'yaml'
35-
metadata = YAML.load_file('inspec.yml')
36-
v = ENV['to'] || metadata['version']
37-
puts " * Generating changelog for version #{v}"
38-
require 'github_changelog_generator/task'
39-
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
40-
config.future_release = v
41-
config.user = 'dev-sec'
42-
config.project = 'linux-baseline'
43-
end
44-
Rake::Task[:changelog].execute
45-
rescue LoadError
46-
puts '>>>>> GitHub Changelog Generator not loaded, omitting tasks'
47-
48-
end

controls/os_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
# author: Dominik Richter
2020
# author: Patrick Muench
2121

22-
login_defs_umask = attribute('login_defs_umask', value: os.redhat? ? '077' : '027', description: 'Default umask to set in login.defs')
22+
login_defs_umask = input('login_defs_umask', value: os.redhat? ? '077' : '027', description: 'Default umask to set in login.defs')
2323

24-
login_defs_passmaxdays = attribute('login_defs_passmaxdays', value: '60', description: 'Default password maxdays to set in login.defs')
25-
login_defs_passmindays = attribute('login_defs_passmindays', value: '7', description: 'Default password mindays to set in login.defs')
26-
login_defs_passwarnage = attribute('login_defs_passwarnage', value: '7', description: 'Default password warnage (days) to set in login.defs')
24+
login_defs_passmaxdays = input('login_defs_passmaxdays', value: '60', description: 'Default password maxdays to set in login.defs')
25+
login_defs_passmindays = input('login_defs_passmindays', value: '7', description: 'Default password mindays to set in login.defs')
26+
login_defs_passwarnage = input('login_defs_passwarnage', value: '7', description: 'Default password warnage (days) to set in login.defs')
2727

2828
shadow_group = 'root'
2929
shadow_group = 'shadow' if os.debian? || os.suse? || os.name == 'alpine'

controls/sysctl_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
# author: Dominik Richter
2020
# author: Patrick Muench
2121

22-
sysctl_forwarding = attribute('sysctl_forwarding', value: false, description: 'Is network forwarding needed?')
23-
kernel_modules_disabled = attribute('kernel_modules_disabled', value: 0, description: 'Should loading of kernel modules be disabled?')
22+
sysctl_forwarding = input('sysctl_forwarding', value: false, description: 'Is network forwarding needed?')
23+
kernel_modules_disabled = input('kernel_modules_disabled', value: 0, description: 'Should loading of kernel modules be disabled?')
2424
container_execution = begin
2525
virtualization.role == 'guest' && virtualization.system =~ /^(lxc|docker)$/
2626
rescue NoMethodError

inspec.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ copyright: DevSec Hardening Framework Team
66
copyright_email: [email protected]
77
license: Apache-2.0
88
summary: Test suite for best practice Linux OS hardening
9+
inspec_version: '>= 4.6.3'
910
version: 2.8.1
1011
supports:
1112
- os-family: linux

0 commit comments

Comments
 (0)