Description of problem:
The probes that check for kernel arguments such as whether the audit=1 kernel argument has been added do not work because they seem to be checking for /boot/grub2/grubenv. This is not what's being used on RHCOS, the file is more or less empty there. We need to adjust the probes to check for something different.
SCAP Security Guide Version:
as built from git as of today
Operating System Version:
RHCOS
Steps to Reproduce:
- set kernel parameters with a MC
- reboot the node
- make sure the kernel parameters are set e.g. with cat /proc/cmdline
Actual Results:
the rule would still fail
Expected Results:
the rule should now pass
Addition Information/Debugging Steps:
I guess the question is how to check the kernel arguments. The first thing that comes to my mind is /proc/cmdline. Is there a reason not to check that in the first place?
I did a little digging how is the kernel argument set on RHCOS and it goes like this:
- a MachineConfig with an Ignition spec is defined by the admin
- the MC is read by the machineConfig deamon (MCD) that is running on each cluster node
- the MCD aggregates the resulting kernel arguments from all the applied MCs and calls
rpm-ostree kargs and passes the list of the kernel arguments
rpm-ostree seems to write the kernel arguments to /boot/loader/entries/ostree-$version-rhcos.conf but I'm unsure how to tell which is the "current" version
rpm-ostree also allows you to print the current kernel arguments with rpm-ostree kargs but I'm unsure if it's realistic to call this from the scanner because of library loading issues and all that.
Before digging even more about how the ostree works, is using /proc/cmdline acceptable? We seem to be using the proc filesystem for the sysctls, so..
Description of problem:
The probes that check for kernel arguments such as whether the audit=1 kernel argument has been added do not work because they seem to be checking for
/boot/grub2/grubenv. This is not what's being used on RHCOS, the file is more or less empty there. We need to adjust the probes to check for something different.SCAP Security Guide Version:
as built from git as of today
Operating System Version:
RHCOS
Steps to Reproduce:
Actual Results:
the rule would still fail
Expected Results:
the rule should now pass
Addition Information/Debugging Steps:
I guess the question is how to check the kernel arguments. The first thing that comes to my mind is
/proc/cmdline. Is there a reason not to check that in the first place?I did a little digging how is the kernel argument set on RHCOS and it goes like this:
rpm-ostree kargsand passes the list of the kernel argumentsrpm-ostreeseems to write the kernel arguments to/boot/loader/entries/ostree-$version-rhcos.confbut I'm unsure how to tell which is the "current" versionrpm-ostree also allows you to print the current kernel arguments with
rpm-ostree kargsbut I'm unsure if it's realistic to call this from the scanner because of library loading issues and all that.Before digging even more about how the ostree works, is using
/proc/cmdlineacceptable? We seem to be using the proc filesystem for the sysctls, so..