Skip to content

Commit 941d4b5

Browse files
author
Patrick Meier
committed
fixing rubocop issues
Signed-off-by: Patrick Meier <patrick.meier111@googlemail.com>
1 parent d03626f commit 941d4b5

3 files changed

Lines changed: 93 additions & 93 deletions

File tree

default/inspec/os_spec.rb

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# encoding: utf-8
22
#
3-
# Copyright 2015, Patrick Münch
3+
# Copyright 2015, Patrick Muench
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -16,11 +16,11 @@
1616
#
1717
# author: Christoph Hartmann
1818
# author: Dominik Richter
19-
# author: Patrick Münch
19+
# author: Patrick Muench
2020

2121
control '01' do
2222
impact 1.0
23-
title "Trusted hosts login"
23+
title 'Trusted hosts login'
2424
desc "Rhosts/hosts.equiv files are a weak implemenation of authentication. Disabling the .rhosts and hosts.equiv support helps to prevent users from subverting the system's normal access control mechanisms of the system."
2525
describe command('find / -name \'.rhosts\'') do
2626
its('stdout') { should be_empty }
@@ -32,8 +32,8 @@
3232

3333
control '02' do
3434
impact 1.0
35-
title "Check owner and permissions for /etc/shadow "
36-
desc "Check periodically the owner and permissions for /etc/shadow"
35+
title 'Check owner and permissions for /etc/shadow'
36+
desc 'Check periodically the owner and permissions for /etc/shadow'
3737
describe file('/etc/shadow') do
3838
it { should exist }
3939
it { should be_file }
@@ -49,8 +49,8 @@
4949

5050
control '03' do
5151
impact 1.0
52-
title "Check owner and permissions for /etc/passwd "
53-
desc "Check periodically the owner and permissions for /etc/passwd"
52+
title 'Check owner and permissions for /etc/passwd'
53+
desc 'Check periodically the owner and permissions for /etc/passwd'
5454
describe file('/etc/passwd') do
5555
it { should exist }
5656
it { should be_file }
@@ -68,8 +68,8 @@
6868

6969
control '04' do
7070
impact 1.0
71-
title "Dot in PATH variable"
72-
desc "Do not include the current working directory in PATH variable. This makes it easier for an attacker to gain extensive rigths by executing a Trojan program"
71+
title 'Dot in PATH variable'
72+
desc 'Do not include the current working directory in PATH variable. This makes it easier for an attacker to gain extensive rigths by executing a Trojan program'
7373
describe os_env('PATH') do
7474
its('split') { should_not include('') }
7575
its('split') { should_not include('.') }
@@ -78,8 +78,8 @@
7878

7979
control '05' do
8080
impact 1.0
81-
title "Check login.defs"
82-
desc "Check owner and permissions for login.defs. Also check the configured PATH variable and umask in login.defs"
81+
title 'Check login.defs'
82+
desc 'Check owner and permissions for login.defs. Also check the configured PATH variable and umask in login.defs'
8383
describe file('/etc/login.defs') do
8484
it { should exist }
8585
it { should be_file }
@@ -112,8 +112,8 @@
112112

113113
control '06' do
114114
impact 1.0
115-
title "Check for SUID/ SGID blacklist "
116-
desc "Find blacklisted SUID and SGID files to ensure that no rogue SUID and SGID files have been introduced into the system"
115+
title 'Check for SUID/ SGID blacklist'
116+
desc 'Find blacklisted SUID and SGID files to ensure that no rogue SUID and SGID files have been introduced into the system'
117117

118118
blacklist = [
119119
# blacklist as provided by NSA
@@ -141,20 +141,20 @@
141141
'/usr/lib/evolution/camel-lock-helper-1.2', # investigate current state...
142142
'/usr/lib/pt_chown', # pseudo-tty, needed?
143143
'/usr/lib/eject/dmcrypt-get-device',
144-
'/usr/lib/mc/cons.saver' # midnight commander screensaver
144+
'/usr/lib/mc/cons.saver' # midnight commander screensaver
145145
]
146146

