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

Create CIS rules for login banners #12472

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

jan-cerny
Copy link
Collaborator

RHEL 8 CIS Benchmark v3.0.0 and RHEL 9 CIS Benchmark v2.0.0 in sections 1.7.1, 1.7.2 and 1.7.3 require to configure login banners. Currently, these requirements are covered in our content by rules banner_etc_motd, banner_etc_issue and banner_etc_issue_net. However, these rules don't exactly align with the CIS requirements. The rules require an exact banner text that can only differ in white space but must be the same. But, the CIS requirements allow custom banner texts with local policy. Moreover, they require not displaying versions and kernels in the banner text, which isn't checked in our rules. Although applying our rules makes the system compliant, many configurations that comply with CIS will not pass the scan. We will replace these rules with new rules that are better aligned with CIS and will pass with custom banners. The new rules are very similar and therefore a new template cis_banner has been created to share code among them.

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

@jan-cerny jan-cerny added bugfix Fixes to reported bugs. Ansible Ansible remediation update. OVAL OVAL update. Related to the systems assessments. Bash Bash remediation update. New Rule Issues or pull requests related to new Rules. RHEL9 Red Hat Enterprise Linux 9 product related. Update Profile Issues or pull requests related to Profiles updates. RHEL8 Red Hat Enterprise Linux 8 product related. CIS CIS Benchmark related. RHEL10 Red Hat Enterprise Linux 10 product related. labels Oct 4, 2024
@jan-cerny jan-cerny added this to the 0.1.75 milestone Oct 4, 2024
@jan-cerny jan-cerny requested a review from a team as a code owner October 4, 2024 12:09
Copy link

github-actions bot commented Oct 4, 2024

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

rhel8 (from CTF) Environment (using Fedora as testing environment)
Open in Gitpod

Fedora Testing Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

Copy link

github-actions bot commented Oct 4, 2024

This datastream diff is auto generated by the check Compare DS/Generate Diff

Click here to see the full diff
New content has different text for rule 'xccdf_org.ssgproject.content_rule_banner_etc_issue'.
--- xccdf_org.ssgproject.content_rule_banner_etc_issue
+++ xccdf_org.ssgproject.content_rule_banner_etc_issue
@@ -165,9 +165,6 @@
 RHEL-08-010060
 
 [reference]:
-1.7.2
-
-[reference]:
 SV-230227r627750_rule
 
 [rationale]:

New content has different text for rule 'xccdf_org.ssgproject.content_rule_banner_etc_issue_net'.
--- xccdf_org.ssgproject.content_rule_banner_etc_issue_net
+++ xccdf_org.ssgproject.content_rule_banner_etc_issue_net
@@ -61,9 +61,6 @@
 [reference]:
 SRG-OS-000228-GPOS-00088
 
-[reference]:
-1.7.3
-
 [rationale]:
 Display of a standardized and approved use notification before granting
 access to the operating system ensures privacy and security notification

New content has different text for rule 'xccdf_org.ssgproject.content_rule_banner_etc_motd'.
--- xccdf_org.ssgproject.content_rule_banner_etc_motd
+++ xccdf_org.ssgproject.content_rule_banner_etc_motd
@@ -37,9 +37,6 @@
         
         I've read & consent to terms in IS user agreem't.
 
-[reference]:
-1.7.1
-
 [rationale]:
 Display of a standardized and approved use notification before granting
 access to the operating system ensures privacy and security notification

Copy link

github-actions bot commented Oct 4, 2024

🤖 A k8s content image for this PR is available at:
ghcr.io/complianceascode/k8scontent:12472
This image was built from commit: 264af69

Click here to see how to deploy it

If you alread have Compliance Operator deployed:
utils/build_ds_container.py -i ghcr.io/complianceascode/k8scontent:12472

Otherwise deploy the content and operator together by checking out ComplianceAsCode/compliance-operator and:
CONTENT_IMAGE=ghcr.io/complianceascode/k8scontent:12472 make deploy-local

RHEL 8 CIS Benchmark v3.0.0 and RHEL 9 CIS Benchmark v2.0.0 in sections
1.7.1, 1.7.2 and 1.7.3 require to configure login banners. Currently,
these requirements are covered in our content by rules `banner_etc_motd`,
`banner_etc_issue` and `banner_etc_issue_net`. However, these rules
don't exactly align with the CIS requirements. The rules require an
exact banner text that can only differ in white space but must be the
same. But, the CIS requirements allow custom banner texts with local
policy. Moreover, they require not displaying versions and kernels
in the banner text, which isn't checked in our rules. Although applying
our rules makes the system compliant, many configurations that comply
with CIS will not pass the scan. We will replace these rules with new
rules that are better aligned with CIS and will pass with custom
banners. The new rules are very similar and therefore a new template
`cis_banner` has been created to share code among them.

Resolves: https://issues.redhat.com/browse/RHEL-59133
Copy link

codeclimate bot commented Oct 4, 2024

Code Climate has analyzed commit 264af69 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 59.5% (0.0% change).

View more on Code Climate.

@Mab879 Mab879 self-assigned this Oct 9, 2024
Copy link
Member

@Mab879 Mab879 left a comment

Choose a reason for hiding this comment

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

Thanks!

@Mab879 Mab879 merged commit f1eba99 into ComplianceAsCode:master Oct 9, 2024
96 of 100 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ansible Ansible remediation update. Bash Bash remediation update. bugfix Fixes to reported bugs. CIS CIS Benchmark related. New Rule Issues or pull requests related to new Rules. OVAL OVAL update. Related to the systems assessments. RHEL8 Red Hat Enterprise Linux 8 product related. RHEL9 Red Hat Enterprise Linux 9 product related. RHEL10 Red Hat Enterprise Linux 10 product related. Update Profile Issues or pull requests related to Profiles updates.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants