Skip to content

Commit 96df8e2

Browse files
committed
Improve SUID find
1 parent 99a7016 commit 96df8e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/suid_check.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def initialize(blacklist = nil)
1818
end
1919

2020
def permissions
21-
output = inspec.command('find / -perm -4000 -o -perm -2000 -type f ! -path \'/proc/*\' ! -path \'/var/lib/lxd/containers/*\' -print 2>/dev/null | grep -v \'^find:\'')
21+
output = inspec.command('find / -type d \( -path \'/proc/*\' -o -path \'/var/lib/lxd/containers/*\' \) -prune -type f -o -perm -2000 -o -perm 4000 2>/dev/null | grep -v \'^find:\'')
2222
output.stdout.split(/\r?\n/)
2323
end
2424

0 commit comments

Comments
 (0)