이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 2. Using system-wide cryptographic policies


The system-wide cryptographic policies component configures the core cryptographic subsystems, which cover the TLS, IPsec, SSH, DNSSEC, and Kerberos protocols. As an administrator, you can select one of the provided cryptographic policies for your system.

2.1. System-wide cryptographic policies

When a system-wide policy is set up, applications in RHEL follow it and refuse to use algorithms and protocols that do not meet the policy, unless you explicitly request the application to do so. That is, the policy applies to the default behavior of applications when running with the system-provided configuration but you can override it if required.

RHEL 10 contains the following predefined policies:

DEFAULT
The default system-wide cryptographic policy level offers secure settings for current threat models. It allows the TLS 1.2 and 1.3 protocols, as well as the IKEv2 and SSH2 protocols. The RSA keys and Diffie-Hellman parameters are accepted if they are at least 2048 bits long. TLS ciphers that use the RSA key exchange are rejected.
LEGACY
Ensures maximum compatibility with Red Hat Enterprise Linux 6 and earlier; it is less secure due to an increased attack surface. CBC-mode ciphers are allowed to be used with SSH. It allows the TLS 1.2 and 1.3 protocols, as well as the IKEv2 and SSH2 protocols. The RSA keys and Diffie-Hellman parameters are accepted if they are at least 2048 bits long. SHA-1 signatures are allowed outside TLS. Ciphers that use the RSA key exchange are accepted.
FUTURE

A stricter forward-looking security level intended for testing a possible future policy. This policy does not allow the use of SHA-1 in DNSSEC or as an HMAC. SHA2-224 and SHA3-224 hashes are rejected. 128-bit ciphers are disabled. CBC-mode ciphers are disabled except in Kerberos. It allows the TLS 1.2 and 1.3 protocols, as well as the IKEv2 and SSH2 protocols. The RSA keys and Diffie-Hellman parameters are accepted if they are at least 3072 bits long. If your system communicates on the public internet, you might face interoperability problems.

Important

Because a cryptographic key used by a certificate on the Customer Portal API does not meet the requirements by the FUTURE system-wide cryptographic policy, the redhat-support-tool utility does not work with this policy level at the moment.

To work around this problem, use the DEFAULT cryptographic policy while connecting to the Customer Portal API.

FIPS

Conforms with the FIPS 140 requirements. Red Hat Enterprise Linux systems in FIPS mode use this policy.

Note

Your system is not FIPS-compliant after you set the FIPS cryptographic policy. The only correct way to make your RHEL system compliant with the FIPS 140 standards is by installing it in FIPS mode.

RHEL also provides the FIPS:OSPP system-wide subpolicy, which contains further restrictions for cryptographic algorithms required by the Common Criteria (CC) certification. The system becomes less interoperable after you set this subpolicy. For example, you cannot use RSA and DH keys shorter than 3072 bits, additional SSH algorithms, and several TLS groups. Setting FIPS:OSPP also prevents connecting to Red Hat Content Delivery Network (CDN) structure. Furthermore, you cannot integrate Active Directory (AD) into the IdM deployments that use FIPS:OSPP, communication between RHEL hosts using FIPS:OSPP and AD domains might not work, or some AD accounts might not be able to authenticate.

Note

Your system is not CC-compliant after you set the FIPS:OSPP cryptographic subpolicy. The only correct way to make your RHEL system compliant with the CC standard is by following the guidance provided in the cc-config package. See the Common Criteria section on the Product compliance Red Hat Customer Portal page for a list of certified RHEL versions, validation reports, and links to CC guides.

Red Hat continuously adjusts all policy levels so that all libraries provide secure defaults, except when using the LEGACY policy. Even though the LEGACY profile does not provide secure defaults, it does not include any algorithms that are easily exploitable. As such, the set of enabled algorithms or acceptable key sizes in any provided policy may change during the lifetime of Red Hat Enterprise Linux.

Such changes reflect new security standards and new security research. If you must ensure interoperability with a specific system for the whole lifetime of Red Hat Enterprise Linux, you should opt-out from the system-wide cryptographic policies for components that interact with that system or re-enable specific algorithms using custom cryptographic policies.

The specific algorithms and ciphers described as allowed in the policy levels are available only if an application supports them:

Expand
Table 2.1. Cipher suites and protocols enabled in the cryptographic policies
 LEGACYDEFAULTFIPSFUTURE

IKEv1

no

no

no

no

3DES

no

no

no

no

RC4

no

no

no

no

DH

min. 2048-bit

min. 2048-bit

min. 2048-bit

min. 3072-bit

RSA

min. 2048-bit

min. 2048-bit

min. 2048-bit

min. 3072-bit

DSA

no

no

no

no

TLS v1.1 and older

no

no

no

no

TLS v1.2 and newer

yes

yes

yes

yes

SHA-1 in digital signatures and certificates

yes[a]

no

no

no

CBC mode ciphers

yes

no[b]

no[c]

no[d]

Symmetric ciphers with keys < 256 bits

yes

yes

yes

no

[a] SHA-1 signatures are disabled in TLS contexts
[b] CBC ciphers are disabled for SSH
[c] CBC ciphers are disabled for all protocols except Kerberos
[d] CBC ciphers are disabled for all protocols except Kerberos

You can find further details about cryptographic policies and covered applications in the crypto-policies(7) man page on your system.

2.2. Changing the system-wide cryptographic policy

You can change the system-wide cryptographic policy on your system by using the update-crypto-policies tool and restarting your system. The update-crypto-policies(8) man page on your system provides the reference of all options, corresponding files, and per-application details.

Prerequisites

  • You have root privileges on the system.

Procedure

  1. Optional: Display the current cryptographic policy:

    $ update-crypto-policies --show
    DEFAULT
    Copy to Clipboard Toggle word wrap
  2. Set the new cryptographic policy:

    # update-crypto-policies --set <POLICY>
    <POLICY>
    Copy to Clipboard Toggle word wrap

    Replace <POLICY> with the policy or subpolicy you want to set, for example, FUTURE, LEGACY, or FIPS:OSPP.

  3. Restart the system:

    # reboot
    Copy to Clipboard Toggle word wrap

Verification

  • Display the current cryptographic policy:

    $ update-crypto-policies --show
    <POLICY>
    Copy to Clipboard Toggle word wrap

The default system-wide cryptographic policy in Red Hat Enterprise Linux 10 does not allow communication using older, insecure protocols. For environments that require compatibility with Red Hat Enterprise Linux 6 or earlier, the less secure LEGACY policy is available.

Warning

Switching to the LEGACY policy results in a less secure system and applications.

Prerequisites

Procedure

  1. To switch the system-wide cryptographic policy to LEGACY, enter:

    # update-crypto-policies --set LEGACY
    Setting system policy to LEGACY
    Copy to Clipboard Toggle word wrap

    For the list of available cryptographic policies, see the update-crypto-policies(8) man page on your system.

  2. To make your cryptographic settings effective for already running services and applications, restart the system:

    $ reboot
    Copy to Clipboard Toggle word wrap

Verification

  • After the restart, verify the current policy is set to LEGACY:

    $ update-crypto-policies --show
    LEGACY
    Copy to Clipboard Toggle word wrap

Next steps

  • For defining custom cryptographic policies, see the Custom Policies section in the update-crypto-policies(8) man page and the Crypto Policy Definition Format section in the crypto-policies(7) man page on your system.

2.4. Setting up system-wide cryptographic policies in the web console

You can set one of the system-wide cryptographic policies and subpolicies directly in the RHEL web console interface. Besides the three predefined system-wide cryptographic policies, you can also apply the following combination of the LEGACY policy and the AD-SUPPORT subpolicy through the graphical interface. The LEGACY:AD-SUPPORT policy is the LEGACY policy with less secure settings that improve interoperability for Active Directory services.

Prerequisites

Procedure

  1. Log in to the RHEL 10 web console.
  2. In the Configuration card of the Overview page, click your current policy value next to Crypto policy.

    The web console: Overview

  3. In the Change crypto policy dialog window, click on the policy you want to start using on your system.
  4. Click the Apply and reboot button.

Verification

  • After the restart, log back in to web console, and check that the Crypto policy value corresponds to the one you selected.

    Alternatively, you can enter the update-crypto-policies --show command to display the current system-wide cryptographic policy in your terminal.

2.5. Excluding an application from following system-wide crypto policies

You can customize cryptographic settings used by your application by configuring supported cipher suites and protocols directly in the application.

