Blame SOURCES/fips.patch

575137
From 17844ccdf81a07244881949b7269adaef0328d16 Mon Sep 17 00:00:00 2001
575137
From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= <jcerny@redhat.com>
575137
Date: Mon, 26 Nov 2018 14:17:10 +0100
575137
Subject: [PATCH 1/7] New rule to enable FIPS mode on RHEL8 and Fedora
575137
575137
On RHEL8, a different method is used to enable FIPS mode than on
575137
RHEL6/7.  Package `dracut-fips` doesn't exist anymore, GRUB config file
575137
doesn't need to be edited. Instead, a new utility `fips-mode-setup`
575137
should be used to setup and configure FIPS mode. To verify that FIPS
575137
mode is enabled, the following 2 conditions have to be fulfilled:
575137
  1. /etc/system-fips exists
575137
  2. /proc/sys/crypto/fips_enabled is set to 1
575137
We can also check if the Dracut FIPS module is configured to be loaded.
575137
In FIPS mode, the system-wide crypto policy is configured to to FIPS.
575137
The same facts apply also for Fedora 29.
575137
This commit adds a new rule `enable_fips_mode` for RHEL8 and Fedora,
575137
which replaces the old rule `grub2_enable_fips_mode` in RHEL8 and Fedora
575137
OSPP profiles. The platform in `grub2_enable_fips_mode` and dependent
575137
rule `package_dracut-fips_installed` in changed to exclude RHEL8 and
575137
Fedora. Currently it fails on both RHEL8 and Fedora because it depends
575137
on rule `installed_OS_is_certified` which allows only RHEL6 and RHEL7.
575137
---
575137
 fedora/profiles/ospp.profile                  |  3 +-
575137
 .../enable_dracut_fips_module/oval/shared.xml | 32 +++++++++++++++
575137
 .../fips/enable_dracut_fips_module/rule.yml   | 26 +++++++++++++
575137
 .../fips/enable_fips_mode/bash/shared.sh      |  3 ++
575137
 .../fips/enable_fips_mode/oval/shared.xml     | 19 +++++++++
575137
 .../integrity/fips/enable_fips_mode/rule.yml  | 39 +++++++++++++++++++
575137
 .../etc_system_fips_exists/oval/shared.xml    | 23 +++++++++++
575137
 .../fips/etc_system_fips_exists/rule.yml      | 28 +++++++++++++
575137
 .../anaconda/shared.anaconda                  |  2 +-
575137
 .../grub2_enable_fips_mode/bash/shared.sh     |  2 +-
575137
 .../grub2_enable_fips_mode/oval/shared.xml    |  2 -
575137
 .../fips/grub2_enable_fips_mode/rule.yml      |  2 +-
575137
 .../anaconda/shared.anaconda                  |  2 +-
575137
 .../ansible/shared.yml                        |  2 +-
575137
 .../bash/shared.sh                            |  2 +-
575137
 .../oval/shared.xml                           |  4 +-
575137
 .../package_dracut-fips_installed/rule.yml    |  2 +-
575137
 .../oval/shared.xml                           | 28 +++++++++++++
575137
 .../fips/sysctl_crypto_fips_enabled/rule.yml  | 30 ++++++++++++++
575137
 rhel8/profiles/ospp.profile                   |  2 +-
575137
 20 files changed, 240 insertions(+), 13 deletions(-)
575137
 create mode 100644 linux_os/guide/system/software/integrity/fips/enable_dracut_fips_module/oval/shared.xml
575137
 create mode 100644 linux_os/guide/system/software/integrity/fips/enable_dracut_fips_module/rule.yml
575137
 create mode 100644 linux_os/guide/system/software/integrity/fips/enable_fips_mode/bash/shared.sh
575137
 create mode 100644 linux_os/guide/system/software/integrity/fips/enable_fips_mode/oval/shared.xml
575137
 create mode 100644 linux_os/guide/system/software/integrity/fips/enable_fips_mode/rule.yml
575137
 create mode 100644 linux_os/guide/system/software/integrity/fips/etc_system_fips_exists/oval/shared.xml
575137
 create mode 100644 linux_os/guide/system/software/integrity/fips/etc_system_fips_exists/rule.yml
575137
 create mode 100644 linux_os/guide/system/software/integrity/fips/sysctl_crypto_fips_enabled/oval/shared.xml
575137
 create mode 100644 linux_os/guide/system/software/integrity/fips/sysctl_crypto_fips_enabled/rule.yml
575137
575137
diff --git a/fedora/profiles/ospp.profile b/fedora/profiles/ospp.profile
575137
index c115ab6bce..0eb3b8ec63 100644
575137
--- a/fedora/profiles/ospp.profile
575137
+++ b/fedora/profiles/ospp.profile
575137
@@ -17,7 +17,8 @@ selections:
575137
     - grub2_audit_argument
575137
     - grub2_audit_backlog_limit_argument
575137
     - service_auditd_enabled
575137
-    - grub2_enable_fips_mode
575137
+    - enable_fips_mode
575137
+    - var_system_crypto_policy=fips
575137
     - rpm_verify_hashes
575137
     - selinux_all_devicefiles_labeled
575137
     - selinux_confinement_of_daemons
575137
diff --git a/linux_os/guide/system/software/integrity/fips/enable_dracut_fips_module/oval/shared.xml b/linux_os/guide/system/software/integrity/fips/enable_dracut_fips_module/oval/shared.xml
575137
new file mode 100644
575137
index 0000000000..03ff256da2
575137
--- /dev/null
575137
+++ b/linux_os/guide/system/software/integrity/fips/enable_dracut_fips_module/oval/shared.xml
575137
@@ -0,0 +1,32 @@
575137
+<def-group>
575137
+  <definition class="compliance" id="enable_dracut_fips_module" version="1">
575137
+    <metadata>
575137
+      <title>Enable Dracut FIPS Module</title>
575137
+      <affected family="unix">
575137
+        <platform>Red Hat Enterprise Linux 8</platform>
575137
+        <platform>multi_platform_fedora</platform>
575137
+      </affected>
575137
+      <description>fips module should be enabled in Dracut configuration</description>
575137
+    </metadata>
575137
+    <criteria operator="AND">
575137
+      <criterion comment="dracut fips module is enabled" test_ref="test_enable_dracut_fips_module" />
575137
+    </criteria>
575137
+  </definition>
575137
+
575137
+  
575137
+  comment="add_dracutmodules contains fips" id="test_enable_dracut_fips_module" version="1">
575137
+    <ind:object object_ref="object_enable_dracut_fips_module" />
575137
+    <ind:state state_ref="state_enable_dracut_fips_module" />
575137
+  </ind:textfilecontent54_test>
575137
+
575137
+  <ind:textfilecontent54_object id="object_enable_dracut_fips_module" version="1">
575137
+    <ind:filepath>/etc/dracut.conf.d/40-fips.conf</ind:filepath>
575137
+    <ind:pattern operation="pattern match">^\s*add_dracutmodules\+="\s*(\w*)\s*"\s*(?:|(?:#.*))?$</ind:pattern>
575137
+    <ind:instance datatype="int">1</ind:instance>
575137
+  </ind:textfilecontent54_object>
575137
+
575137
+  <ind:textfilecontent54_state id="state_enable_dracut_fips_module" version="1">
575137
+    <ind:subexpression datatype="string" operation="equals">fips</ind:subexpression>
575137
+  </ind:textfilecontent54_state>
575137
+
575137
+</def-group>
575137
diff --git a/linux_os/guide/system/software/integrity/fips/enable_dracut_fips_module/rule.yml b/linux_os/guide/system/software/integrity/fips/enable_dracut_fips_module/rule.yml
575137
new file mode 100644
575137
index 0000000000..3de551d2ca
575137
--- /dev/null
575137
+++ b/linux_os/guide/system/software/integrity/fips/enable_dracut_fips_module/rule.yml
575137
@@ -0,0 +1,26 @@
575137
+documentation_complete: true
575137
+
575137
+prodtype: rhel8,fedora
575137
+
575137
+title: "Enable Dracut FIPS Module"
575137
+
575137
+description: |-
575137
+    To enable FIPS, the system requires that the <tt>fips</tt> module is added in
575137
+    <tt>dracut</tt> configuration.
575137
+    Check if <tt>/etc/dracut.conf.d/40-fips.conf</tt> contain <tt>add_dracutmodules+=" fips "</tt>
575137
+
575137
+rationale: |-
575137
+    Use of weak or untested encryption algorithms undermines the purposes of utilizing encryption to
575137
+    protect data. The operating system must implement cryptographic modules adhering to the higher
575137
+    standards approved by the federal government since this provides assurance they have been tested
575137
+    and validated.
575137
+
575137
+severity: medium
575137
+
575137
+ocil_clause: 'the Dracut FIPS module is not enabled'
575137
+
575137
+ocil: |-
575137
+    To verify that the Dracut FIPS module is enabled, run the following command:
575137
+    <tt>grep "add_dracutmodules" /etc/dracut.conf.d/40-fips.conf</tt>
575137
+    The output should look like this:
575137
+    <tt>add_dracutmodules+=" fips "</tt>
575137
diff --git a/linux_os/guide/system/software/integrity/fips/enable_fips_mode/bash/shared.sh b/linux_os/guide/system/software/integrity/fips/enable_fips_mode/bash/shared.sh
575137
new file mode 100644
575137
index 0000000000..b2138a5e1e
575137
--- /dev/null
575137
+++ b/linux_os/guide/system/software/integrity/fips/enable_fips_mode/bash/shared.sh
575137
@@ -0,0 +1,3 @@
575137
+# platform = Red Hat Enterprise Linux 8, multi_platform_fedora
575137
+
575137
+fips-mode-setup --enable
575137
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
575137
new file mode 100644
575137
index 0000000000..9e6e9b5608
575137
--- /dev/null
575137
+++ b/linux_os/guide/system/software/integrity/fips/enable_fips_mode/oval/shared.xml
575137
@@ -0,0 +1,19 @@
575137
+<def-group oval_version="5.10">
575137
+  <definition class="compliance" id="enable_fips_mode" version="1">
575137
+    <metadata>
575137
+      <title>Enable FIPS Mode</title>
575137
+      <affected family="unix">
575137
+        <platform>Red Hat Enterprise Linux 8</platform>
575137
+        <platform>multi_platform_fedora</platform>
575137
+      </affected>
575137
+      <description>Check if FIPS mode is enabled on the system</description>
575137
+    </metadata>
575137
+    <criteria operator="AND">
575137
+      <extend_definition comment="check /etc/system-fips exists" definition_ref="etc_system_fips_exists" />
575137
+      <extend_definition comment="check sysctl crypto.fips_enabled = 1" definition_ref="sysctl_crypto_fips_enabled" />
575137
+      <extend_definition comment="Dracut FIPS module is enabled" definition_ref="enable_dracut_fips_module" />
575137
+      <extend_definition comment="system cryptography policy is configured" definition_ref="configure_crypto_policy" />
575137
+      <extend_definition comment="Installed OS is certified" definition_ref="installed_OS_is_certified" />
575137
+    </criteria>
575137
+  </definition>
575137
+</def-group>
575137
diff --git a/linux_os/guide/system/software/integrity/fips/enable_fips_mode/rule.yml b/linux_os/guide/system/software/integrity/fips/enable_fips_mode/rule.yml
575137
new file mode 100644
575137
index 0000000000..b7fda5bee1
575137
--- /dev/null
575137
+++ b/linux_os/guide/system/software/integrity/fips/enable_fips_mode/rule.yml
575137
@@ -0,0 +1,39 @@
575137
+documentation_complete: true
575137
+
575137
+prodtype: rhel8,fedora
575137
+
575137
+title: Enable FIPS Mode
575137
+
575137
+description: |-
575137
+    To enable FIPS mode, run the following command:
575137
+    
fips-mode-setup --enable
575137
+
575137
+rationale: |-
575137
+    Use of weak or untested encryption algorithms undermines the purposes of utilizing encryption to
575137
+    protect data. The operating system must implement cryptographic modules adhering to the higher
575137
+    standards approved by the federal government since this provides assurance they have been tested
575137
+    and validated.
575137
+
575137
+severity: high
575137
+
575137
+ocil_clause: 'FIPS mode is not enabled'
575137
+
575137
+ocil: |-
575137
+    To verify that FIPS is enabled properly, run the following command:
575137
+    
fips-mode-setup --check
575137
+    The output should contain the following:
575137
+    
FIPS mode is enabled.
575137
+
575137
+warnings:
575137
+    - general: |-
575137
+        The system needs to be rebooted for these changes to take effect.
575137
+    - regulatory: |-
575137
+        The ability to enable FIPS does not denote FIPS compliancy or certification.
575137
+        Red Hat, Inc. and Red Hat Enterprise Linux are respectively FIPS certified and compliant. Community
575137
+        projects such as CentOS, Scientific Linux, Fedora, etc. do not necessarily meet FIPS certification and compliancy.
575137
+        Therefore, non-certified vendors and/or projects do not meet this requirement even if technically feasible.
575137
+        

575137
+        See {{{ weblink(link="http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/1401vend.htm") }}}
575137
+        for a list of FIPS certified vendors.
575137
+
575137
+platform: machine
575137
diff --git a/linux_os/guide/system/software/integrity/fips/etc_system_fips_exists/oval/shared.xml b/linux_os/guide/system/software/integrity/fips/etc_system_fips_exists/oval/shared.xml
575137
new file mode 100644
575137
index 0000000000..8e0360543d
575137
--- /dev/null
575137
+++ b/linux_os/guide/system/software/integrity/fips/etc_system_fips_exists/oval/shared.xml
575137
@@ -0,0 +1,23 @@
575137
+<def-group oval_version="5.10">
575137
+  <definition class="compliance" id="etc_system_fips_exists" version="1">
575137
+    <metadata>
575137
+      <title>Check /etc/system-fips exists</title>
575137
+      <affected family="unix">
575137
+        <platform>Red Hat Enterprise Linux 8</platform>
575137
+        <platform>multi_platform_fedora</platform>
575137
+      </affected>
575137
+      <description>Check /etc/system-fips exists</description>
575137
+    </metadata>
575137
+    <criteria operator="AND">
575137
+      <criterion test_ref="test_etc_system_fips" comment="/etc/system-fips exists" />
575137
+    </criteria>
575137
+  </definition>
575137
+
575137
+  <unix:file_test version="1" id="test_etc_system_fips" check="all" check_existence="all_exist" comment="/etc/system-fips exists">
575137
+      <unix:object object_ref="object_etc_system_fips" />
575137
+  </unix:file_test>
575137
+
575137
+  <unix:file_object version="1" id="object_etc_system_fips">
575137
+      <unix:filepath>/etc/system-fips</unix:filepath>
575137
+  </unix:file_object>
575137
+</def-group>
575137
diff --git a/linux_os/guide/system/software/integrity/fips/etc_system_fips_exists/rule.yml b/linux_os/guide/system/software/integrity/fips/etc_system_fips_exists/rule.yml
575137
new file mode 100644
575137
index 0000000000..0f48cbf274
575137
--- /dev/null
575137
+++ b/linux_os/guide/system/software/integrity/fips/etc_system_fips_exists/rule.yml
575137
@@ -0,0 +1,28 @@
575137
+documentation_complete: true
575137
+
575137
+prodtype: rhel8,fedora
575137
+
575137
+title: Ensure '/etc/system-fips' exists
575137
+
575137
+description: |-
575137
+    On a system where FIPS mode is enabled, <tt>/etc/system-fips</tt> must exist.
575137
+    To enable FIPS mode, run the following command:
575137
+    
fips-mode-setup --enable
575137
+
575137
+rationale: |-
575137
+    Use of weak or untested encryption algorithms undermines the purposes of utilizing encryption to
575137
+    protect data. The operating system must implement cryptographic modules adhering to the higher
575137
+    standards approved by the federal government since this provides assurance they have been tested
575137
+    and validated.
575137
+
575137
+severity: high
575137
+
575137
+ocil_clause: /etc/system-fips does not exist
575137
+
575137
+ocil: |-
575137
+    To verify <tt>/etc/system-fips</tt> exists, run the following command:
575137
+    
ls -l /etc/system-fips
575137
+    The output should be similar to the the following:
575137
+    
-rw-r--r--. 1 root root 36 Nov 26 11:31 /etc/system-fips
575137
+
575137
+platform: machine
575137
diff --git a/linux_os/guide/system/software/integrity/fips/grub2_enable_fips_mode/anaconda/shared.anaconda b/linux_os/guide/system/software/integrity/fips/grub2_enable_fips_mode/anaconda/shared.anaconda
575137
index 089f104181..99693f62d6 100644
575137
--- a/linux_os/guide/system/software/integrity/fips/grub2_enable_fips_mode/anaconda/shared.anaconda
575137
+++ b/linux_os/guide/system/software/integrity/fips/grub2_enable_fips_mode/anaconda/shared.anaconda
575137
@@ -1,3 +1,3 @@
575137
-# platform = Red Hat Enterprise Linux 7,Red Hat Enterprise Linux 8,multi_platform_fedora
575137
+# platform = Red Hat Enterprise Linux 7
575137
 
575137
 package --add=dracut-fips
575137
diff --git a/linux_os/guide/system/software/integrity/fips/grub2_enable_fips_mode/bash/shared.sh b/linux_os/guide/system/software/integrity/fips/grub2_enable_fips_mode/bash/shared.sh
575137
index 097b64080d..b784f9f658 100644
575137
--- a/linux_os/guide/system/software/integrity/fips/grub2_enable_fips_mode/bash/shared.sh
575137
+++ b/linux_os/guide/system/software/integrity/fips/grub2_enable_fips_mode/bash/shared.sh
575137
@@ -1,4 +1,4 @@
575137
-# platform = Red Hat Enterprise Linux 7,Red Hat Enterprise Linux 8,multi_platform_fedora
575137
+# platform = Red Hat Enterprise Linux 7
575137
 
575137
 # include remediation functions library
575137
 . /usr/share/scap-security-guide/remediation_functions
575137
diff --git a/linux_os/guide/system/software/integrity/fips/grub2_enable_fips_mode/oval/shared.xml b/linux_os/guide/system/software/integrity/fips/grub2_enable_fips_mode/oval/shared.xml
575137
index b8f84e32d3..9dee4066d2 100644
575137
--- a/linux_os/guide/system/software/integrity/fips/grub2_enable_fips_mode/oval/shared.xml
575137
+++ b/linux_os/guide/system/software/integrity/fips/grub2_enable_fips_mode/oval/shared.xml
575137
@@ -4,8 +4,6 @@
575137
       <title>Enable FIPS Mode in GRUB2</title>
575137
       <affected family="unix">
575137
         <platform>Red Hat Enterprise Linux 7</platform>
575137
-        <platform>Red Hat Enterprise Linux 8</platform>
575137
-        <platform>multi_platform_fedora</platform>
575137
       </affected>
575137
       <description>Look for argument fips=1 in the kernel line in /etc/default/grub.</description>
575137
     </metadata>
575137
diff --git a/linux_os/guide/system/software/integrity/fips/grub2_enable_fips_mode/rule.yml b/linux_os/guide/system/software/integrity/fips/grub2_enable_fips_mode/rule.yml
575137
index c8c11f8a5e..82c3dc5f68 100644
575137
--- a/linux_os/guide/system/software/integrity/fips/grub2_enable_fips_mode/rule.yml
575137
+++ b/linux_os/guide/system/software/integrity/fips/grub2_enable_fips_mode/rule.yml
575137
@@ -1,6 +1,6 @@
575137
 documentation_complete: true
575137
 
575137
-prodtype: rhel7,rhel8,fedora
575137
+prodtype: rhel7
575137
 
575137
 title: 'Enable FIPS Mode in GRUB2'
575137
 
575137
diff --git a/linux_os/guide/system/software/integrity/fips/package_dracut-fips_installed/anaconda/shared.anaconda b/linux_os/guide/system/software/integrity/fips/package_dracut-fips_installed/anaconda/shared.anaconda
575137
index 38b5193e8e..e2ad6654f6 100644
575137
--- a/linux_os/guide/system/software/integrity/fips/package_dracut-fips_installed/anaconda/shared.anaconda
575137
+++ b/linux_os/guide/system/software/integrity/fips/package_dracut-fips_installed/anaconda/shared.anaconda
575137
@@ -1,3 +1,3 @@
575137
-# platform = multi_platform_rhel, multi_platform_fedora
575137
+# platform = Red Hat Enterprise Linux 6, Red Hat Enterprise Linux 7
575137
 
575137
 package --add=dracut-fips
575137
diff --git a/linux_os/guide/system/software/integrity/fips/package_dracut-fips_installed/ansible/shared.yml b/linux_os/guide/system/software/integrity/fips/package_dracut-fips_installed/ansible/shared.yml
575137
index a3dadd7af0..13a1f0b372 100644
575137
--- a/linux_os/guide/system/software/integrity/fips/package_dracut-fips_installed/ansible/shared.yml
575137
+++ b/linux_os/guide/system/software/integrity/fips/package_dracut-fips_installed/ansible/shared.yml
575137
@@ -1,4 +1,4 @@
575137
-# platform = multi_platform_rhel, multi_platform_fedora
575137
+# platform = Red Hat Enterprise Linux 6, Red Hat Enterprise Linux 7
575137
 # reboot = false
575137
 # strategy = enable
575137
 # complexity = low
575137
diff --git a/linux_os/guide/system/software/integrity/fips/package_dracut-fips_installed/bash/shared.sh b/linux_os/guide/system/software/integrity/fips/package_dracut-fips_installed/bash/shared.sh
575137
index fd319418d9..36ecb73c25 100644
575137
--- a/linux_os/guide/system/software/integrity/fips/package_dracut-fips_installed/bash/shared.sh
575137
+++ b/linux_os/guide/system/software/integrity/fips/package_dracut-fips_installed/bash/shared.sh
575137
@@ -1,4 +1,4 @@
575137
-# platform = multi_platform_rhel, multi_platform_fedora
575137
+# platform = Red Hat Enterprise Linux 6, Red Hat Enterprise Linux 7
575137
 
575137
 # include remediation functions library
575137
 . /usr/share/scap-security-guide/remediation_functions
575137
diff --git a/linux_os/guide/system/software/integrity/fips/package_dracut-fips_installed/oval/shared.xml b/linux_os/guide/system/software/integrity/fips/package_dracut-fips_installed/oval/shared.xml
575137
index 1483429a6a..4d3de0bc3e 100644
575137
--- a/linux_os/guide/system/software/integrity/fips/package_dracut-fips_installed/oval/shared.xml
575137
+++ b/linux_os/guide/system/software/integrity/fips/package_dracut-fips_installed/oval/shared.xml
575137
@@ -8,8 +8,8 @@
575137
     <metadata>
575137
       <title>Package dracut-fips Installed</title>
575137
       <affected family="unix">
575137
-        <platform>multi_platform_rhel</platform>
575137
-        <platform>multi_platform_fedora</platform>
575137
+        <platform>Red Hat Enterprise Linux 6</platform>
575137
+        <platform>Red Hat Enterprise Linux 7</platform>
575137
       </affected>
575137
       <description>The RPM package dracut-fips should be installed.</description>
575137
     </metadata>
575137
diff --git a/linux_os/guide/system/software/integrity/fips/package_dracut-fips_installed/rule.yml b/linux_os/guide/system/software/integrity/fips/package_dracut-fips_installed/rule.yml
575137
index 5065cca35b..c7cd8552b0 100644
575137
--- a/linux_os/guide/system/software/integrity/fips/package_dracut-fips_installed/rule.yml
575137
+++ b/linux_os/guide/system/software/integrity/fips/package_dracut-fips_installed/rule.yml
575137
@@ -1,6 +1,6 @@
575137
 documentation_complete: true
575137
 
575137
-prodtype: rhel6,rhel7,rhel8,fedora
575137
+prodtype: rhel6,rhel7
575137
 
575137
 title: 'Install the dracut-fips Package'
575137
 
575137
diff --git a/linux_os/guide/system/software/integrity/fips/sysctl_crypto_fips_enabled/oval/shared.xml b/linux_os/guide/system/software/integrity/fips/sysctl_crypto_fips_enabled/oval/shared.xml
575137
new file mode 100644
575137
index 0000000000..1b34965949
575137
--- /dev/null
575137
+++ b/linux_os/guide/system/software/integrity/fips/sysctl_crypto_fips_enabled/oval/shared.xml
575137
@@ -0,0 +1,28 @@
575137
+<def-group>
575137
+  <definition class="compliance" id="sysctl_crypto_fips_enabled" version="1">
575137
+    <metadata>
575137
+      <title>Kernel "crypto.fips_enabled" Parameter Runtime Check</title>
575137
+      <affected family="unix">
575137
+        <platform>multi_platform_fedora</platform>
575137
+        <platform>Red Hat Enterprise Linux 8</platform>
575137
+      </affected>
575137
+      <description>The kernel "crypto.fips_enabled" parameter should be set to "1" in system runtime.</description>
575137
+    </metadata>
575137
+    <criteria operator="AND">
575137
+      <criterion comment="kernel runtime parameter crypto.fips_enabled set to 1" test_ref="test_sysctl_crypto_fips_enabled" />
575137
+    </criteria>
575137
+  </definition>
575137
+
575137
+  <unix:sysctl_test check="all" check_existence="all_exist" comment="kernel runtime parameter crypto.fips_enabled set to 1" id="test_sysctl_crypto_fips_enabled" version="1">
575137
+    <unix:object object_ref="object_sysctl_crypto_fips_enabled" />
575137
+    <unix:state state_ref="state_sysctl_crypto_fips_enabled" />
575137
+  </unix:sysctl_test>
575137
+
575137
+  <unix:sysctl_object id="object_sysctl_crypto_fips_enabled" version="1">
575137
+    <unix:name>crypto.fips_enabled</unix:name>
575137
+  </unix:sysctl_object>
575137
+
575137
+  <unix:sysctl_state id="state_sysctl_crypto_fips_enabled" version="1">
575137
+    <unix:value datatype="int" operation="equals">1</unix:value>
575137
+  </unix:sysctl_state>
575137
+</def-group>
575137
diff --git a/linux_os/guide/system/software/integrity/fips/sysctl_crypto_fips_enabled/rule.yml b/linux_os/guide/system/software/integrity/fips/sysctl_crypto_fips_enabled/rule.yml
575137
new file mode 100644
575137
index 0000000000..a8e9c0d36e
575137
--- /dev/null
575137
+++ b/linux_os/guide/system/software/integrity/fips/sysctl_crypto_fips_enabled/rule.yml
575137
@@ -0,0 +1,30 @@
575137
+documentation_complete: true
575137
+
575137
+prodtype: rhel8,fedora
575137
+
575137
+title: "Set kernel parameter 'crypto.fips_enabled' to 1"
575137
+
575137
+description: |-
575137
+    System running in FIPS mode is indicated by kernel parameter
575137
+    <tt>'crypto.fips_enabled'</tt>. This parameter should be set to <tt>1</tt>
575137
+    in FIPS mode.
575137
+    To enable FIPS mode, run the following command:
575137
+    
fips-mode-setup --enable
575137
+
575137
+rationale: |-
575137
+    Use of weak or untested encryption algorithms undermines the purposes of utilizing encryption to
575137
+    protect data. The operating system must implement cryptographic modules adhering to the higher
575137
+    standards approved by the federal government since this provides assurance they have been tested
575137
+    and validated.
575137
+
575137
+severity: high
575137
+
575137
+ocil_clause: 'crypto.fips_enabled is not 1'
575137
+
575137
+ocil: |-
575137
+    To verify that kernel parameter 'crypto.fips_enabled' is set properly, run the following command:
575137
+    
sysctl crypto.fips_enabled
575137
+    The output should contain the following:
575137
+    
crypto.fips_enabled =  1
575137
+
575137
+platform: machine
575137
diff --git a/rhel8/profiles/ospp.profile b/rhel8/profiles/ospp.profile
575137
index 4c8fe02f17..a78060a355 100644
575137
--- a/rhel8/profiles/ospp.profile
575137
+++ b/rhel8/profiles/ospp.profile
575137
@@ -12,7 +12,7 @@ selections:
575137
     - grub2_audit_argument
575137
     - grub2_audit_backlog_limit_argument
575137
     - service_auditd_enabled
575137
-    - grub2_enable_fips_mode
575137
+    - enable_fips_mode
575137
     - rpm_verify_hashes
575137
     - selinux_all_devicefiles_labeled
575137
     - selinux_confinement_of_daemons
575137
575137
From fc10f00b21ca8303cb1e83189d969991069b9d1e Mon Sep 17 00:00:00 2001
575137
From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= <jcerny@redhat.com>
575137
Date: Wed, 5 Dec 2018 17:41:39 +0100
575137
Subject: [PATCH 2/7] Improve description of rule "Enable FIPS mode"
575137
575137
Describes the process based on `fips-mode-setup` manual page
575137
and describes the facts that are checked by the rule.
575137
---
575137
 .../integrity/fips/enable_fips_mode/rule.yml       | 14 ++++++++++++++
575137
 1 file changed, 14 insertions(+)
575137
575137
diff --git a/linux_os/guide/system/software/integrity/fips/enable_fips_mode/rule.yml b/linux_os/guide/system/software/integrity/fips/enable_fips_mode/rule.yml
575137
index b7fda5bee1..67090ea863 100644
575137
--- a/linux_os/guide/system/software/integrity/fips/enable_fips_mode/rule.yml
575137
+++ b/linux_os/guide/system/software/integrity/fips/enable_fips_mode/rule.yml
575137
@@ -7,6 +7,20 @@ title: Enable FIPS Mode
575137
 description: |-
575137
     To enable FIPS mode, run the following command:
575137
     
fips-mode-setup --enable
575137
+    
575137
+    The <tt>fips-mode-setup</tt> command completes the installation of FIPS
575137
+    modules by calling <tt>fips-finish-install</tt>. Then, it changes the
575137
+    system crypto policy to FIPS by calling <tt>update-crypto-policies</tt>
575137
+    tool. Also, the command modifies the boot loader configuration to add
575137
+    <tt>fips=1</tt> and <tt>boot=<boot-device></tt> options to the kernel
575137
+    command line.
575137
+    
575137
+    On a system running in FIPS mode, the kernel FIPS mode flag
575137
+    (<tt>/proc/sys/crypto/fips_enabled</tt>) should be set to <tt>1</tt> and
575137
+    the <tt>/etc/system-fips</tt> should exist. The system crypto policy should
575137
+    be set to FIPS in <tt>/etc/crypto-policies/config</tt>. Also, the Dracut
575137
+    <tt>fips</tt> module should be loaded. Furthermore, the system running in
575137
+    FIPS mode should be FIPS certified.
575137
 
575137
 rationale: |-
575137
     Use of weak or untested encryption algorithms undermines the purposes of utilizing encryption to
575137
575137
From 420be5900a27772422d14489c0c776754a3621e4 Mon Sep 17 00:00:00 2001
575137
From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= <jcerny@redhat.com>
575137
Date: Tue, 11 Dec 2018 08:55:45 +0100
575137
Subject: [PATCH 3/7] Remove a paragraph from rule description
575137
575137
---
575137
 .../software/integrity/fips/enable_fips_mode/rule.yml      | 7 -------
575137
 1 file changed, 7 deletions(-)
575137
575137
diff --git a/linux_os/guide/system/software/integrity/fips/enable_fips_mode/rule.yml b/linux_os/guide/system/software/integrity/fips/enable_fips_mode/rule.yml
575137
index 67090ea863..7532191961 100644
575137
--- a/linux_os/guide/system/software/integrity/fips/enable_fips_mode/rule.yml
575137
+++ b/linux_os/guide/system/software/integrity/fips/enable_fips_mode/rule.yml
575137
@@ -8,13 +8,6 @@ description: |-
575137
     To enable FIPS mode, run the following command:
575137
     
fips-mode-setup --enable
575137
     
575137
-    The <tt>fips-mode-setup</tt> command completes the installation of FIPS
575137
-    modules by calling <tt>fips-finish-install</tt>. Then, it changes the
575137
-    system crypto policy to FIPS by calling <tt>update-crypto-policies</tt>
575137
-    tool. Also, the command modifies the boot loader configuration to add
575137
-    <tt>fips=1</tt> and <tt>boot=<boot-device></tt> options to the kernel
575137
-    command line.
575137
-    
575137
     On a system running in FIPS mode, the kernel FIPS mode flag
575137
     (<tt>/proc/sys/crypto/fips_enabled</tt>) should be set to <tt>1</tt> and
575137
     the <tt>/etc/system-fips</tt> should exist. The system crypto policy should
575137
575137
From bdf0a27ef924c7cf8bf26dc4a650ae47d51195d4 Mon Sep 17 00:00:00 2001
575137
From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= <jcerny@redhat.com>
575137
Date: Tue, 11 Dec 2018 09:56:23 +0100
575137
Subject: [PATCH 4/7] Check if external variable has the expected value
575137
575137
This commit adds a new criterion to OVAL definition for rule
575137
`enable_fips_mode`. The test checks if `var_system_crypto_policy` is set
575137
to FIPS.  This solves the situation when user tailors his profile and
575137
refines the XCCDF value `var_system_crypto_policy` to a different value
575137
than FIPS. In this situation the rule passes, although the FIPS mode is
575137
not enabled. It is obvious that this tailoring does not make any sense,
575137
but we should be more anticipatory.
575137
---
575137
 .../integrity/fips/enable_fips_mode/oval/shared.xml   | 11 +++++++++++
575137
 1 file changed, 11 insertions(+)
575137
575137
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
575137
index 9e6e9b5608..9324989899 100644
575137
--- a/linux_os/guide/system/software/integrity/fips/enable_fips_mode/oval/shared.xml
575137
+++ b/linux_os/guide/system/software/integrity/fips/enable_fips_mode/oval/shared.xml
575137
@@ -14,6 +14,17 @@
575137
       <extend_definition comment="Dracut FIPS module is enabled" definition_ref="enable_dracut_fips_module" />
575137
       <extend_definition comment="system cryptography policy is configured" definition_ref="configure_crypto_policy" />
575137
       <extend_definition comment="Installed OS is certified" definition_ref="installed_OS_is_certified" />
575137
+      <criterion comment="check if system crypto policy selection in var_system_crypto_policy in the profile is set to FIPS" test_ref="test_system_crypto_policy_value" />
575137
     </criteria>
575137
   </definition>
575137
+  <ind:variable_test check="at least one" comment="tests if var_system_crypto_policy is set to FIPS" id="test_system_crypto_policy_value" version="1">
575137
+    <ind:object object_ref="obj_system_crypto_policy_value" />
575137
+    <ind:state state_ref="ste_system_crypto_policy_value" />
575137
+  </ind:variable_test>
575137
+  <ind:variable_object id="obj_system_crypto_policy_value" version="1">
575137
+    <ind:var_ref>var_system_crypto_policy</ind:var_ref>
575137
+  </ind:variable_object>
575137
+  <ind:variable_state comment="variable value is set to 'FIPS'" id="ste_system_crypto_policy_value" version="1">
575137
+    <ind:value operation="equals" datatype="string">FIPS</ind:value>
575137
+  </ind:variable_state>
575137
 </def-group>
575137
575137
From 92fe3acfc3785c18a696696dd0a1827a399136c5 Mon Sep 17 00:00:00 2001
575137
From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= <jcerny@redhat.com>
575137
Date: Tue, 11 Dec 2018 11:39:52 +0100
575137
Subject: [PATCH 5/7] Add missing external_variable in OVAL
575137
575137
---
575137
 .../software/integrity/fips/enable_fips_mode/oval/shared.xml     | 1 +
575137
 1 file changed, 1 insertion(+)
575137
575137
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
575137
index 9324989899..2c1e52c831 100644
575137
--- a/linux_os/guide/system/software/integrity/fips/enable_fips_mode/oval/shared.xml
575137
+++ b/linux_os/guide/system/software/integrity/fips/enable_fips_mode/oval/shared.xml
575137
@@ -27,4 +27,5 @@
575137
   <ind:variable_state comment="variable value is set to 'FIPS'" id="ste_system_crypto_policy_value" version="1">
575137
     <ind:value operation="equals" datatype="string">FIPS</ind:value>
575137
   </ind:variable_state>
575137
+  <external_variable comment="defined crypto policy" datatype="string" id="var_system_crypto_policy" version="1" />
575137
 </def-group>
575137
575137
From e59104a23b01bbf5f2bc141e5480e594eb2a30ae Mon Sep 17 00:00:00 2001
575137
From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= <jcerny@redhat.com>
575137
Date: Wed, 12 Dec 2018 09:04:25 +0100
575137
Subject: [PATCH 6/7] Add warnings to other FIPS-related rules
575137
575137
---
575137
 .../fips/enable_dracut_fips_module/rule.yml        | 14 ++++++++++++++
575137
 .../integrity/fips/etc_system_fips_exists/rule.yml | 12 ++++++++++++
575137
 .../fips/sysctl_crypto_fips_enabled/rule.yml       | 12 ++++++++++++
575137
 3 files changed, 38 insertions(+)
575137
575137
diff --git a/linux_os/guide/system/software/integrity/fips/enable_dracut_fips_module/rule.yml b/linux_os/guide/system/software/integrity/fips/enable_dracut_fips_module/rule.yml
575137
index 3de551d2ca..b23d2e8c46 100644
575137
--- a/linux_os/guide/system/software/integrity/fips/enable_dracut_fips_module/rule.yml
575137
+++ b/linux_os/guide/system/software/integrity/fips/enable_dracut_fips_module/rule.yml
575137
@@ -5,6 +5,8 @@ prodtype: rhel8,fedora
575137
 title: "Enable Dracut FIPS Module"
575137
 
575137
 description: |-
575137
+    To enable FIPS mode, run the following command:
575137
+    
fips-mode-setup --enable
575137
     To enable FIPS, the system requires that the <tt>fips</tt> module is added in
575137
     <tt>dracut</tt> configuration.
575137
     Check if <tt>/etc/dracut.conf.d/40-fips.conf</tt> contain <tt>add_dracutmodules+=" fips "</tt>
575137
@@ -24,3 +26,15 @@ ocil: |-
575137
     <tt>grep "add_dracutmodules" /etc/dracut.conf.d/40-fips.conf</tt>
575137
     The output should look like this:
575137
     <tt>add_dracutmodules+=" fips "</tt>
575137
+
575137
+warnings:
575137
+    - general: |-
575137
+        The system needs to be rebooted for these changes to take effect.
575137
+    - regulatory: |-
575137
+        The ability to enable FIPS does not denote FIPS compliancy or certification.
575137
+        Red Hat, Inc. and Red Hat Enterprise Linux are respectively FIPS certified and compliant. Community
575137
+        projects such as CentOS, Scientific Linux, Fedora, etc. do not necessarily meet FIPS certification and compliancy.
575137
+        Therefore, non-certified vendors and/or projects do not meet this requirement even if technically feasible.
575137
+        

575137
+        See {{{ weblink(link="http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/1401vend.htm") }}}
575137
+        for a list of FIPS certified vendors.
575137
diff --git a/linux_os/guide/system/software/integrity/fips/etc_system_fips_exists/rule.yml b/linux_os/guide/system/software/integrity/fips/etc_system_fips_exists/rule.yml
575137
index 0f48cbf274..0f1b398a0e 100644
575137
--- a/linux_os/guide/system/software/integrity/fips/etc_system_fips_exists/rule.yml
575137
+++ b/linux_os/guide/system/software/integrity/fips/etc_system_fips_exists/rule.yml
575137
@@ -25,4 +25,16 @@ ocil: |-
575137
     The output should be similar to the the following:
575137
     
-rw-r--r--. 1 root root 36 Nov 26 11:31 /etc/system-fips
575137
 
575137
+warnings:
575137
+    - general: |-
575137
+        The system needs to be rebooted for these changes to take effect.
575137
+    - regulatory: |-
575137
+        The ability to enable FIPS does not denote FIPS compliancy or certification.
575137
+        Red Hat, Inc. and Red Hat Enterprise Linux are respectively FIPS certified and compliant. Community
575137
+        projects such as CentOS, Scientific Linux, Fedora, etc. do not necessarily meet FIPS certification and compliancy.
575137
+        Therefore, non-certified vendors and/or projects do not meet this requirement even if technically feasible.
575137
+        

575137
+        See {{{ weblink(link="http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/1401vend.htm") }}}
575137
+        for a list of FIPS certified vendors.
575137
+
575137
 platform: machine
575137
diff --git a/linux_os/guide/system/software/integrity/fips/sysctl_crypto_fips_enabled/rule.yml b/linux_os/guide/system/software/integrity/fips/sysctl_crypto_fips_enabled/rule.yml
575137
index a8e9c0d36e..734fa558a7 100644
575137
--- a/linux_os/guide/system/software/integrity/fips/sysctl_crypto_fips_enabled/rule.yml
575137
+++ b/linux_os/guide/system/software/integrity/fips/sysctl_crypto_fips_enabled/rule.yml
575137
@@ -27,4 +27,16 @@ ocil: |-
575137
     The output should contain the following:
575137
     
crypto.fips_enabled =  1
575137
 
575137
+warnings:
575137
+    - general: |-
575137
+        The system needs to be rebooted for these changes to take effect.
575137
+    - regulatory: |-
575137
+        The ability to enable FIPS does not denote FIPS compliancy or certification.
575137
+        Red Hat, Inc. and Red Hat Enterprise Linux are respectively FIPS certified and compliant. Community
575137
+        projects such as CentOS, Scientific Linux, Fedora, etc. do not necessarily meet FIPS certification and compliancy.
575137
+        Therefore, non-certified vendors and/or projects do not meet this requirement even if technically feasible.
575137
+        

575137
+        See {{{ weblink(link="http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/1401vend.htm") }}}
575137
+        for a list of FIPS certified vendors.
575137
+
575137
 platform: machine
575137
575137
From 4c3c890a63a6061d380c5171f32f048165af0ee8 Mon Sep 17 00:00:00 2001
575137
From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= <jcerny@redhat.com>
575137
Date: Thu, 13 Dec 2018 17:33:39 +0100
575137
Subject: [PATCH 7/7] Improve wording in rule description enable_fips_mode
575137
575137
---
575137
 .../integrity/fips/enable_fips_mode/rule.yml      | 15 +++++++++------
575137
 1 file changed, 9 insertions(+), 6 deletions(-)
575137
575137
diff --git a/linux_os/guide/system/software/integrity/fips/enable_fips_mode/rule.yml b/linux_os/guide/system/software/integrity/fips/enable_fips_mode/rule.yml
575137
index 7532191961..72db413dff 100644
575137
--- a/linux_os/guide/system/software/integrity/fips/enable_fips_mode/rule.yml
575137
+++ b/linux_os/guide/system/software/integrity/fips/enable_fips_mode/rule.yml
575137
@@ -8,12 +8,15 @@ description: |-
575137
     To enable FIPS mode, run the following command:
575137
     
fips-mode-setup --enable
575137
     
575137
-    On a system running in FIPS mode, the kernel FIPS mode flag
575137
-    (<tt>/proc/sys/crypto/fips_enabled</tt>) should be set to <tt>1</tt> and
575137
-    the <tt>/etc/system-fips</tt> should exist. The system crypto policy should
575137
-    be set to FIPS in <tt>/etc/crypto-policies/config</tt>. Also, the Dracut
575137
-    <tt>fips</tt> module should be loaded. Furthermore, the system running in
575137
-    FIPS mode should be FIPS certified.
575137
+    The <tt>fips-mode-setup</tt> command will configure the system in
575137
+    FIPS mode by automatically configuring the following:
575137
+    
    575137
    +    
  • Setting the kernel FIPS mode flag (<tt>/proc/sys/crypto/fips_enabled</tt>) to <tt>1</tt>
  • 575137
    +    
  • Creating <tt>/etc/system-fips</tt>
  • 575137
    +    
  • Setting the system crypto policy in <tt>/etc/crypto-policies/config</tt> to <tt>FIPS</tt>
  • 575137
    +    
  • Loading the Dracut <tt>fips</tt> module
  • 575137
    +    
    575137
    +    Furthermore, the system running in FIPS mode should be FIPS certified by NIST.
    575137
     
    575137
     rationale: |-
    575137
         Use of weak or untested encryption algorithms undermines the purposes of utilizing encryption to