Skip to content

Commit 1b3a792

Browse files
authored
Merge pull request #14193 from vojtapolasek/add_sq_to_rhel10
Use Sequoia in RHEL 10 instead of GPG
2 parents 0cce367 + ac9f4e3 commit 1b3a792

File tree

109 files changed

+210
-10
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+210
-10
lines changed

components/sequoia.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
name: sequoia
2+
packages:
3+
- sequoia-sq
4+
rules:
5+
- package_sequoia-sq_installed

controls/anssi.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,6 +1255,8 @@ controls:
12551255
- ensure_gpgcheck_globally_activated
12561256
- ensure_gpgcheck_local_packages
12571257
- ensure_redhat_gpgkey_installed
1258+
# this is relevant for RHEL only
1259+
- package_sequoia-sq_installed
12581260
- ensure_oracle_gpgkey_installed
12591261
- ensure_almalinux_gpgkey_installed
12601262

controls/e8.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ controls:
2525
- package_squid_removed
2626
- service_squid_disabled
2727
- ensure_redhat_gpgkey_installed
28+
# the rule ensure_redhat_gpgkey_installed needs a special package on RHEL 10 which is not installed by default
29+
- package_sequoia-sq_installed
2830
- ensure_gpgcheck_never_disabled
2931
- ensure_gpgcheck_local_packages
3032
- ensure_gpgcheck_globally_activated

controls/hipaa.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ controls:
171171
- ensure_gpgcheck_never_disabled
172172
- ensure_gpgcheck_repo_metadata
173173
- ensure_redhat_gpgkey_installed
174+
# This is needed for RHEL 10
175+
- package_sequoia-sq_installed
174176
- ensure_suse_gpgkey_installed
175177
- ensure_almalinux_gpgkey_installed
176178
status: automated

controls/ism_o.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,7 @@ controls:
604604
- ensure_gpgcheck_local_packages
605605
- ensure_gpgcheck_never_disabled
606606
- ensure_redhat_gpgkey_installed
607+
- package_sequoia-sq_installed
607608
- ensure_oracle_gpgkey_installed
608609
- dnf-automatic_security_updates_only
609610
status: automated

controls/ospp.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,8 @@ controls:
448448
- ensure_gpgcheck_local_packages
449449
- ensure_gpgcheck_never_disabled
450450
- ensure_redhat_gpgkey_installed
451+
# This package is needed for RHEL 10
452+
- package_sequoia-sq_installed
451453
status: automated
452454

453455
- id: FPT_TUD_EXT.2
@@ -462,6 +464,8 @@ controls:
462464
- ensure_gpgcheck_local_packages
463465
- ensure_gpgcheck_never_disabled
464466
- ensure_redhat_gpgkey_installed
467+
# This package is needed for RHEL 10
468+
- package_sequoia-sq_installed
465469
status: automated
466470

467471
- id: FPT_TST_EXT.1

controls/pcidss_4.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,6 +1556,8 @@ controls:
15561556
status: automated
15571557
rules:
15581558
- ensure_redhat_gpgkey_installed
1559+
# This package is needed for RHEL 10
1560+
- package_sequoia-sq_installed
15591561
- ensure_suse_gpgkey_installed
15601562
- ensure_almalinux_gpgkey_installed
15611563
- ensure_gpgcheck_globally_activated

controls/srg_gpos/SRG-OS-000366-GPOS-00153.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ controls:
1717
{{% endif %}}
1818
{{% if 'rhel' in product %}}
1919
- ensure_redhat_gpgkey_installed
20+
- package_sequoia-sq_installed
2021
{{% endif %}}
2122
{{% if 'ol' in families %}}
2223
- ensure_oracle_gpgkey_installed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
documentation_complete: true
2+
3+
title: 'Install sequoia-sq Package'
4+
5+
description: |-
6+
{{{ describe_package_install(package="sequoia-sq") }}}
7+
8+
rationale: |-
9+
The <tt>sequoia-sq</tt> package provides the <tt>sq</tt> command-line tool,
10+
which is used for OpenPGP operations including verification of GPG signatures.
11+
This tool is required for cryptographic verification of software packages and
12+
GPG keys using modern OpenPGP implementations.
13+
14+
severity: low
15+
16+
identifiers:
17+
cce@rhel10: CCE-86458-7
18+
19+
references:
20+
hipaa: 164.308(a)(1)(ii)(D),164.312(b),164.312(c)(1),164.312(c)(2),164.312(e)(2)(i)
21+
ospp: FPT_TUD_EXT.1,FPT_TUD_EXT.2
22+
srg: SRG-OS-000366-GPOS-00153
23+
24+
ocil_clause: 'the package is not installed'
25+
26+
ocil: '{{{ ocil_package(package="sequoia-sq") }}}'
27+
28+
template:
29+
name: package_installed
30+
vars:
31+
pkgname: sequoia-sq

