Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add kickstart remediation to service_kdump_disabled #12856

Merged
merged 1 commit into from
Jan 20, 2025

Conversation

jan-cerny
Copy link
Collaborator

@jan-cerny jan-cerny commented Jan 20, 2025

This change will cause that the kickstart file generated by OpenSCAP will contain %addon com_redhat_kdump --disable section.

This PR partially addresses #12832 but it doesn't fix it completely.

Adding the section %addon com_redhat_kdump --disable to kickstart causes that kdump doesn't work in the installed system. Adding the section is equivalent to clicking on "Disable kdump" in the GUI installation. Both makes the kdump.service fail to start.

However, disabling kdump this way will not make our rule service_kdump_disabled pass. This rule will still fail because it requires the kdump.service to be masked.

The %addon com_redhat_kdump --disable doesn't mask the kdump.service. And unfortunately, the service --disable command in kickstart also doesn't mask the kdump.service.

In other words, we have hit one of the current issues of the Liteweight Anaconda hardening feature, that it doesn't mask the services. This has already been reported in #12282 (second part of the description section).

@jan-cerny jan-cerny added the RHEL10 Red Hat Enterprise Linux 10 product related. label Jan 20, 2025
@jan-cerny jan-cerny added this to the 0.1.76 milestone Jan 20, 2025
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Used by openshift-ci bot. label Jan 20, 2025
Copy link

openshift-ci bot commented Jan 20, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

Copy link

Start a new ephemeral environment with changes proposed in this pull request:

Fedora Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

@jan-cerny jan-cerny force-pushed the issue_12832 branch 3 times, most recently from 481824c to 24c741f Compare January 20, 2025 13:51
@Mab879 Mab879 self-assigned this Jan 20, 2025
This change will cause that the kickstart file generated by OpenSCAP
will contain `%addon com_redhat_kdump --disable` section.

Fixes: ComplianceAsCode#12832
Copy link

codeclimate bot commented Jan 20, 2025

Code Climate has analyzed commit bb719a4 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 61.9% (0.0% change).

View more on Code Climate.

@jan-cerny jan-cerny marked this pull request as ready for review January 20, 2025 15:39
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Used by openshift-ci bot. label Jan 20, 2025
@jan-cerny
Copy link
Collaborator Author

/packit build

@comps
Copy link
Collaborator

comps commented Jan 20, 2025

I can verify that this PR does add the section to the kickstart:

# Disable the kdump kernel crash dumping mechanism (required for security compliance)
%addon com_redhat_kdump --disable
%end

However, as mentioned, services has no --mask, so the test continues failing: https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/automatically_installing_rhel/kickstart-commands-and-options-reference_rhel-installer#services_kickstart-commands-for-system-configuration

Something would need to generate an extra %post section with systemctl masking the service (or generally any services that should be disabled), if services --disabled=... does only soft-disable and not mask (meaning they can be started by a dependency).

@Mab879 Mab879 merged commit 2f98595 into ComplianceAsCode:master Jan 20, 2025
109 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RHEL10 Red Hat Enterprise Linux 10 product related.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants