Skip to content

Commit

Permalink
Add two more checks for PATH env variable
Browse files Browse the repository at this point in the history
Signed-off-by: Mikhail Aseev <[email protected]>
  • Loading branch information
MikhailAseev committed Aug 21, 2024
1 parent 4a44c94 commit 90ce40c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion controls/os_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,12 @@
control 'os-04' do
impact 1.0
title 'Dot in PATH variable'
desc 'Do not include the current working directory in PATH variable. This makes it easier for an attacker to gain extensive rights by executing a Trojan program'
desc 'Do not include the current working directory as well as its parent one in PATH variable. This makes it easier for an attacker to gain extensive rights by executing a Trojan program'
describe os_env('PATH') do
its('split') { should_not include('') }
its('split') { should_not include(' ') }
its('split') { should_not include('.') }
its('split') { should_not include('..') }
end
end

Expand Down

0 comments on commit 90ce40c

Please sign in to comment.