Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix crypto policy settings in RHEL 8 CIS#14066

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
jan-cerny wants to merge4 commits intoComplianceAsCode:master
base:master
Choose a base branch
Loading
fromjan-cerny:rhel8_crypto_sub

Conversation

@jan-cerny
Copy link
Collaborator

Add a new rulecrypto_sub_policies_cis_rhel8 that configures multiple custom crypto sub policy modules for RHEL 8 CIS. The new rule is very similar tofips_custom_stig_sub_policy. It configures new modules for system wide crypto policies that reduces the set of usable ciphers in sshd, MACs, and others.

The rule is templated by a new templatecrypto_sub_policies that is also introduced in this commit so that the code can be reused in other similar rules.

This change aligns the RHEL 8 CIS profiles in CaC with the CIS RHEL 8 Benchmark v4.0.0 requirements. All crypto requirements of this profile are now covered by this single rule. The reason for merging all of the sub module configuration is to prevent overriding crypto policy settings. If there would be multiple rules, each of them would call theupdate-crypto-policies commands with a different sub policy, overriding each other.

This supersedes#14050

Resolves:https://issues.redhat.com/browse/RHEL-111896

@openshift-ciopenshift-cibot added the do-not-merge/work-in-progressUsed by openshift-ci bot. labelOct 30, 2025
@openshift-ci
Copy link

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

@jan-cernyjan-cerny added bugfixFixes to reported bugs. RHEL8Red Hat Enterprise Linux 8 product related. CISCIS Benchmark related. and removed do-not-merge/work-in-progressUsed by openshift-ci bot. labelsOct 30, 2025
@jan-cernyjan-cerny added this to the0.1.79 milestoneOct 30, 2025
Copy link
Member

@ggbeckerggbecker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I believe the same should apply for all other CIS RHEL (9/10) major versions.

And would be ideal if the rule would not be RHEL8 centric. We could in theory set the sub_policies variable according to the RHEL version.

Also I believe that it is still valid to check for particular submodules in the crypto policy, for example there would still have a need for the rule that checks if the current crypto policy respects a given security requirement (e.g. no weak mac), this rule would simply check if the submodule contains the right algorithm restriction, and the remediation can simply be reapply the expected sub crypto policy in case of deviation.

This would not imply a change in the CIS benchmarks for example, where they have a requirement for each of the restriction they expect.

I also don't like the name of the rule, instead of crypto_sub_policies_cis_rhel8,
maybe something like configure_custom_crypto_policy_cis

@jan-cerny
Copy link
CollaboratorAuthor

@ggbecker

I believe the same should apply for all other CIS RHEL (9/10) major versions.

Great idea! I have checked the latest versions of RHEL 9 and RHEL 10 CIS Benchmarks and I found they also use the approach to configure cryptography by creating custom crypto policy sub modules. They are very similar to the RHEL 8 bu sometimes with different values. I think I will extend this change to use the new rule also on RHEL 9 and RHEL 10.

And would be ideal if the rule would not be RHEL8 centric. We could in theory set the sub_policies variable according to the RHEL version.

Yes, that makes sense.

Also I believe that it is still valid to check for particular submodules in the crypto policy, for example there would still have a need for the rule that checks if the current crypto policy respects a given security requirement (e.g. no weak mac), this rule would simply check if the submodule contains the right algorithm restriction, and the remediation can simply be reapply the expected sub crypto policy in case of deviation.

I'm not sure if I follow. Can you try to rephrase or explain this a little more? The current code in this PR contains OVAL that checks the contents of the submodule file (.pmod) file, I believe that this way it checks if the current crypto policy respects a given security requirement (e.g. no weak mac).

This would not imply a change in the CIS benchmarks for example, where they have a requirement for each of the restriction they expect.

Is your concern about the fact that after this change we would cover multiple controls with a single rule?

I'm concerned about covering multiple requirements by single rule as well. The previous PR#14050 has the configuration split into 4 different rules. That's better for the granularity, and I'd prefer that. However, it has a problem that when the remediation of a rule runs theupdate-crypto-policies command it adds the crypto policy sub module configured by the rule but removes the others because it has no information that there are other rules adding other modules. That's a blocker because the test fails and the final state after all 4 rules are applied isn't compliant. I couldn't find a solution for this.

I also don't like the name of the rule, instead of crypto_sub_policies_cis_rhel8,
maybe something like configure_custom_crypto_policy_cis

OK, makes sense once I incorporate the change to RHEL 9 and RHEL 10 CIS profiles.

@jan-cernyjan-cerny added the HighlightThis PR/Issue should make it to the featured changelog. labelOct 31, 2025
@openshift-merge-robotopenshift-merge-robot added the needs-rebaseUsed by openshift-ci bot. labelOct 31, 2025
@openshift-merge-robotopenshift-merge-robot removed the needs-rebaseUsed by openshift-ci bot. labelOct 31, 2025
@jan-cerny
Copy link
CollaboratorAuthor

