1.2.1.3 Ensure access to gpg key files are configured

Information

GPG key files are cryptographic keys used by APT to verify the authenticity and integrity of software packages. Each key ensures that packages come from a trusted source and have not been tampered with. These keys are typically stored in keyring directories /etc/apt/trusted.gpg.d or /usr/share/keyrings and referenced in repository configuration files using the signed-by option for secure package verification.

Solution

Run the following commands to update the access to any file(s) returned in the audit steps above:

# chown root:root \"/absolute/path/to/file\"
# chmod u-x,go-wx \"/absolute/path/to/file\"

Example

# chown root:root /usr/share/keyrings/debian-archive-trixie-security-automatic.gpg
# chmod u-x,go-wx /usr/share/keyrings/debian-archive-trixie-security-automatic.gpg

Note : APT first checks keys specified with the signed-by option in a repository's .sources or .list files. If no key is specified there, it falls back to administrator-managed keyrings in /etc/apt/trusted.gpg.d, then system-wide keyrings in /usr/share/keyrings.

Impact:

The apt-key command is deprecated, and you should manage keyring files individually in the trusted.gpg.d directory instead. This change is due to security concerns with the way apt-key works, as it adds keys to the /etc/apt/trusted.gpg file, which can lead to potential security issues.

See Also

https://workbench.cisecurity.org/benchmarks/24932

Item Details

Category: ACCESS CONTROL

References: 800-53|AC-3

Plugin: Unix

Control ID: e8c567c4672f427a8796b79771c694fad80ebbecd2f9e2d4aad8780b8330981f