Skip to main content

Module sysctl

Module sysctl 

Source
Expand description

sysctl kernel-parameter actions.

GetSysctl is a read-only query of one key (or the full table); SetSysctl changes a kernel parameter at runtime and persists it for the next boot.

The read runs sysctl directly (the daemon is root). The write goes through the root-owned helper /usr/lib/sysknife/sysctl-edit, which applies the value with sysctl -w and rewrites the /etc/sysctl.d/60-sysknife.conf drop-in idempotently — a narrow sudoers grant, not a bare sysctl grant, so the daemon cannot use sysctl -p <arbitrary-file> to load an attacker file.

Functions§

get_sysctl
Read one kernel parameter (sysctl -- <key>) or, when key is None, the entire table (sysctl -a). Read-only.
set_sysctl
Set and persist a kernel parameter via the scoped helper.
specs