1.314 ALMA-09-040720

Information

AlmaLinux OS 9 must disable access to network bpf system call from nonprivileged processes.

GROUP ID: V-269422
RULE ID: SV-269422r1117266

Loading and accessing the packet filters programs and maps using the bpf() system call has the potential of revealing sensitive information about the kernel state.

Solution

Configure AlmaLinux OS 9 to prevent privilege escalation through the kernel by disabling access to the bpf syscall with the following command:

$ echo "kernel.unprivileged_bpf_disabled = 1" > /etc/sysctl.d/60-bpf.conf

Load settings from all system configuration files with the following command:

$ sysctl --system

See Also

https://workbench.cisecurity.org/benchmarks/27039