You can also remove a symlink related to your application from the /etc/crypto-policies/back-ends directory and replace it with your customized cryptographic settings. This configuration prevents the use of system-wide cryptographic policies for applications that use the excluded back end. Furthermore, this modification is not supported by Red Hat.

2.5.1. Examples of opting out of system-wide crypto policies

curl

To specify ciphers used by the curl tool, use the --ciphers option and provide a colon-separated list of ciphers as a value. For example:

$ curl <https://example.com> --ciphers '@SECLEVEL=0:DES-CBC3-SHA:RSA-DES-CBC3-SHA'
Copy to Clipboard Toggle word wrap

See the curl(1) man page for more information.

Libreswan
See the Enabling legacy ciphers and algorithms in Libreswan section in the Securing networks document for detailed information.
Mozilla Firefox
Even though you cannot opt out of system-wide cryptographic policies in the Mozilla Firefox web browser, you can further restrict supported ciphers and TLS versions in the Firefox’s Configuration Editor. Type about:config in the address bar and change the value of the security.tls.version.min option as required. Setting security.tls.version.min to 1 allows TLS 1.0 as the minimum required, security.tls.version.min 2 enables TLS 1.1, and so on.
OpenSSH server

To opt out of the system-wide cryptographic policies for your OpenSSH server, specify the cryptographic policy in a drop-in configuration file located in the /etc/ssh/sshd_config.d/ directory. Use a two-digit number prefix smaller than 50, so that it lexicographically precedes the 50-redhat.conf file, and a .conf suffix, for example, 49-crypto-policy-override.conf.

See the sshd_config(5) man page for more information.

OpenSSH client

To opt out of system-wide cryptographic policies for your OpenSSH client, perform one of the following tasks:

  • For a given user, override the global ssh_config with a user-specific configuration in the ~/.ssh/config file.
  • For the entire system, specify the cryptographic policy in a drop-in configuration file located in the /etc/ssh/ssh_config.d/ directory, with a two-digit number prefix smaller than 50, so that it lexicographically precedes the 50-redhat.conf file, and with a .conf suffix, for example, 49-crypto-policy-override.conf.

See the ssh_config(5) man page for more information.

wget

To customize cryptographic settings used by the wget network downloader, use the --secure-protocol and --ciphers options. For example:

$ wget --secure-protocol=TLSv1_1 --ciphers="SECURE128" <https://example.com>
Copy to Clipboard Toggle word wrap

See the HTTPS (SSL/TLS) Options section of the wget(1) man page for more information.

2.6. Customizing system-wide cryptographic policies with subpolicies

You can adjust the set of enabled cryptographic algorithms or protocols on the system. You can either apply custom subpolicies on top of an existing system-wide cryptographic policy or define such a policy from scratch.

The concept of scoped policies allows enabling different sets of algorithms for different back ends. You can limit each configuration directive to specific protocols, libraries, or services.

Furthermore, you can use wildcard characters in directives, for example, an asterisk to specify multiple values. For the complete syntax reference, see the Custom Policies section in the update-crypto-policies(8) man page and the Crypto Policy Definition Format section in the crypto-policies(7) man page on your system.

  • The /etc/crypto-policies/state/CURRENT.pol file lists all settings in the currently applied system-wide cryptographic policy after wildcard expansion.
  • To make your cryptographic policy more strict, consider using values listed in the /usr/share/crypto-policies/policies/FUTURE.pol file.
  • You can find example subpolicies in the /usr/share/crypto-policies/policies/modules/ directory.