linux_os/guide/system/software/updating/ensure_redhat_gpgkey_installed/ansible/shared.yml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,53 @@
33
# strategy = restrict
44
# complexity = medium
55
# disruption = medium
6-
- name: "Read permission of GPG key directory"
6+
- name: "{{{ rule_title }}}: Read permission of GPG key directory"
77
ansible.builtin.stat:
88
path: /etc/pki/rpm-gpg/
99
register: gpg_key_directory_permission
1010
check_mode: no
1111

1212
# It should fail if it doesn't find any fingerprints in file - maybe file was not parsed well.
1313

14-
- name: Read signatures in GPG key
14+
{{% if "rhel" in families and major_version_ordinal >= 10 %}}
15+
# RHEL >= 10: Use sq command from sequoia-sq package
16+
- name: "{{{ rule_title }}}: Read signatures in GPG key using sq"
17+
ansible.builtin.command: sq inspect /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
18+
changed_when: false
19+
failed_when: False
20+
check_mode: no
21+
register: gpg_fingerprints
22+
23+
- name: "{{{ rule_title }}}: Set Fact - Installed GPG Fingerprints (sq format)"
24+
ansible.builtin.set_fact:
25+
gpg_installed_fingerprints: "{{ gpg_fingerprints.stdout | regex_findall('Fingerprint:\\s*([0-9A-Fa-f]+)', '\\1') | list }}"
26+
{{% else %}}
27+
# RHEL 8, 9 and other versions: Use gpg command
28+
29+
- name: "{{{ rule_title }}}: Read signatures in GPG key"
1530
# According to /usr/share/doc/gnupg2/DETAILS fingerprints are in "fpr" record in field 10
1631
ansible.builtin.command: gpg --show-keys --with-fingerprint --with-colons "/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release"
1732
changed_when: False
1833
register: gpg_fingerprints
1934
failed_when: False
2035
check_mode: no
2136

22-
- name: Set Fact - Installed GPG Fingerprints
37+
- name: "{{{ rule_title }}}: Set Fact - Installed GPG Fingerprints"
2338
ansible.builtin.set_fact:
24-
gpg_installed_fingerprints: "{{ gpg_fingerprints.stdout | regex_findall('^pub.*\n(?:^fpr[:]*)([0-9A-Fa-f]*)', '\\1') | list }}"
39+
gpg_installed_fingerprints: "{{ gpg_fingerprints.stdout | regex_findall('^pub.*\\n(?:^fpr[:]*)([0-9A-Fa-f]*)', '\\1') | list }}"
40+
41+
{{% endif %}}
2542

26-
- name: Set Fact - Valid fingerprints
43+
- name: "{{{ rule_title }}}: Set Fact - Valid fingerprints"
2744
ansible.builtin.set_fact:
2845
gpg_valid_fingerprints:
2946
- "{{{ release_key_fingerprint }}}"
3047
- "{{{ auxiliary_key_fingerprint }}}"
48+
{{% if "rhel" in families and major_version_ordinal >= 10 %}}
49+
- "{{{ pqc_key_fingerprint }}}"
50+
{{% endif %}}
3151

32-
- name: Import RedHat GPG key
52+
- name: "{{{ rule_title }}}: Import RedHat GPG key"
3353
ansible.builtin.rpm_key:
3454
state: present
3555
key: /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

0 commit comments

Comments
 (0)