I have rebased this PR on the top of the latest upstream master branch. I have renamed the rule and started using it in RHEL 9 and RHEL 10 CIS control files.

@jan-cerny
Copy link
CollaboratorAuthor

I have rebased this PR on the top of the latest upstream master branch.

@openshift-merge-robotopenshift-merge-robot added the needs-rebaseUsed by openshift-ci bot. labelNov 5, 2025
Add a new rule `crypto_sub_policies_cis_rhel8` that configures multiplecustom crypto sub policy modules for RHEL 8 CIS. The new rule is verysimilar to `fips_custom_stig_sub_policy`. It configures new modules forsystem wide crypto policies that reduces the set of usable ciphers insshd, MACs, and others.The rule is templated by a new template `crypto_sub_policies` that isalso introduced in this commit so that the code can be reused in othersimilar rules.This change aligns the RHEL 8 CIS profiles in CaC with the CIS RHEL 8Benchmark v4.0.0 requirements. All crypto requirements of this profileare now covered by this single rule. The reason for merging all of thesub module configuration is to prevent overriding crypto policysettings. If there would be multiple rules, each of them would callthe `update-crypto-policies` commands with a different sub policy,overriding each other.This supersedesComplianceAsCode#14050Resolves:https://issues.redhat.com/browse/RHEL-111896
I have checked the latest versions of RHEL 9 and RHEL 10 CIS Benchmarksand I found they also use the approach to configure cryptography bycreating custom crypto policy sub modules. They are very similar to theRHEL 8 bu sometimes with different values.In this commit, we will start using the rule configure_custom_crypto_policy_cisin CIS for RHEL 9 and RHEL 10 as well, in a similar way to RHEL 8.
@jan-cerny
Copy link
CollaboratorAuthor

I have rebased this PR on the top of the latest upstream master branch.

@openshift-merge-robotopenshift-merge-robot removed the needs-rebaseUsed by openshift-ci bot. labelNov 5, 2025
@ggbecker
Copy link
Member

Also I believe that it is still valid to check for particular submodules in the crypto policy, for example there would still have a need for the rule that checks if the current crypto policy respects a given security requirement (e.g. no weak mac), this rule would simply check if the submodule contains the right algorithm restriction, and the remediation can simply be reapply the expected sub crypto policy in case of deviation.

I'm not sure if I follow. Can you try to rephrase or explain this a little more? The current code in this PR contains OVAL that checks the contents of the submodule file (.pmod) file, I believe that this way it checks if the current crypto policy respects a given security requirement (e.g. no weak mac).

That is correct, I believe my concern is related to what I wrote on the following remark.

This would not imply a change in the CIS benchmarks for example, where they have a requirement for each of the restriction they expect.

Is your concern about the fact that after this change we would cover multiple controls with a single rule?

I'm concerned about covering multiple requirements by single rule as well. The previous PR#14050 has the configuration split into 4 different rules. That's better for the granularity, and I'd prefer that. However, it has a problem that when the remediation of a rule runs theupdate-crypto-policies command it adds the crypto policy sub module configured by the rule but removes the others because it has no information that there are other rules adding other modules. That's a blocker because the test fails and the final state after all 4 rules are applied isn't compliant. I couldn't find a solution for this.

Yes, my concern was that this change would cover multiple controls with a single rule.

I think one approach is for these fine granular rules to have the same remediation as the rule proposed in this pull request, so it would simply reapply the same custom crypto-policy (with all the requirements from the individual controls) if any of the individual rule is failing. You lose a bit the control of what is remediating and may lose some more customization made by the user, but on the other hand you can't really remediate them individually.

jan-cerny reacted with heart emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@ggbeckerggbeckerggbecker left review comments

@matusmarhefkamatusmarhefkaAwaiting requested review from matusmarhefkamatusmarhefka will be requested when the pull request is marked ready for reviewmatusmarhefka is a code owner

@Mab879Mab879Awaiting requested review from Mab879Mab879 will be requested when the pull request is marked ready for reviewMab879 is a code owner

@vojtapolasekvojtapolasekAwaiting requested review from vojtapolasekvojtapolasek will be requested when the pull request is marked ready for reviewvojtapolasek is a code owner

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

bugfixFixes to reported bugs.CISCIS Benchmark related.HighlightThis PR/Issue should make it to the featured changelog.RHEL8Red Hat Enterprise Linux 8 product related.

Projects

None yet

Milestone

0.1.79

Development

Successfully merging this pull request may close these issues.

3 participants

@jan-cerny@ggbecker@openshift-merge-robot

[8]ページ先頭

©2009-2025 Movatter.jp