-
Notifications
You must be signed in to change notification settings - Fork 192
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
sysctl-34 - fs.protected_hardlinks and fs.protected_symlinks can be nil #173
Comments
This is a bit puzzling. The sysctls should be available on any current Linux. |
So the user is not root and we don't use |
Can you execute the profile as root once? I believe some of the sysctls are only present, when you query them with root privileges. |
Looks like the "--sudo" execution will do the job: provisioner "inspec" {
inspec_env_vars = ["CHEF_LICENSE=accept"]
profile = "https://github.com/dev-sec/linux-baseline"
extra_arguments = [ "--sudo" ]
}
But it have a weird touch for me to execute the specs with |
Your concern is understandable. I did some digging in the Linux sources and it seems the problem with permissions for the sysctls was already identified and fixed in torvalds/linux@c7031c1 So at the moment, you have the option to update your kernel or run this profile as root. I'm not sure how we can fix this any other way. @chris-rock @rndmh3ro do you have any opinion on this? I think we should check for our permissions before we give an error. There are several possible options:
|
This could lead to thinking that there's no problem, so we should not do that.
Sounds plausible as a workaround to document it.
It is a hard fail right now.
I guess this is the easiest way (apart from just documenting the workaround). If the user has no permissions to reaad the |
The
sysctl-34
checks are currently failing with the latest amzn linux 2 images from aws (used ami filteramzn2-ami-hvm-*-x86_64-gp2
):The issue triggered by the following lines.
fs.protected_hardlinks
:linux-baseline/controls/sysctl_spec.rb
Line 420 in 81ce2ab
fs.protected_symlinks
:linux-baseline/controls/sysctl_spec.rb
Line 426 in 81ce2ab
A possible fix is similar like the already implemented exceptions for
fs.protected_regular
andfs.protected_fifos
:The text was updated successfully, but these errors were encountered: