RHEL 9 must have GPG signature verification enabled for all software repositories.

STIG ID: RHEL-09-214025  |  SRG: SRG-OS-000366-GPOS-00153 | Severity: high |  CCI: CCI-003992

Vulnerability Discussion

Changes to any software components can have significant effects on the overall security of the operating system. This requirement ensures the software has not been tampered with and that it has been provided by a trusted vendor.

All software packages must be signed with a cryptographic key recognized and approved by the organization.

Verifying the authenticity of software prior to installation validates the integrity of the software package received from a vendor. This verifies the software has not been tampered with and that it has been provided by a trusted vendor.

Check

Verify that all software repositories defined in "/etc/yum.repos.d/" have been configured with "gpgcheck" enabled:

$ grep gpgcheck /etc/yum.repos.d/*.repo | more

gpgcheck = 1

If "gpgcheck" is not set to "1" for all returned lines, this is a finding.

Fix

Configure all software repositories defined in "/etc/yum.repos.d/" to have "gpgcheck" enabled:

$ sudo sed -i 's/gpgcheck\s*=.*/gpgcheck=1/g' /etc/yum.repos.d/*