From 9d00e0d296ad4a5ce503b2dfe9647de6806b7b60 Mon Sep 17 00:00:00 2001 From: Marcus Burghardt Date: Thu, 27 Jul 2023 10:02:08 +0200 Subject: [PATCH 1/2] Align the parameters ordering in OVAL objects This commit only improves readability without any technical impact in the OVAL logic. --- .../fips/enable_fips_mode/oval/shared.xml | 81 ++++++++++++------- 1 file changed, 50 insertions(+), 31 deletions(-) diff --git a/linux_os/guide/system/software/integrity/fips/enable_fips_mode/oval/shared.xml b/linux_os/guide/system/software/integrity/fips/enable_fips_mode/oval/shared.xml index fe3f96f52a5..0ec076a5fb7 100644 --- a/linux_os/guide/system/software/integrity/fips/enable_fips_mode/oval/shared.xml +++ b/linux_os/guide/system/software/integrity/fips/enable_fips_mode/oval/shared.xml @@ -1,32 +1,38 @@ - + {{{ oval_metadata("Check if FIPS mode is enabled on the system") }}} - - - - - - + + + + + + {{% if "ol" in product or "rhel" in product %}} - - + + - + {{% if product in ["ol8", "rhel8"] %}} - + {{% else %}} - + {{% endif %}} @@ -34,58 +40,71 @@ - + + ^/boot/loader/entries/.*.conf ^options (.*)$ 1 + ^(?:.*\s)?fips=1(?:\s.*)?$ - + + + ^/etc/kernel/cmdline ^(.*)$ 1 - + + var_system_crypto_policy - + + {{% if product in ["ol9","rhel9"] -%}} ^FIPS(:OSPP)?$ {{%- else %}} - {{# Legacy and more relaxed list of crypto policies that were historically considered FIPS-compatible. More recent products should use the more restricted list of options #}} + {{# Legacy and more relaxed list of crypto policies that were historically considered + FIPS-compatible. More recent products should use the more restricted list of options #}} ^FIPS(:(OSPP|NO-SHA1|NO-CAMELLIA))?$ {{%- endif %}} + {{% if product in ["ol8","rhel8"] %}} - + - + + /boot/grub2/grubenv fips=1 1 {{% endif %}} - + + From 6a62a2f1b61e51326c7cadd2a0494200d98cc02e Mon Sep 17 00:00:00 2001 From: Marcus Burghardt Date: Thu, 27 Jul 2023 10:20:33 +0200 Subject: [PATCH 2/2] Improve OVAL comments for better readability Simplified the comments and aligned the respective lines to the project Style Guides. --- .../fips/enable_fips_mode/oval/shared.xml | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/linux_os/guide/system/software/integrity/fips/enable_fips_mode/oval/shared.xml b/linux_os/guide/system/software/integrity/fips/enable_fips_mode/oval/shared.xml index 0ec076a5fb7..88aae7aaab9 100644 --- a/linux_os/guide/system/software/integrity/fips/enable_fips_mode/oval/shared.xml +++ b/linux_os/guide/system/software/integrity/fips/enable_fips_mode/oval/shared.xml @@ -3,36 +3,36 @@ {{{ oval_metadata("Check if FIPS mode is enabled on the system") }}} + comment="check /etc/system-fips file existence"/> + comment="check option crypto.fips_enabled = 1 in sysctl"/> + comment="dracut FIPS module is enabled"/> + comment="check if var_system_crypto_policy variable selection is set to FIPS"/> + comment="check if kernel option fips=1 is present in /etc/kernel/cmdline"/> {{% if "ol" in product or "rhel" in product %}} + comment="generic test for s390x architecture"/> + comment="check if kernel option fips=1 is present in /boot/loader/entries/.*.conf"/> + comment="generic test for non-s390x architecture"/> {{% if product in ["ol8", "rhel8"] %}} {{% else %}} + comment="check if kernel option fips=1 is present in /boot/loader/entries/.*.conf"/> {{% endif %}} @@ -42,7 +42,7 @@ + comment="check if kernel option fips=1 is present in options in /boot/loader/entries/.*.conf"> @@ -59,7 +59,7 @@ + comment="check if kernel option fips=1 is present in /etc/kernel/cmdline"> @@ -71,7 +71,7 @@ + check="at least one" comment="test if var_system_crypto_policy selection is set to FIPS"> @@ -81,7 +81,8 @@ + comment="variable value is set to 'FIPS' or 'FIPS:modifier', where the modifier corresponds +to a crypto policy module that further restricts the modified crypto policy."> {{% if product in ["ol9","rhel9"] -%}} ^FIPS(:OSPP)?$ {{%- else %}} @@ -94,7 +95,7 @@ {{% if product in ["ol8","rhel8"] %}} + comment="FIPS mode is selected in running kernel options"> @@ -106,5 +107,5 @@ {{% endif %}} + datatype="string" comment="variable which selects the crypto policy"/>