From 4abf9158912789ba3959f70351cf945cefa32590 Mon Sep 17 00:00:00 2001 From: Tanja Roth Date: Fri, 30 Jun 2023 16:50:09 +0200 Subject: [PATCH 01/12] Security Guide: add chapter skeleton (cherry picked from commit f4bf60510b8c055718a94f9f9098ea77d1b33e1b) --- xml/book_security.xml | 1 + xml/security_cryptopolicy.xml | 36 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 xml/security_cryptopolicy.xml diff --git a/xml/book_security.xml b/xml/book_security.xml index a67cce4351..2fa18325ac 100644 --- a/xml/book_security.xml +++ b/xml/book_security.xml @@ -60,6 +60,7 @@ + diff --git a/xml/security_cryptopolicy.xml b/xml/security_cryptopolicy.xml new file mode 100644 index 0000000000..ea17a61be9 --- /dev/null +++ b/xml/security_cryptopolicy.xml @@ -0,0 +1,36 @@ + + + %entities; +]> + + + + Enforcing a system-wide crypto policy + + + + bla + + + + + + yes + + + + + Conceptual overview + + + bla + + + + \ No newline at end of file From 08133b2b5bf18a7fc432b51bca9b953fec3bb268 Mon Sep 17 00:00:00 2001 From: Tanja Roth Date: Fri, 30 Jun 2023 16:50:47 +0200 Subject: [PATCH 02/12] start adding basic info and ToDos (cherry picked from commit 1952b23617fbe760f606724055da2fa38e0cf2b4) --- xml/security_cryptopolicy.xml | 58 +++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/xml/security_cryptopolicy.xml b/xml/security_cryptopolicy.xml index ea17a61be9..6003faf61e 100644 --- a/xml/security_cryptopolicy.xml +++ b/xml/security_cryptopolicy.xml @@ -4,33 +4,45 @@ %entities; ]> - + + Using system-wide crypto policies + + + + bla + + + + + yes + + + + Conceptual overview - Enforcing a system-wide crypto policy - - - - bla - - - - - - yes - - - - - Conceptual overview + + The crypto-policies RPM package provides pre-built + configuration files with cryptographic policies for cryptographic + back-ends, such as SSL/TLS libraries. This package allows to set the + cryptographic security level for all applications that use a + cryptographic back-end supported by the policies. + - - bla - - - - \ No newline at end of file + + For now, OpenSSL, GnuTLS, Apache2, Java/OpenJDK (java-1_8_0-openjdk and + java-11-openjdk) and perl-IO-Socket-SSL follow these policies. More + libraries and applications will be added gradually. + + + From 9b0d761ac70b20b833a8ab575cbd81d734120439 Mon Sep 17 00:00:00 2001 From: Tanja Roth Date: Fri, 30 Jun 2023 16:51:21 +0200 Subject: [PATCH 03/12] add predefined policy levels (cherry picked from commit 48683d4034d74350f3cb96c1ebf7227c7737b4ff) --- xml/security_cryptopolicy.xml | 78 ++++++++++++++++++++++++++++++++--- 1 file changed, 73 insertions(+), 5 deletions(-) diff --git a/xml/security_cryptopolicy.xml b/xml/security_cryptopolicy.xml index 6003faf61e..b540970bc0 100644 --- a/xml/security_cryptopolicy.xml +++ b/xml/security_cryptopolicy.xml @@ -14,8 +14,8 @@ * add new chapter to Security Guide, describe also integration * explain how we intend customers to use the crypto-policies * explain what changed exactly and what impact this has, - e.g. if someone updates from SP3 (no active crypto-policies) - to SP4 (active crypto-policies)--> + e.g. if someone updates from SP3 (no active crypto-policies) + to SP4 (active crypto-policies)--> Using system-wide crypto policies @@ -40,9 +40,77 @@ - For now, OpenSSL, GnuTLS, Apache2, Java/OpenJDK (java-1_8_0-openjdk and - java-11-openjdk) and perl-IO-Socket-SSL follow these policies. More - libraries and applications will be added gradually. + Crypto-policies apply to the configuration of the core cryptographic + subsystems. They cover the supported secure communications protocols on + the base operating system, such as TLS, IKE, IPSec, DNSSec and Kerberos + protocols. + + + + Predefined policy levels + + + The crypto-policies package comes with the following + predefined policy levels: + + + + + DEFAULT + + + A reasonable default policy for today's standards. It allows the + TLS 1.2, and TLS 1.3 protocols, as well as IKEv2 and SSH2. The + Diffie-Hellman parameters are accepted if they are at least 2048 + bits long. The level provides at least 112-bit security with the + exception of allowing SHA-1 signatures in DNSSec where they are + still prevalent. + + + + + FIPS + + + A level that conforms to the FIPS 140-2 requirements. This policy + is used internally by the fips-mode-setup tool + which can switch the system into FIPS 140-2 compliance mode. The + level provides at least 112-bit security. + + + + + FUTURE + + + A conservative security level that is believed to withstand any + near-term future attacks. This level does not allow the use of + SHA-1 in signature algorithms. The level also provides some (not + complete) preparation for post-quantum encryption support in form + of 256-bit symmetric encryption requirement. The RSA and + Diffie-Hellman parameters are accepted if larger than 3071 bits. + The level provides at least 128-bit security. + + + + + LEGACY + + + This policy ensures maximum compatibility with legacy systems. It + is less secure and it includes support for TLS 1.0, TLS 1.1, and + SSH2 protocols or later. The algorithms DSA, 3DES, and RC4 are + allowed, while RSA and Diffie-Hellman parameters are accepted if + larger than 1023 bits. The level provides at least 64-bit security. + + + + + + + For more details on the individual policies, see the man page of + crypto-policies. All policies are located in + /usr/share/crypto-policies/policiesNAME.pol. From 559093bfa5add0f1ef3a90632ff1fa978f49cb89 Mon Sep 17 00:00:00 2001 From: Tanja Roth Date: Fri, 7 Jul 2023 17:45:12 +0200 Subject: [PATCH 04/12] adding minor info and skeleton for next section --- xml/security_cryptopolicy.xml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/xml/security_cryptopolicy.xml b/xml/security_cryptopolicy.xml index b540970bc0..3626c25a94 100644 --- a/xml/security_cryptopolicy.xml +++ b/xml/security_cryptopolicy.xml @@ -43,7 +43,8 @@ Crypto-policies apply to the configuration of the core cryptographic subsystems. They cover the supported secure communications protocols on the base operating system, such as TLS, IKE, IPSec, DNSSec and Kerberos - protocols. + protocols. Having crypto-policies allows to easily handle the deprecation + of algorithms or protocols system-wide and in a transparent manner. @@ -108,9 +109,19 @@ - For more details on the individual policies, see the man page of + Policies can change over time together with the security of the + cryptographic components. For the latest details on the individual + policies, therefore see the man page of crypto-policies. All policies are located in /usr/share/crypto-policies/policiesNAME.pol. + + Setting the crypto-policy to use + + + The policy that currently is in use on the system can be checked with the + update-crypto-policies command: + + From 79cc543e23902e001e4b95dd6ced1f22d9a787b6 Mon Sep 17 00:00:00 2001 From: Tanja Roth Date: Fri, 4 Aug 2023 16:28:30 +0200 Subject: [PATCH 05/12] switch crypto-policy level --- xml/security_cryptopolicy.xml | 40 +++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/xml/security_cryptopolicy.xml b/xml/security_cryptopolicy.xml index 3626c25a94..5fbe35b66f 100644 --- a/xml/security_cryptopolicy.xml +++ b/xml/security_cryptopolicy.xml @@ -16,7 +16,7 @@ * explain what changed exactly and what impact this has, e.g. if someone updates from SP3 (no active crypto-policies) to SP4 (active crypto-policies)--> - Using system-wide crypto policies + Using system-wide cryptographic policies @@ -117,11 +117,39 @@ - Setting the crypto-policy to use + Switching to a different crypto-policy level - - The policy that currently is in use on the system can be checked with the - update-crypto-policies command: - + + + + To check the crypto-policy level that is currently in use: + +&prompt.root;update-crypto-policies --show + + + + To switch to a different policy level, use the + option: + +update-crypto-policies --set POLICY + taroth 2023-07-04: do we need a word of caution here for LEGACY and FIPS? + and can we tell that switching to 'LEGACY' enables compatibility with a specific + older SLE version, like SLE 12 SP5 or so? + + + LEGACY crypto-policy level is less secure + + Switching to a LEGACY crypto-policy level makes your system and + applications less secure. + + + + + + After switching to a different policy level restart the system to + apply the changes. + + + From 2240999bbe6be5f53fd8f860bb47ba59f49b9c51 Mon Sep 17 00:00:00 2001 From: Tanja Roth Date: Fri, 4 Aug 2023 16:32:40 +0200 Subject: [PATCH 06/12] predefined policies are read-only --- xml/security_cryptopolicy.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xml/security_cryptopolicy.xml b/xml/security_cryptopolicy.xml index 5fbe35b66f..ddc247e35a 100644 --- a/xml/security_cryptopolicy.xml +++ b/xml/security_cryptopolicy.xml @@ -112,8 +112,10 @@ Policies can change over time together with the security of the cryptographic components. For the latest details on the individual policies, therefore see the man page of - crypto-policies. All policies are located in - /usr/share/crypto-policies/policiesNAME.pol. + crypto-policies. All predefined policies are located + in + /usr/share/crypto-policies/policiesNAME.pol + and are read-only. From 3a141939cb2981db867ab6c7467d5dc2d150d427 Mon Sep 17 00:00:00 2001 From: Tanja Roth Date: Fri, 4 Aug 2023 17:42:06 +0200 Subject: [PATCH 07/12] custom subpolicy (WIP) --- xml/security_cryptopolicy.xml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/xml/security_cryptopolicy.xml b/xml/security_cryptopolicy.xml index ddc247e35a..d22d43a484 100644 --- a/xml/security_cryptopolicy.xml +++ b/xml/security_cryptopolicy.xml @@ -121,6 +121,13 @@ Switching to a different crypto-policy level + + Use the update-crypto-policies to set the policy level + which is applied to the cryptographic back-ends. It is the default policy + used by these back-ends unless the application user configures them + otherwise. + + @@ -154,4 +161,27 @@ + + Customizing existing crypto-policies + + + You can modify aspects of any predefined policy by removing or adding + algorithms or protocols. This way, you create a subpolicy (or policy + modifier module), stored in text files that include the modifications. + After creation, one or multiple subpolicies can be applied on the command + line to one of the predefined policies. For details, see example ????. + + + + Subpolicies need to be stored in + /usr/share/crypto-policies/policies/modules/. You + can also find example subpolicies in this directory. The name of the + subpolicy file must be MODULE.pmod, where + MODULE is the name of the modifier in + uppercase and without spaces. + + + + + From e5590655729473558db7e13063b693d1b54f205c Mon Sep 17 00:00:00 2001 From: Tanja Roth Date: Fri, 11 Aug 2023 14:59:07 +0200 Subject: [PATCH 08/12] custom subpolicy: added example --- xml/security_cryptopolicy.xml | 73 ++++++++++++++++++++++++++++++----- 1 file changed, 64 insertions(+), 9 deletions(-) diff --git a/xml/security_cryptopolicy.xml b/xml/security_cryptopolicy.xml index d22d43a484..f6a92fec98 100644 --- a/xml/security_cryptopolicy.xml +++ b/xml/security_cryptopolicy.xml @@ -156,7 +156,7 @@ After switching to a different policy level restart the system to - apply the changes. + apply the changes to the applications. @@ -169,19 +169,74 @@ algorithms or protocols. This way, you create a subpolicy (or policy modifier module), stored in text files that include the modifications. After creation, one or multiple subpolicies can be applied on the command - line to one of the predefined policies. For details, see example ????. + line to one of the predefined policies. For details, see + . - Subpolicies need to be stored in - /usr/share/crypto-policies/policies/modules/. You - can also find example subpolicies in this directory. The name of the - subpolicy file must be MODULE.pmod, where - MODULE is the name of the modifier in - uppercase and without spaces. + You can find example subpolicies in + /usr/share/crypto-policies/policies/modules. + However, your own subpolicies need to be stored in + /etc/crypto-policies/policies/modules (unless they + are packaged) . The name of the subpolicy file must be + MODULE.pmod, where + MODULE is the name of the subpolicy. It needs + to be spelled in uppercase letters and without spaces. - + + Removing support for RSA and PSK key exchanges + + The following example shows you how to create a subpolicy which removes + support for RSA and PSK key exchanges from the + DEFAULT policy. Both key exchanges do not provide + forward secrecy, which means they cannot make sure that session keys + are not compromised in case long-term secrets used in the key exchange + session are compromised. + + + + + In /etc/crypto-policies/policies/modules/ + create a new file, named NO-RSA-PSK.pmod. + + + + + Add the following line and save the file afterwards: + +key_exchange = -RSA -PSK + + Now you can apply the newly created subpolicy to one of the + predefined policies. + + + + + Assuming the current system-wide policy is + DEFAULT and you want to apply the newly created + subpolicy to DEFAULT: + command: + +&prompt.root;update-crypto-policies --set DEFAULT:NO-RSA-PSK + + + + Double-check if the subpolicy has been added to + DEFAULT: + +update-crypto-policies --show + DEFAULT:NO-RSA-PSK + + + + Reboot the system to apply the system-wide policy adjustment to the + applications. + + + + + From c79575b44f00ad88666738cf7e494c093fb3bb2c Mon Sep 17 00:00:00 2001 From: Tanja Roth Date: Fri, 11 Aug 2023 16:15:20 +0200 Subject: [PATCH 09/12] create new policy --- xml/security_cryptopolicy.xml | 75 +++++++++++++++++++++++++++++++---- 1 file changed, 68 insertions(+), 7 deletions(-) diff --git a/xml/security_cryptopolicy.xml b/xml/security_cryptopolicy.xml index f6a92fec98..97c5b21d03 100644 --- a/xml/security_cryptopolicy.xml +++ b/xml/security_cryptopolicy.xml @@ -114,7 +114,7 @@ policies, therefore see the man page of crypto-policies. All predefined policies are located in - /usr/share/crypto-policies/policiesNAME.pol + /usr/share/crypto-policies/policies/NAME.pol and are read-only. @@ -178,8 +178,8 @@ /usr/share/crypto-policies/policies/modules. However, your own subpolicies need to be stored in /etc/crypto-policies/policies/modules (unless they - are packaged) . The name of the subpolicy file must be - MODULE.pmod, where + are packaged). The name of the subpolicy file must be + MODULE.pmod, where MODULE is the name of the subpolicy. It needs to be spelled in uppercase letters and without spaces. @@ -216,7 +216,6 @@ Assuming the current system-wide policy is DEFAULT and you want to apply the newly created subpolicy to DEFAULT: - command: &prompt.root;update-crypto-policies --set DEFAULT:NO-RSA-PSK @@ -226,17 +225,79 @@ DEFAULT: update-crypto-policies --show - DEFAULT:NO-RSA-PSK +DEFAULT:NO-RSA-PSK Reboot the system to apply the system-wide policy adjustment to the - applications. + applications: +&prompt.root;reboot + + + Creating a new policy from scratch + + + Instead of customizing an existing crypto-policy with a subpolicy you can + also decide to write a new policy from scratch. You can use any of the + predefined policies in + /usr/share/crypto-policies/policies/ as a starting + point. However, your own policy file needs to be stored in + /etc/crypto-policies/policies/. Name your file + MY_POLICY.pol, where + MY_POLICY is the name of the policy. Make sure + it is owned by &rootuser; and is not writable by non-privileged users. + - + + Creating a new policy and applying it + + The following example shows you how to create a new policy based on the + DEFAULT policy. + + + + + Copy the DEFAULT policy to + /etc/crypto-policies/policies/ and rename it: + +cp /usr/share/crypto-policies/policies/DEFAULT.pol /etc/crypto-policies/policies/MY_POLICY.pol + + + + Edit the policy as desired and save it. + + + + + Switch the system to the new policy: + +&prompt.root;update-crypto-policies --set MY_POLICY + + + + Reboot the system to apply the new policy to the + applications and running services: + +&prompt.root;reboot + + + + Double-check if the policy is active: + +update-crypto-policies --show +MY_POLICY + + + + Reboot the system to apply the system-wide policy adjustment to the + applications. + + + + From f113ed24a32e32f5ec37b2bc3aba2b9950169308 Mon Sep 17 00:00:00 2001 From: Tanja Roth Date: Fri, 11 Aug 2023 18:21:32 +0200 Subject: [PATCH 10/12] corrections from checking output --- xml/security_cryptopolicy.xml | 79 +++++++++++++++++------------------ 1 file changed, 38 insertions(+), 41 deletions(-) diff --git a/xml/security_cryptopolicy.xml b/xml/security_cryptopolicy.xml index 97c5b21d03..136413b460 100644 --- a/xml/security_cryptopolicy.xml +++ b/xml/security_cryptopolicy.xml @@ -8,7 +8,7 @@ xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" - xml:id="cha-security-cryptopolicy"> + xml:id="cha-security-cryptopolicies">