Procedure

  1. Checkout to the /etc/crypto-policies/policies/modules/ directory:

    # cd /etc/crypto-policies/policies/modules/
    Copy to Clipboard Toggle word wrap
  2. Create subpolicies for your adjustments, for example:

    # touch <MYCRYPTO-1>.pmod
    # touch <SCOPES-AND-WILDCARDS>.pmod
    Copy to Clipboard Toggle word wrap
    Important

    Use upper-case letters in file names of policy modules.

  3. Open the policy modules in a text editor of your choice and insert options that modify the system-wide cryptographic policy, for example:

    # vi <MYCRYPTO-1>.pmod
    Copy to Clipboard Toggle word wrap
    min_rsa_size = 3072
    hash = SHA2-384 SHA2-512 SHA3-384 SHA3-512
    Copy to Clipboard Toggle word wrap
    # vi <SCOPES-AND-WILDCARDS>.pmod
    Copy to Clipboard Toggle word wrap
    # Disable the AES-128 cipher, all modes
    cipher = -AES-128-*
    
    # Disable CHACHA20-POLY1305 for the TLS protocol (OpenSSL, GnuTLS, NSS, and OpenJDK)
    cipher@TLS = -CHACHA20-POLY1305
    
    # Allow using the FFDHE-1024 group with the SSH protocol (libssh and OpenSSH)
    group@SSH = FFDHE-1024+
    
    # Disable all CBC mode ciphers for the SSH protocol (libssh and OpenSSH)
    cipher@SSH = -*-CBC
    
    # Allow the AES-256-CBC cipher in applications using libssh
    cipher@libssh = AES-256-CBC+
    Copy to Clipboard Toggle word wrap
  4. Save the changes in the module files.
  5. Apply your policy adjustments to the DEFAULT system-wide cryptographic policy level:

    # update-crypto-policies --set DEFAULT:<MYCRYPTO-1>:<SCOPES-AND-WILDCARDS>
    Copy to Clipboard Toggle word wrap
  6. To make your cryptographic settings effective for already running services and applications, restart the system:

    # reboot
    Copy to Clipboard Toggle word wrap

Verification

  • Check that the /etc/crypto-policies/state/CURRENT.pol file contains your changes, for example:

    $ cat /etc/crypto-policies/state/CURRENT.pol | grep rsa_size
    min_rsa_size = 3072
    Copy to Clipboard Toggle word wrap

2.7. Creating and setting a custom system-wide cryptographic policy

For specific scenarios, you can customize the system-wide cryptographic policy by creating and using a complete policy file.

Procedure

  1. Create a policy file for your customizations:

    # cd /etc/crypto-policies/policies/
    # touch <MYPOLICY>.pol
    Copy to Clipboard Toggle word wrap

    Alternatively, start by copying one of the four predefined policy levels:

    # cp /usr/share/crypto-policies/policies/DEFAULT.pol /etc/crypto-policies/policies/<MYPOLICY>.pol
    Copy to Clipboard Toggle word wrap
  2. Edit the file with your custom cryptographic policy in a text editor of your choice to fit your requirements, for example:

    # vi /etc/crypto-policies/policies/<MYPOLICY>.pol
    Copy to Clipboard Toggle word wrap

    See the Custom Policies section in the update-crypto-policies(8) man page and the Crypto Policy Definition Format section in the crypto-policies(7) man page on your system for the complete syntax reference.

  3. Switch the system-wide cryptographic policy to your custom level:

    # update-crypto-policies --set <MYPOLICY>
    Copy to Clipboard Toggle word wrap
  4. To make your cryptographic settings effective for already running services and applications, restart the system:

    # reboot
    Copy to Clipboard Toggle word wrap

2.8. Enabling post-quantum algorithms system-wide

You can enable post-quantum cryptography (PQC) system-wide by applying the TEST-PQ subpolicy. Post-quantum key-exchange algorithms that use the Module-Lattice-Based Key-Encapsulation Mechanism (ML-KEM) standard according to the FIPS 203 draft are available for TLS connections in OpenSSL, GnuTLS, and NSS, and for SSH connections in OpenSSH.

Important

All PQC algorithms in Red Hat Enterprise Linux 10 are provided as a Technology Preview feature. The package and system-wide cryptographic policy name are subject to change when post-quantum cryptography exits the Technology Preview state.

For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.

Prerequisites

  • The crypto-policies-scripts package is installed on the system.

Procedure

  1. Install the crypto-policies-pq-preview package:

    # dnf install -y crypto-policies-pq-preview
    Copy to Clipboard Toggle word wrap
  2. Enable the TEST-PQ cryptographic subpolicy on top of your current system-wide policy, for example:

    # update-crypto-policies --show
    DEFAULT
    # update-crypto-policies --set DEFAULT:TEST-PQ
    Copy to Clipboard Toggle word wrap
  3. To make your cryptographic settings effective for already running services and applications, restart the system:

    # reboot
    Copy to Clipboard Toggle word wrap

Verification

  • Check that the /etc/crypto-policies/state/CURRENT.pol file contains PQC, for example:

    $ cat /etc/crypto-policies/state/CURRENT.pol | grep MLKEM512
    group = MLKEM512 P256-MLKEM512 X25519-MLKEM512 MLKEM768 P384-MLKEM768 X448-MLKEM768 MLKEM768-X25519 X25519-MLKEM768 P256-MLKEM768 MLKEM1024 P521-MLKEM1024 P384-MLKEM1024 X25519 SECP256R1 X448 SECP521R1 SECP384R1 FFDHE-2048 FFDHE-3072 FFDHE-4096 FFDHE-6144 FFDHE-8192
    Copy to Clipboard Toggle word wrap

You can use the crypto_policies RHEL system role to configure the FUTURE policy on your managed nodes. This policy helps to achieve for example:

Future-proofing against emerging threats
Anticipates advancements in computational power.
Enhanced security
Stronger encryption standards require longer key lengths and more secure algorithms.
Compliance with high-security standards
In some industries, for example, in healthcare, telco, and finance the data sensitivity is high, and availability of strong cryptography is critical.

Typically, FUTURE is suitable for environments handling highly sensitive data, preparing for future regulations, or adopting long-term security strategies.

Warning

Legacy systems and software do not have to support the more modern and stricter algorithms and protocols enforced by the FUTURE policy. For example, older systems might not support TLS 1.3 or larger key sizes. This could lead to compatibility problems.

Also, using strong algorithms usually increases the computational workload, which could negatively affect your system performance.

Prerequisites

Procedure

  1. Create a playbook file, for example, ~/playbook.yml, with the following content:

    ---
    - name: Configure cryptographic policies
      hosts: managed-node-01.example.com
      tasks:
        - name: Configure the FUTURE cryptographic security policy on the managed node
          ansible.builtin.include_role:
            name: redhat.rhel_system_roles.crypto_policies
          vars:
            - crypto_policies_policy: FUTURE
            - crypto_policies_reboot_ok: true
    Copy to Clipboard Toggle word wrap

    The settings specified in the example playbook include the following:

    crypto_policies_policy: FUTURE
    Configures the required cryptographic policy (FUTURE) on the managed node. It can be either the base policy or a base policy with some subpolicies. The specified base policy and subpolicies have to be available on the managed node. The default value is null, which means that the configuration is not changed and the crypto_policies RHEL system role only collects the Ansible facts.
    crypto_policies_reboot_ok: true
    Causes the system to reboot after the cryptographic policy change to make sure all of the services and applications will read the new configuration files. The default value is false.

    For details about the role variables and the cryptographic configuration options, see the /usr/share/ansible/roles/rhel-system-roles.crypto_policies/README.md file and the update-crypto-policies(8) and crypto-policies(7) manual pages on the control node.

  2. Validate the playbook syntax:

    $ ansible-playbook --syntax-check ~/playbook.yml
    Copy to Clipboard Toggle word wrap

    Note that this command only validates the syntax and does not protect against a wrong but valid configuration.

  3. Run the playbook:

    $ ansible-playbook ~/playbook.yml
    Copy to Clipboard Toggle word wrap

Verification

  1. On the control node, create another playbook named, for example, verify_playbook.yml:

    ---
    - name: Verification
      hosts: managed-node-01.example.com
      tasks:
        - name: Verify active cryptographic policy
          ansible.builtin.include_role:
            name: redhat.rhel_system_roles.crypto_policies
        - name: Display the currently active cryptographic policy
          ansible.builtin.debug:
            var: crypto_policies_active
    Copy to Clipboard Toggle word wrap

    The settings specified in the example playbook include the following:

    crypto_policies_active
    An exported Ansible fact that contains the currently active policy name in the format as accepted by the crypto_policies_policy variable.
  2. Validate the playbook syntax:

    $ ansible-playbook --syntax-check ~/verify_playbook.yml
    Copy to Clipboard Toggle word wrap
  3. Run the playbook:

    $ ansible-playbook ~/verify_playbook.yml
    TASK [debug] **************************
    ok: [host] => {
        "crypto_policies_active": "FUTURE"
    }
    Copy to Clipboard Toggle word wrap

    The crypto_policies_active variable shows the active policy on the managed node.

맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat