-
Notifications
You must be signed in to change notification settings - Fork 61
ICMP Redirects vulnerability remediation #1356
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: main
Are you sure you want to change the base?
Conversation
added a group of tasks to disable ICMP redirects and included the file in main.yml
removed extra spaces in the {regex...}
added end of file line feed
| with_items: | ||
| - {regexp: '^net.ipv4.conf.all.accept_redirects', line: 'net.ipv4.conf.all.accept_redirects = 0'} | ||
| - {regexp: '^net.ipv4.conf.default.accept_redirects', line: 'net.ipv4.conf.default.accept_redirects = 0'} | ||
| - {regexp: '^net.ipv4.conf.all.secure_redirects', line: 'net.ipv4.conf.all.secure_redirects = 0'} | ||
| - {regexp: '^net.ipv4.conf.default.secure_redirects', line: 'net.ipv4.conf.default.secure_redirects = 0'} |
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.
nit
| with_items: | |
| - {regexp: '^net.ipv4.conf.all.accept_redirects', line: 'net.ipv4.conf.all.accept_redirects = 0'} | |
| - {regexp: '^net.ipv4.conf.default.accept_redirects', line: 'net.ipv4.conf.default.accept_redirects = 0'} | |
| - {regexp: '^net.ipv4.conf.all.secure_redirects', line: 'net.ipv4.conf.all.secure_redirects = 0'} | |
| - {regexp: '^net.ipv4.conf.default.secure_redirects', line: 'net.ipv4.conf.default.secure_redirects = 0'} | |
| loop: | |
| - regexp: '^net.ipv4.conf.all.accept_redirects' | |
| line: 'net.ipv4.conf.all.accept_redirects = 0' | |
| - regexp: '^net.ipv4.conf.default.accept_redirects' | |
| line: 'net.ipv4.conf.default.accept_redirects = 0' | |
| - regexp: '^net.ipv4.conf.all.secure_redirects' | |
| line: 'net.ipv4.conf.all.secure_redirects = 0' | |
| - regexp: '^net.ipv4.conf.default.secure_redirects' | |
| line: 'net.ipv4.conf.default.secure_redirects = 0' |
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.
However, with the previous use of the ansible.posix.sysctl with sysctl_set these options should already be persistent on the system meaning this task would not be needed. Thoughts?
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.
loop with the separated regexp: and line are easier to read. I'd be happy to test it and update. As for sysctl_set, my understanding from the documentation is that it is the equivalent of sysctl -w which does not appear to write the configuration line to /etc/sysctl.conf. Therefore to ensure the lines were written to the config file, I have been updating the file as well.
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.
the module will set the valures in the default sysctl file, unless specifically disabled. https://docs.ansible.com/projects/ansible/latest/collections/ansible/posix/sysctl_module.html#parameter-sysctl_file
added a group of tasks to disable ICMP redirects and included the file in main.yml