Add sysctl persistence rules for Debian#14768
Open
israel-villar wants to merge 1 commit into
Open
Conversation
Two new rules that address Debian-specific sysctl persistence issues: - sysctl_conf_symlink_etc_sysctl_d: ensure /etc/sysctl.d/99-sysctl.conf is a symlink pointing to /etc/sysctl.conf. Debian's systemd-sysctl processes /etc/sysctl.d/ at boot but does not read /etc/sysctl.conf directly unless this symlink exists. - sysctl_reapply_after_network: install a systemd oneshot service that re-applies sysctl settings after network interfaces come up. The Linux kernel resets certain network sysctl values (e.g. net.ipv4.conf.*.accept_redirects) when a NIC is brought up, which causes compliant values written at boot to be overwritten. The OVAL for sysctl_conf_symlink_etc_sysctl_d uses unix:file_test with type="symbolic link" rather than unix:symlink_test, which errors when the symlink is absent or dangling. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Hi @israel-villar. Thanks for your PR. I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two new rules that address Debian-specific sysctl persistence issues:
sysctl_conf_symlink_etc_sysctl_d: ensure /etc/sysctl.d/99-sysctl.conf is a symlink pointing to /etc/sysctl.conf. Debian's systemd-sysctl processes /etc/sysctl.d/ at boot but does not read /etc/sysctl.conf directly unless this symlink exists.
sysctl_reapply_after_network: install a systemd oneshot service that re-applies sysctl settings after network interfaces come up. The Linux kernel resets certain network sysctl values (e.g. net.ipv4.conf.*.accept_redirects) when a NIC is brought up, which causes compliant values written at boot to be overwritten.
The OVAL for sysctl_conf_symlink_etc_sysctl_d uses unix:file_test with type="symbolic link" rather than unix:symlink_test, which errors when the symlink is absent or dangling.
Description:
sysctl_conf_symlink_etc_sysctl_d: ensure/etc/sysctl.d/99-sysctl.confis a symlink pointing to/etc/sysctl.conf. The bash remediation creates the symlink if absent.The OVAL check uses
unix:file_testwithtype="symbolic link".sysctl_reapply_after_network: install a systemd oneshot service thatre-applies
sysctl --systemafter network interfaces come up (vianetwork-online.target). The bash remediation writes the unit file andenables it. The OVAL check verifies the unit file exists and is enabled.
Rationale:
systemd-sysctlprocesses/etc/sysctl.d/at boot but doesnot read
/etc/sysctl.confdirectly unless the symlink/etc/sysctl.d/99-sysctl.conf -> /etc/sysctl.confexists.net.ipv4.conf.*.accept_redirects) when a NIC is brought up, whichcauses compliant values written at boot to be overwritten on Debian.
Review Hints:
sysctl_conf_symlink_etc_sysctl_dusesunix:file_testwith
type="symbolic link"rather thanunix:symlink_test.unix:symlink_testerrors when the symlink is absent or dangling;unix:file_testhandles non-existence gracefully../build_product debian13 --datastream-only