Skip to content

Commit 80d01cd

Browse files
authored
Merge pull request #21207 from zeroSteiner/fix/mod/enum-protections/report-hash
Fix a deprecation notice when reporting notes
2 parents b41522b + 1c93bb4 commit 80d01cd

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

modules/post/linux/gather/enum_protections.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def run
6161
end
6262
end
6363

64-
def report(data)
64+
def report(**data)
6565
report_note(
6666
host: session,
6767
type: 'linux.protection',
@@ -89,7 +89,7 @@ def check_hardening
8989
hardening_checks.each do |check, message|
9090
if send(check)
9191
print_good message
92-
report(message)
92+
report(message: message)
9393
end
9494
rescue RuntimeError => e
9595
vprint_status(e.to_s)
@@ -104,7 +104,7 @@ def check_hardening
104104
'SELinux is installed, but in permissive mode'
105105
end
106106
print_good(r)
107-
report(r)
107+
report(message: r)
108108
end
109109
rescue RuntimeError => e
110110
vprint_status(e.to_s)
@@ -119,7 +119,7 @@ def check_hardening
119119
'Yama is installed, but not enabled'
120120
end
121121
print_good(r)
122-
report(r)
122+
report(message: r)
123123
end
124124
rescue RuntimeError => e
125125
vprint_status(e.to_s)
@@ -130,7 +130,7 @@ def check_hardening
130130
if userns_enabled?
131131
r = 'User namespaces are enabled (unprivileged may be available)'
132132
print_good(r)
133-
report(r)
133+
report(message: r)
134134
end
135135
rescue RuntimeError => e
136136
vprint_status(e.to_s)
@@ -196,7 +196,7 @@ def find_exes
196196
next unless path.start_with? '/'
197197

198198
print_good("#{app} found: #{path}")
199-
report("#{appname}: #{path}")
199+
report(message: "Found: #{appname}", path: path)
200200
end
201201
end
202202

@@ -279,7 +279,7 @@ def find_config
279279
next unless file_exist?(path) || directory?(path)
280280

281281
print_good("#{appname} found: #{path}")
282-
report("#{appname}: #{path}")
282+
report(message: "#{appname}: #{path}")
283283
rescue RuntimeError
284284
print_bad("Unable to determine state of #{appname}")
285285
next

0 commit comments

Comments
 (0)