-
Notifications
You must be signed in to change notification settings - Fork 745
Introduce rule enable_gpgcheck_for_all_repositories #13156
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 rule enable_gpgcheck_for_all_repositories #13156
Conversation
This datastream diff is auto generated by the check Click here to see the full diffNew content has different text for rule 'xccdf_org.ssgproject.content_rule_ensure_gpgcheck_never_disabled'.
--- xccdf_org.ssgproject.content_rule_ensure_gpgcheck_never_disabled
+++ xccdf_org.ssgproject.content_rule_ensure_gpgcheck_never_disabled
@@ -170,9 +170,6 @@
SRG-OS-000366-GPOS-00153
[reference]:
-RHEL-08-010370
-
-[reference]:
R59
[reference]:
@@ -184,9 +181,6 @@
[reference]:
6.3
-[reference]:
-SV-230264r1017377_rule
-
[rationale]:
Verifying the authenticity of the software prior to installation validates
the integrity of the patch or upgrade received from a vendor. This ensures
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_ensure_gpgcheck_never_disabled' differs.
--- xccdf_org.ssgproject.content_rule_ensure_gpgcheck_never_disabled
+++ xccdf_org.ssgproject.content_rule_ensure_gpgcheck_never_disabled
@@ -8,7 +8,6 @@
tags:
- CCE-80792-5
- CJIS-5.10.4.1
- - DISA-STIG-RHEL-08-010370
- NIST-800-171-3.4.8
- NIST-800-53-CM-11(a)
- NIST-800-53-CM-11(b)
@@ -42,7 +41,6 @@
tags:
- CCE-80792-5
- CJIS-5.10.4.1
- - DISA-STIG-RHEL-08-010370
- NIST-800-171-3.4.8
- NIST-800-53-CM-11(a)
- NIST-800-53-CM-11(b) |
This commit introduces new rule `enable_gpgcheck_for_all_repositories` which is better aligned with DISA rule `SV-230264r1017377_rule` than currently existing rules `ensure_gpgcheck_globally_activated` and co-existing `ensure_gpgcheck_never_disabled`. The rule `ensure_gpgcheck_globally_activated` checks for `gpgcheck=1` in `/etc/yum.conf` ie. in global configuration. The rule `ensure_gpgcheck_never_disabled` checks that no `.repo file in `/etc/yum.repos.d` contains `gpgcheck=0`. DISA's rule `SV-230264r1017377_rule` checks for `gpgcheck` settings in all `.repo` files in `/etc/yum.repos.d` ie. per-repo configuration. We need to realize that per-repo settings take precendence over global configuration. The new rule `enable_gpgcheck_for_all_repositories` will check for `gpgcheck` settings in all `.repo` files in `/etc/yum.repos.d`. The commit will add the new rule to RHEL 8 STIG profile. Fixes: ComplianceAsCode#13110
9acf000
to
5f9f27d
Compare
checktext: |- | ||
Verify the operating system prevents the installation of patches, service packs, device drivers, or operating system components from a repository without verification that they have been digitally signed using a certificate that is recognized and approved by the organization. | ||
|
||
Check that YUM verifies the signature of packages from a repository prior to install with the following command: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check that YUM verifies the signature of packages from a repository prior to install with the following command: | |
Check that DNF verifies the signature of packages from a repository prior to install with the following command: |
YUM has been dead since RHEL 8 has been released.
or use {{{ pkg_manager }}}
.
gpgcheck=1 | ||
|
||
checktext: |- | ||
Verify the operating system prevents the installation of patches, service packs, device drivers, or operating system components from a repository without verification that they have been digitally signed using a certificate that is recognized and approved by the organization. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verify the operating system prevents the installation of patches, service packs, device drivers, or operating system components from a repository without verification that they have been digitally signed using a certificate that is recognized and approved by the organization. | |
Verify {{{ full_name }}} prevents the installation of patches, service packs, device drivers, or operating system components from a repository without verification that they have been digitally signed using a certificate that is recognized and approved by the organization. |
A value of <tt>0</tt> indicates that <tt>gpgcheck</tt> has been disabled for that repo. | ||
|
||
fixtext: |- | ||
Configure the operating system to verify the signature of packages from a repository prior to install by setting the following option in the "/etc/yum.repos.d/[your_repo_name].repo" file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Configure the operating system to verify the signature of packages from a repository prior to install by setting the following option in the "/etc/yum.repos.d/[your_repo_name].repo" file: | |
Configure {{{ full_name }}} to verify the signature of packages from a repository prior to install by setting the following option in the "/etc/yum.repos.d/[your_repo_name].repo" file: |
cat > /etc/yum.repos.d/fedora.repo <<EOF | ||
[fedora] | ||
name=Fedora 41 - x86_64 | ||
#baseurl=http://download.example/pub/fedora/linux/releases/41/Everything/x86_64/os/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#baseurl=http://download.example/pub/fedora/linux/releases/41/Everything/x86_64/os/ | |
#baseurl=http://download.example.com/pub/fedora/linux/releases/41/Everything/x86_64/os/ |
Please replace this everywhere in your examples. Just to be safe.
- encrypt_partitions | ||
- ensure_gpgcheck_globally_activated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these need to go into the default.profile
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They don't, they are part of many other RHEL 8 profiles (CIS, ANSSI, ...).
/packit build |
2 similar comments
/packit build |
/packit build |
Code Climate has analyzed commit 586ed5d 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 62.0% (0.0% change). View more on Code Climate. |
Automatus tests pass locally, waving. |
Uh oh!
There was an error while loading. Please reload this page.
This commit introduces new rule
enable_gpgcheck_for_all_repositories
which is better aligned with DISA ruleSV-230264r1017377_rule
than currently existing rulesensure_gpgcheck_globally_activated
and co-existingensure_gpgcheck_never_disabled
. The ruleensure_gpgcheck_globally_activated
checks forgpgcheck=1
in/etc/yum.conf
ie. in global configuration. The ruleensure_gpgcheck_never_disabled
checks that no.repo
file in/etc/yum.repos.d
containsgpgcheck=0
. DISA's ruleSV-230264r1017377_rule
checks forgpgcheck
settings in all.repo
files in/etc/yum.repos.d
ie. per-repo configuration. We need to realize that per-repo settings take precendence over global configuration. The new ruleenable_gpgcheck_for_all_repositories
will check forgpgcheck
settings in all.repo
files in/etc/yum.repos.d
. The commit will add the new rule to RHEL 8 STIG profile.Fixes: #13110