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

Introduce CCN profiles for RHEL9 #10860

Merged

Conversation

marcusburghardt
Copy link
Member

Description:

The #10801 introduced a new control file for CCN Policy for RHEL9.
This PRs reviewed all related_rules in the planned items, included the CCN reference in these rules, moved them to rules and updated the requirement status.

Finally, it was created three new profiles for RHEL9, each based on a CCN level:

  • Basic
  • Interemediate
  • Advanced

At this initial version, about 70% of the requirements are automated.

$ utils/controleval.py stats -p rhel9 -i ccn_rhel9 -l advanced
General stats:
all                  81 /  81 = 100.0%
applicable           81 /  81 = 100.0%
assessed             61 /  81 = 75.31%
full coverage        57 /  81 = 70.37%
not assessed         20 /  81 = 24.69%

Rationale:

New profile to attend RHEL9 users interested in CCN-STIC-610A22

Review Hints:

I carefully ensured that only rules already enabled for RHEL9 and used in other common profiles, like CIS and STIG, were included in this initial version. That way we can have stable profiles much less prone to unexpected issues.

I recommend to review this PR in two steps.
First we can check if the profiles are working as expected:

  1. ./build_product rhel9
  2. ./tests/ds_unselect_rules.sh build/ssg-rhel9-ds.xml tests/unselect_rules_list
    2.1. This is to disable some rules which cause issues in the test environment.
  3. Test the three profiles in a rhel9 VM:
    3.1. ./tests/automatus.py profile --libvirt qemu:///session rhel9 --datastream build/ssg-rhel9-ds.xml --remediate-using bash ccn_advanced
    3.2. ./tests/automatus.py profile --libvirt qemu:///session rhel9 --datastream build/ssg-rhel9-ds.xml --remediate-using bash ccn_intermediate
    3.3. ./tests/automatus.py profile --libvirt qemu:///session rhel9 --datastream build/ssg-rhel9-ds.xml --remediate-using bash ccn_basic

The second step would be to check the references included in the rules.
For this step the best approach is to check commit by commit, individually.

Don't be scared by the number of commits. They are quite small and are separated for better organization, with a better review experience in mind. ;)

Two rules in related_rules were not included in A.11.SEC-RHEL3 because
they were already included in previous requirements.
package_cryptsetup-luks_installed rule should be enough to complete this
requirement but it was not yet tested in RHEL9. It can be done in a
separate PR.
enable_authselect and dconf_db_up_to_date are special rules used to
ensure the system is using the tools necessary for other rules. It was
included CCN references from requirements where these impacted rules
mentioned at the first time.
A.30.SEC-RHEL1 requirements asks the value of 8 for
var_accounts_passwords_pam_faillock_deny variable.
A.5.SEC-RHEL5 requirement asks different values for the
var_accounts_maximum_age_login_defs and
var_accounts_password_warn_age_login_defs variables.
@marcusburghardt marcusburghardt added Highlight This PR/Issue should make it to the featured changelog. RHEL9 Red Hat Enterprise Linux 9 product related. New Profile Issues or pull requests related to new Profiles. labels Jul 17, 2023
@marcusburghardt marcusburghardt added this to the 0.1.69 milestone Jul 17, 2023
@marcusburghardt marcusburghardt requested a review from a team as a code owner July 17, 2023 14:55
@Mab879 Mab879 self-assigned this Jul 17, 2023
@github-actions
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

@marcusburghardt
Copy link
Member Author

codeclimate is complaining about a Line too long (183 > 99 characters) but the referenced line includes the URL for the CCN Policy, which is indeed very long but correct. So, this codeclimate hit can be safely waived in this case.

@marcusburghardt
Copy link
Member Author

I will take a look in these product stability tests and try restrict the changes to rhel9 only.

Currently, the RHEL9 is the only product using the CCN policy.
@marcusburghardt
Copy link
Member Author

I will take a look in these product stability tests and try restrict the changes to rhel9 only.

Done

@codeclimate
Copy link

codeclimate bot commented Jul 17, 2023

Code Climate has analyzed commit 4d16377 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 53.4% (0.0% change).

View more on Code Climate.

@@ -242,6 +242,9 @@
anssi=Reference(
id="anssi", name="ANSSI", url=anssi_ns,
regex_with_groups=r"BP28\(R(\d+)\)"),
ccn=Reference(
id="ccn", name="CCN", url="",
regex_with_groups=r"A.(\d+).SEC-RHEL(\d+)"),
Copy link
Member

Choose a reason for hiding this comment

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

This fine for now, but if other products (SUSE, etc) need a CCN reference we will need to change this.

@Mab879 Mab879 merged commit 24eaf3d into ComplianceAsCode:master Jul 17, 2023
33 of 34 checks passed
@marcusburghardt marcusburghardt deleted the ccn_rhel9_planned_coverage branch July 17, 2023 18:25
@marcusburghardt marcusburghardt added the CCN CCN Benchmark related. label Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CCN CCN Benchmark related. Highlight This PR/Issue should make it to the featured changelog. New Profile Issues or pull requests related to new Profiles. RHEL9 Red Hat Enterprise Linux 9 product related.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants