Skip to content

RHCOS does not write kernel parameters into grub.conf #5285

@jhrozek

Description

@jhrozek

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:

  1. set kernel parameters with a MC
  2. reboot the node
  3. 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..

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions