Compare commits

...

2 Commits
a8 ... a8

Author SHA1 Message Date
2243f22718 Merge pull request 'Extend product-in sed to cover shared/, not-in, and single quotes' (#3) from swoutersup/scap-security-guide:fix/product-in-sed-coverage-a8 into a8
Reviewed-on: autopatch/scap-security-guide#3
2026-07-16 13:31:40 +00:00
Sam Wouters
1f25b89619 Extend product-in sed to cover shared/, not-in, and single quotes
Same gap as a9/a10: the sed only searched linux_os/ and only matched
double-quoted product names in 'if product in' blocks, missing rules
in shared/, exclusion lists using 'if product not in', and
single-quoted product names in either form.

Extend the find path to linux_os/ and shared/, and add the three
missing -e expressions to cover all four combinations.
2026-07-15 18:19:41 +02:00

View File

@ -44,8 +44,11 @@ find ./shared -type f -exec sed -i \
# 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 '/if product in/ s/"rhel8"/"rhel8", "almalinux8"/g' \
-e "/if product in/ s/'rhel8'/'rhel8', 'almalinux8'/g" \
-e '/if product not in/ s/"rhel8"/"rhel8", "almalinux8"/g' \
-e "/if product not 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' {} \;