147147
output = command('find / -perm -4000 -o -perm -2000 -type f ! -path \'/proc/*\' -print 2>/dev/null | grep -v \'^find:\'')
148148
diff = output.stdout.split(/\r?\n/) & blacklist
149149
describe diff do
150-
it {should be_empty}
150+
it { should be_empty }
151151
end
152152
end
153153

154154
control '07' do
155155
impact 1.0
156-
title "Unique uid and gid"
157-
desc "Check for unique uids gids"
156+
title 'Unique uid and gid'
157+
desc 'Check for unique uids gids'
158158
describe passwd do
159159
its('uids') { should_not contain_duplicates }
160160
end

default/inspec/package_spec.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# encoding: utf-8
22
#
3-
# Copyright 2015, Patrick Münch
3+
# Copyright 2015, Patrick Muench
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -16,12 +16,12 @@
1616
#
1717
# author: Christoph Hartmann
1818
# author: Dominik Richter
19-
# author: Patrick Münch
19+
# author: Patrick Muench
2020

2121
control '01' do
2222
impact 1.0
23-
title "Do not run deprecated inetd or xinetd"
24-
desc "http://www.nsa.gov/ia/_files/os/redhat/rhel5-guide-i731.pdf, Chapter 3.2.1"
23+
title 'Do not run deprecated inetd or xinetd'
24+
desc 'http://www.nsa.gov/ia/_files/os/redhat/rhel5-guide-i731.pdf, Chapter 3.2.1'
2525
describe package('inetd') do
2626
it { should_not be_installed }
2727
end
@@ -32,35 +32,35 @@
3232

3333
control '02' do
3434
impact 1.0
35-
title "Do not install Telnet server"
36-
desc "Telnet protocol uses unencrypted communication, that means the passowrd and other sensitive data are unencrypted. http://www.nsa.gov/ia/_files/os/redhat/rhel5-guide-i731.pdf, Chapter 3.2.2"
35+
title 'Do not install Telnet server'
36+
desc 'Telnet protocol uses unencrypted communication, that means the passowrd and other sensitive data are unencrypted. http://www.nsa.gov/ia/_files/os/redhat/rhel5-guide-i731.pdf, Chapter 3.2.2'
3737
describe package('telnetd') do
3838
it { should_not be_installed }
3939
end
4040
end
4141

4242
control '03' do
4343
impact 1.0
44-
title "Do not install rsh server"
45-
desc "The r-commands suffers same problem as telnet. http://www.nsa.gov/ia/_files/os/redhat/rhel5-guide-i731.pdf, Chapter 3.2.3"
44+
title 'Do not install rsh server'
45+
desc 'The r-commands suffers same problem as telnet. http://www.nsa.gov/ia/_files/os/redhat/rhel5-guide-i731.pdf, Chapter 3.2.3'
4646
describe package('telnetd') do
4747
it { should_not be_installed }
4848
end
4949
end
5050

5151
control '05' do
5252
impact 1.0
53-
title "Do not install ypserv server (NIS)"
54-
desc "Network Information Service (NIS) has some security design weaknesses like inadequate protection of important authentication information. http://www.nsa.gov/ia/_files/os/redhat/rhel5-guide-i731.pdf, Chapter 3.2.4"
53+
title 'Do not install ypserv server (NIS)'
54+
desc 'Network Information Service (NIS) has some security design weaknesses like inadequate protection of important authentication information. http://www.nsa.gov/ia/_files/os/redhat/rhel5-guide-i731.pdf, Chapter 3.2.4'
5555
describe package('ypserv') do
5656
it { should_not be_installed }
5757
end
5858
end
5959

6060
control '06' do
6161
impact 1.0
62-
title "Do not install tftp server"
63-
desc "tftp-server provides little security http://www.nsa.gov/ia/_files/os/redhat/rhel5-guide-i731.pdf, Chapter 3.2.5"
62+
title 'Do not install tftp server'
63+
desc 'tftp-server provides little security http://www.nsa.gov/ia/_files/os/redhat/rhel5-guide-i731.pdf, Chapter 3.2.5'
6464
describe package('tftp-server') do
6565
it { should_not be_installed }
6666
end

0 commit comments

Comments
 (0)