Skip to content
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

use sysctl 1.0 #210

Merged
merged 2 commits into from
May 14, 2018
Merged

use sysctl 1.0 #210

merged 2 commits into from
May 14, 2018

Conversation

dhohengassner
Copy link
Contributor

this means to remove the recipe used until now and use the ressource from sysctl

most of the code was already written by symondsandson
https://github.com/symondsandson/chef-os-hardening.git

@coveralls
Copy link

coveralls commented May 3, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling 92f9506 on dhohengassner:master into 4c0f7ae on dev-sec:master.

@dhohengassner dhohengassner force-pushed the master branch 3 times, most recently from bca29e7 to 293c181 Compare May 8, 2018 14:47
most of the code was already written by symondsandson
https://github.com/symondsandson/chef-os-hardening.git

remove the sysctl attributes file - values are now set in the recipe
remove the lazy evaluation from symondsandson
adapt test cases to test usage of sysctl_param resource
@dhohengassner
Copy link
Contributor Author

@artem-sidorenko @chris-rock
Please review these suggestion. If you like the changes maybe you can give me the information when this would be available on chef supermarket?

Thanks for your great work!

@webframp
Copy link

webframp commented May 9, 2018

Looks great @dhohengassner

I'm waiting on this one before applying this to our systems so feedback from @chris-rock or other maintainers would be much appreciated!

@chris-rock
Copy link
Member

This is huge @dhohengassner Thank you. Once question that I have. Can you still override the the attributes?

@dhohengassner
Copy link
Contributor Author

Thanks for the fast response @chris-rock

Good point! At the moment we can set the flags to enable/disable features as before.
But the values for the ressource calls are fixed now.

I think it would be good to use the same attributes the old sysctl cookbook used to set the values.
I will adapt the PR.

@chris-rock
Copy link
Member

Nice, thank you @dhohengassner That sounds like the perfect approach.

@artem-sidorenko
Copy link
Member

@dhohengassner I‘m currently on the parental leave, I hope @chris-rock can review here

This should be done to ensure downward compatibility and keep flexibility. See discussion on:
dev-sec#210
@dhohengassner
Copy link
Contributor Author

@chris-rock I reverted my resource calls and copied now parts of the old sysctl recipe into this cookbook.
I do not revert the changes in the unit tests because I see we have now less lines and I think they are easier to understand.
But I do not mind if you want to use the old tests.

Please review these changes.

Thank you!

@tas50
Copy link
Contributor

tas50 commented May 10, 2018

This is an important fix for Chef 14 compatibility and it would be great to get this merged in as soon as possible.

Copy link
Member

@chris-rock chris-rock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @dhohengassner for this improvement

# include sysctl recipe and set /etc/sysctl.d/99-chef-attributes.conf
include_recipe 'sysctl::apply'
if node.attribute?('sysctl') && node['sysctl'].attribute?('params')
coerce_attributes(node['sysctl']['params']).each do |x|
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@chris-rock chris-rock merged commit e497d98 into dev-sec:master May 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants