Skip to content

Commit 5b12e73

Browse files
force_ssl disable the check for SSL (#28)
* force_ssl disable the check for SSL This new attribute enforce SSL tests on every listed ports. It assumes SSL is enabled on all of them and do not check if it is. Signed-off-by: Michée Lengronne <[email protected]> * rubocop formatting Signed-off-by: Michée Lengronne <[email protected]>
1 parent 781af3b commit 5b12e73

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

controls/ssl_test.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@
4040
description: 'Target hostname to check'
4141
)
4242

43+
force_ssl = attribute(
44+
'force_ssl',
45+
default: false,
46+
description: 'The profile should not check if SSL is enabled on every port and assume it is'
47+
)
48+
4349
# Find all TCP ports on the system, IPv4 and IPv6
4450
# Eliminate duplicate ports for cleaner reporting and faster scans and sort the
4551
# array by port number.
@@ -56,7 +62,7 @@
5662

5763
# Filter out ports that don't respond to any version of SSL
5864
sslports = tcpports.find_all do |tcpport|
59-
!exclude_ports.include?(tcpport[:port]) && ssl(tcpport).enabled?
65+
!exclude_ports.include?(tcpport[:port]) && (ssl(tcpport).enabled? unless force_ssl)
6066
end
6167

6268
# Troubleshooting control to show InSpec version and list

0 commit comments

Comments
 (0)