Ensure Fedora GPG Key Installed
An XCCDF Rule
Description
To ensure the system can cryptographically verify base software packages come from Fedora (and to connect to the Fedora Network to receive them), the Fedora GPG key must properly be installed. To install the Fedora GPG key, run one of the commands below, depending on your Fedora vesion:
$ sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-38-primary"
$ sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-37-primary"
Rationale
Changes to 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. The Fedora GPG key is necessary to cryptographically verify packages are from Fedora."
- ID
- xccdf_org.ssgproject.content_rule_ensure_fedora_gpgkey_installed
- Severity
- High
- References
- Updated
Remediation - Shell Script
if ! rpm -q --quiet "gpg" ; then
dnf install -y "gpg"
fi
fedora_version=$(grep -oP '[[:digit:]]+' /etc/redhat-release)