Add AlmaLinux support

This commit is contained in:
Andrew Lukoshko 2026-06-09 16:22:42 +00:00 committed by root
parent 89cc37dfc0
commit 1e3fa082fd
2 changed files with 16 additions and 2 deletions

View File

@ -36,9 +36,20 @@ find ./shared -type f -exec sed -i \
-e 's|<platform>multi_platform_rhel</platform>|<platform>multi_platform_rhel</platform>\n<platform>multi_platform_almalinux</platform>|g' {} \;
# 5. Improve Ansible support in conditionals
# Two product-gating idioms are used in the shared rule templates:
# - list membership: {% if product in [..., "rhel8"] %}
# - equality: {% if product == "rhel8" %}
# The list form is rewritten below. The equality form is NOT a substring of
# the list form, so it must be handled separately, otherwise almalinux8
# silently falls through to the generic `else` branch of those rules (e.g.
# configure_custom_crypto_policy_cis drops NO-SSHWEAKCIPHERS/NO-SSHWEAKMACS/
# NO-WEAKMAC, weakening the CIS crypto remediation versus the rhel8 base).
find ./linux_os -type d -name ensure_redhat_gpgkey_installed -prune -o -type f -exec sed -i \
-e '/if product in/ s/"rhel8"/"rhel8", "almalinux8"/g' {} \;
find ./linux_os ./shared -type d -name ensure_redhat_gpgkey_installed -prune -o -type f -exec sed -i -E \
-e 's/product == (["'\''])rhel8\1/(product == \1rhel8\1 or product == \1almalinux8\1)/g' {} \;
# 6. Add disa references symlinks for AlmaLinux
for xml in $(find shared/references/ -type f -name 'disa-stig-rhel*.xml'); do
target="$(echo "$xml" | sed 's/rhel/almalinux/g')"
@ -112,6 +123,9 @@ sed -i '/^ - almalinux8\.[0-9]/,/^$/d' products/almalinux8/product.yml
sed -i 's/rhel/almalinux/g' products/almalinux8/CMakeLists.txt
sed -i '/In addition to being applicable/,/- Red Hat Containers with a Red Hat Enterprise Linux 8 image/{/- Red Hat Containers/{N;d};d}' \
products/almalinux8/profiles/stig*.profile
sed -i -z \
-e 's/Red Hat Enterprise Linux/AlmaLinux OS/g' \
-e 's/red_hat_linux/almalinuxos_linux/g' \

View File

@ -6,7 +6,7 @@
Name: scap-security-guide
Version: 0.1.80
Release: 1%{?dist}.alma.1
Release: 1%{?dist}.alma.2
Summary: Security guidance and baselines in SCAP formats
License: BSD-3-Clause
Group: Applications/System
@ -139,7 +139,7 @@ ln -s ssg-firefox-ds.xml %{buildroot}%{_datadir}/xml/scap/ssg/content/ssg-firefo
%{_datadir}/%{name}/ansible/rule_playbooks
%changelog
* Tue Mar 31 2026 Andrew Lukoshko <alukoshko@almalinux.org> - 0.1.80-1.alma.1
* Tue Jun 09 2026 Andrew Lukoshko <alukoshko@almalinux.org> - 0.1.80-1.alma.2
- Add AlmaLinux support
* Tue Mar 10 2026 Vojtech Polasek <vpolasek@redhat.com> - 0.1.80-1