-
Notifications
You must be signed in to change notification settings - Fork 773
Do not use PrintLastLog for Archlinux #897
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: matclab <[email protected]>
abd2896
to
e34d35c
Compare
Do not merge until we are sure it is intended from Arch ! |
Thanks for putting in the extra work! |
Reported in https://gitlab.archlinux.org/archlinux/packaging/packages/openssh/-/issues/15, waiting for comment there. |
It was intended. This PR may be merges if it looks good to you. |
docker.io/cincproject/auditor exec | ||
-t docker://instance | ||
--no-show-progress --no-color | ||
--waiver-file /waivers.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know you copied this over from the FreeBSD tests, but I don't think we should do that here in this case. I would much rather prefer that we adapt our baseline (https://github.com/dev-sec/linux-baseline). Are you up to adding your changes there instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you're talking about ssh-baseline
?
I'm not familar at all with ruby.
Would this diff be ok:
diff --git a/controls/sshd_spec.rb b/controls/sshd_spec.rb
index a81db94c74..6f04a6f263 100644
--- a/controls/sshd_spec.rb
+++ b/controls/sshd_spec.rb
@@ -466,8 +466,10 @@
impact 1.0
title 'Server: PrintLastLog'
desc 'This tells the SSH daemon to print out information about the last time you logged in.'
- describe sshd_config("#{sshd_custom_path}/sshd_config") do
- its('PrintLastLog') { should eq('no') }
+ if os.name != 'arch'
+ describe sshd_config("#{sshd_custom_path}/sshd_config") do
+ its('PrintLastLog') { should eq('no') }
+ end
end
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you're talking about
ssh-baseline
? I'm not familar at all with ruby.
You are absolutely right ;)
Would this diff be ok:
diff --git a/controls/sshd_spec.rb b/controls/sshd_spec.rb index a81db94c74..6f04a6f263 100644 --- a/controls/sshd_spec.rb +++ b/controls/sshd_spec.rb @@ -466,8 +466,10 @@ impact 1.0 title 'Server: PrintLastLog' desc 'This tells the SSH daemon to print out information about the last time you logged in.' - describe sshd_config("#{sshd_custom_path}/sshd_config") do - its('PrintLastLog') { should eq('no') } + if os.name != 'arch' + describe sshd_config("#{sshd_custom_path}/sshd_config") do + its('PrintLastLog') { should eq('no') } + end end end
Using a plain if
in controls is discouraged, there is a special construct only_if
for this kind of conditions. A example use in the baseline is implemented there: https://github.com/dev-sec/ssh-baseline/blob/master/controls/sshd_spec.rb#L515. Checking for a specific OS looks like that: https://github.com/dev-sec/cis-docker-benchmark/blob/master/controls/docker_daemon_configuration_files.rb#L498
I am a bit split between detecting the OS or detecting the support of the config option, for example sshd -G | grep -qi PrintLastLog
would do a specific detection if this version of sshd supports the option.
You are welcome to contribute this but I can also adapt the baseline if you are not comfortable introducing changes there.
Close #896