Blame SOURCES/scap-security-guide-0.1.51-openssl_crypto_PR_5885.patch

ac2e16
From bf4da502abb91d3db88e76f7239880909f400604 Mon Sep 17 00:00:00 2001
ac2e16
From: Vojtech Polasek <vpolasek@redhat.com>
ac2e16
Date: Thu, 25 Jun 2020 09:53:38 +0200
ac2e16
Subject: [PATCH 1/3] fixed description, oval, ansible, bash
ac2e16
ac2e16
---
ac2e16
 .../configure_openssl_crypto_policy/ansible/shared.yml |  4 ++--
ac2e16
 .../configure_openssl_crypto_policy/bash/shared.sh     |  4 ++--
ac2e16
 .../configure_openssl_crypto_policy/oval/shared.xml    |  2 +-
ac2e16
 .../crypto/configure_openssl_crypto_policy/rule.yml    | 10 +++++-----
ac2e16
 4 files changed, 10 insertions(+), 10 deletions(-)
ac2e16
ac2e16
diff --git a/linux_os/guide/system/software/integrity/crypto/configure_openssl_crypto_policy/ansible/shared.yml b/linux_os/guide/system/software/integrity/crypto/configure_openssl_crypto_policy/ansible/shared.yml
ac2e16
index e6318f221c..98fe134aca 100644
ac2e16
--- a/linux_os/guide/system/software/integrity/crypto/configure_openssl_crypto_policy/ansible/shared.yml
ac2e16
+++ b/linux_os/guide/system/software/integrity/crypto/configure_openssl_crypto_policy/ansible/shared.yml
ac2e16
@@ -15,7 +15,7 @@
ac2e16
   lineinfile:
ac2e16
     create: yes
ac2e16
     insertafter: '^\s*\[\s*crypto_policy\s*]\s*'
ac2e16
-    line: ".include /etc/crypto-policies/back-ends/openssl.config"
ac2e16
+    line: ".include /etc/crypto-policies/back-ends/opensslcnf.config"
ac2e16
     path: /etc/pki/tls/openssl.cnf
ac2e16
   when:
ac2e16
     - test_crypto_policy_group.stdout is defined
ac2e16
@@ -24,7 +24,7 @@
ac2e16
 - name: "Add crypto_policy group and set include openssl.config"
ac2e16
   lineinfile:
ac2e16
     create: yes
ac2e16
-    line: "[crypto_policy]\n.include /etc/crypto-policies/back-ends/openssl.config"
ac2e16
+    line: "[crypto_policy]\n.include /etc/crypto-policies/back-ends/opensslcnf.config"
ac2e16
     path: /etc/pki/tls/openssl.cnf
ac2e16
   when:
ac2e16
     - test_crypto_policy_group.stdout is defined
ac2e16
diff --git a/linux_os/guide/system/software/integrity/crypto/configure_openssl_crypto_policy/bash/shared.sh b/linux_os/guide/system/software/integrity/crypto/configure_openssl_crypto_policy/bash/shared.sh
ac2e16
index 0b3cbf3b46..a0b30cce96 100644
ac2e16
--- a/linux_os/guide/system/software/integrity/crypto/configure_openssl_crypto_policy/bash/shared.sh
ac2e16
+++ b/linux_os/guide/system/software/integrity/crypto/configure_openssl_crypto_policy/bash/shared.sh
ac2e16
@@ -2,8 +2,8 @@
ac2e16
 
ac2e16
 OPENSSL_CRYPTO_POLICY_SECTION='[ crypto_policy ]'
ac2e16
 OPENSSL_CRYPTO_POLICY_SECTION_REGEX='\[\s*crypto_policy\s*\]'
ac2e16
-OPENSSL_CRYPTO_POLICY_INCLUSION='.include /etc/crypto-policies/back-ends/openssl.config'
ac2e16
-OPENSSL_CRYPTO_POLICY_INCLUSION_REGEX='^\s*\.include\s*/etc/crypto-policies/back-ends/openssl.config$'
ac2e16
+OPENSSL_CRYPTO_POLICY_INCLUSION='.include /etc/crypto-policies/back-ends/opensslcnf.config'
ac2e16
+OPENSSL_CRYPTO_POLICY_INCLUSION_REGEX='^\s*\.include\s*/etc/crypto-policies/back-ends/opensslcnf.config$'
ac2e16
 
ac2e16
 function remediate_openssl_crypto_policy() {
ac2e16
 	CONFIG_FILE="/etc/pki/tls/openssl.cnf"
ac2e16
diff --git a/linux_os/guide/system/software/integrity/crypto/configure_openssl_crypto_policy/oval/shared.xml b/linux_os/guide/system/software/integrity/crypto/configure_openssl_crypto_policy/oval/shared.xml
ac2e16
index a9b3f7b6e9..2019769736 100644
ac2e16
--- a/linux_os/guide/system/software/integrity/crypto/configure_openssl_crypto_policy/oval/shared.xml
ac2e16
+++ b/linux_os/guide/system/software/integrity/crypto/configure_openssl_crypto_policy/oval/shared.xml
ac2e16
@@ -20,7 +20,7 @@
ac2e16
   
ac2e16
   version="1">
ac2e16
     <ind:filepath>/etc/pki/tls/openssl.cnf</ind:filepath>
ac2e16
-    <ind:pattern operation="pattern match">^\s*\[\s*crypto_policy\s*\]\s*\n*\s*\.include\s*/etc/crypto-policies/back-ends/openssl.config\s*$</ind:pattern>
ac2e16
+    <ind:pattern operation="pattern match">^\s*\[\s*crypto_policy\s*\]\s*\n*\s*\.include\s*/etc/crypto-policies/back-ends/opensslcnf.config\s*$</ind:pattern>
ac2e16
     <ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
ac2e16
   </ind:textfilecontent54_object>
ac2e16
 </def-group>
ac2e16
diff --git a/linux_os/guide/system/software/integrity/crypto/configure_openssl_crypto_policy/rule.yml b/linux_os/guide/system/software/integrity/crypto/configure_openssl_crypto_policy/rule.yml
ac2e16
index 8c015bb3b2..1a66570a8c 100644
ac2e16
--- a/linux_os/guide/system/software/integrity/crypto/configure_openssl_crypto_policy/rule.yml
ac2e16
+++ b/linux_os/guide/system/software/integrity/crypto/configure_openssl_crypto_policy/rule.yml
ac2e16
@@ -11,7 +11,7 @@ description: |-
ac2e16
     To check that Crypto Policies settings are configured correctly, you have to examine the OpenSSL config file
ac2e16
     available under <tt>/etc/pki/tls/openssl.cnf</tt>.
ac2e16
     This file has the <tt>ini</tt> format, and it enables crypto policy support
ac2e16
-    if there is a <tt>[ crypto_policy ]</tt> section that contains the <tt>.include /etc/crypto-policies/back-ends/openssl.config</tt> directive.
ac2e16
+    if there is a <tt>[ crypto_policy ]</tt> section that contains the <tt>.include /etc/crypto-policies/back-ends/opensslcnf.config</tt> directive.
ac2e16
 
ac2e16
 rationale: |-
ac2e16
     Overriding the system crypto policy makes the behavior of the Java runtime violates expectations,
ac2e16
@@ -29,11 +29,11 @@ references:
ac2e16
 
ac2e16
 ocil_clause: |-
ac2e16
     the OpenSSL config file doesn't contain the whole section,
ac2e16
-    or that the section doesn't have the 
.include /etc/crypto-policies/back-ends/openssl.config
directive
ac2e16
+    or that the section doesn't have the 
.include /etc/crypto-policies/back-ends/opensslcnf.config
directive
ac2e16
 
ac2e16
 ocil: |-
ac2e16
-    To verify that OpenSSL uses the system crypro policy, check out that the OpenSSL config file
ac2e16
+    To verify that OpenSSL uses the system crypto policy, check out that the OpenSSL config file
ac2e16
     
/etc/pki/tls/openssl.cnf
contains the
[ crypto_policy ]
section with the
ac2e16
-    
.include /etc/crypto-policies/back-ends/openssl.config
directive:
ac2e16
-    
grep '\.include\s* /etc/crypto-policies/back-ends/openssl.config$' /etc/pki/tls/openssl.cnf
.
ac2e16
+    
.include /etc/crypto-policies/back-ends/opensslcnf.config
directive:
ac2e16
+    
grep '\.include\s* /etc/crypto-policies/back-ends/opensslcnf.config$' /etc/pki/tls/openssl.cnf
.
ac2e16
 
ac2e16
ac2e16
From 5e4f19a3301fbdc74b199b418a435924089d6c30 Mon Sep 17 00:00:00 2001
ac2e16
From: Vojtech Polasek <vpolasek@redhat.com>
ac2e16
Date: Thu, 25 Jun 2020 09:54:09 +0200
ac2e16
Subject: [PATCH 2/3] updated tests
ac2e16
ac2e16
---
ac2e16
 .../configure_openssl_crypto_policy/tests/ok.pass.sh   |  2 +-
ac2e16
 .../tests/wrong.fail.sh                                | 10 ++++++++++
ac2e16
 2 files changed, 11 insertions(+), 1 deletion(-)
ac2e16
 create mode 100644 linux_os/guide/system/software/integrity/crypto/configure_openssl_crypto_policy/tests/wrong.fail.sh
ac2e16
ac2e16
diff --git a/linux_os/guide/system/software/integrity/crypto/configure_openssl_crypto_policy/tests/ok.pass.sh b/linux_os/guide/system/software/integrity/crypto/configure_openssl_crypto_policy/tests/ok.pass.sh
ac2e16
index 5b8334735e..c56916883e 100644
ac2e16
--- a/linux_os/guide/system/software/integrity/crypto/configure_openssl_crypto_policy/tests/ok.pass.sh
ac2e16
+++ b/linux_os/guide/system/software/integrity/crypto/configure_openssl_crypto_policy/tests/ok.pass.sh
ac2e16
@@ -6,5 +6,5 @@
ac2e16
 
ac2e16
 create_config_file_with "[ crypto_policy ]
ac2e16
 
ac2e16
-.include /etc/crypto-policies/back-ends/openssl.config
ac2e16
+.include /etc/crypto-policies/back-ends/opensslcnf.config
ac2e16
 "
ac2e16
diff --git a/linux_os/guide/system/software/integrity/crypto/configure_openssl_crypto_policy/tests/wrong.fail.sh b/linux_os/guide/system/software/integrity/crypto/configure_openssl_crypto_policy/tests/wrong.fail.sh
ac2e16
new file mode 100644
ac2e16
index 0000000000..5b8334735e
ac2e16
--- /dev/null
ac2e16
+++ b/linux_os/guide/system/software/integrity/crypto/configure_openssl_crypto_policy/tests/wrong.fail.sh
ac2e16
@@ -0,0 +1,10 @@
ac2e16
+#!/bin/bash
ac2e16
+# platform = multi_platform_fedora,Red Hat Enterprise Linux 8
ac2e16
+# profiles = xccdf_org.ssgproject.content_profile_ospp, xccdf_org.ssgproject.content_profile_standard
ac2e16
+
ac2e16
+. common.sh
ac2e16
+
ac2e16
+create_config_file_with "[ crypto_policy ]
ac2e16
+
ac2e16
+.include /etc/crypto-policies/back-ends/openssl.config
ac2e16
+"
ac2e16
ac2e16
From 73804523130ce02162b780b8811e79e6adcb51a6 Mon Sep 17 00:00:00 2001
ac2e16
From: Gabriel Becker <ggasparb@redhat.com>
ac2e16
Date: Thu, 25 Jun 2020 17:32:00 +0200
ac2e16
Subject: [PATCH 3/3] Update task name to reflect correct opensslcnf.config
ac2e16
 file.
ac2e16
ac2e16
---
ac2e16
 .../crypto/configure_openssl_crypto_policy/ansible/shared.yml | 4 ++--
ac2e16
 1 file changed, 2 insertions(+), 2 deletions(-)
ac2e16
ac2e16
diff --git a/linux_os/guide/system/software/integrity/crypto/configure_openssl_crypto_policy/ansible/shared.yml b/linux_os/guide/system/software/integrity/crypto/configure_openssl_crypto_policy/ansible/shared.yml
ac2e16
index 98fe134aca..986543c10f 100644
ac2e16
--- a/linux_os/guide/system/software/integrity/crypto/configure_openssl_crypto_policy/ansible/shared.yml
ac2e16
+++ b/linux_os/guide/system/software/integrity/crypto/configure_openssl_crypto_policy/ansible/shared.yml
ac2e16
@@ -11,7 +11,7 @@
ac2e16
   changed_when: False
ac2e16
   check_mode: no
ac2e16
 
ac2e16
-- name: "Add .include for openssl.config to crypto_policy section"
ac2e16
+- name: "Add .include for opensslcnf.config to crypto_policy section"
ac2e16
   lineinfile:
ac2e16
     create: yes
ac2e16
     insertafter: '^\s*\[\s*crypto_policy\s*]\s*'
ac2e16
@@ -21,7 +21,7 @@
ac2e16
     - test_crypto_policy_group.stdout is defined
ac2e16
     - test_crypto_policy_group.stdout | length > 0
ac2e16
 
ac2e16
-- name: "Add crypto_policy group and set include openssl.config"
ac2e16
+- name: "Add crypto_policy group and set include opensslcnf.config"
ac2e16
   lineinfile:
ac2e16
     create: yes
ac2e16
     line: "[crypto_policy]\n.include /etc/crypto-policies/back-ends/opensslcnf.config"