Bug 2103327 - Generate AES SHA-2 HMAC keys on deployed IPA instances in FIPS mode
Summary: Generate AES SHA-2 HMAC keys on deployed IPA instances in FIPS mode
Keywords:
Status: ASSIGNED
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: krb5
Version: 9.0
Hardware: All
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Julien Rische
QA Contact: Michal Polovka
Filip Hanzelka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-07-02 08:50 UTC by Abhijit Roy
Modified: 2023-07-11 07:43 UTC (History)
19 users (show)

Fixed In Version:
Doc Type: Known Issue
Doc Text:
.Adding a RHEL 9 replica in FIPS mode to an IdM deployment in FIPS mode that was initialized with RHEL 8.6 or earlier fails The default RHEL 9 FIPS cryptographic policy aiming to comply with FIPS 140-3 does not allow the use of the AES HMAC-SHA1 encryption types' key derivation function as defined by RFC3961, section 5.1. This constraint is a blocker when adding a RHEL 9 Identity Management (IdM) replica in FIPS mode to a RHEL 8 IdM environment in FIPS mode in which the first server was installed on a RHEL 8.6 system or earlier. This is because there are no common encryption types between RHEL 9 and the previous RHEL versions, which commonly use the AES HMAC-SHA1 encryption types but do not use the AES HMAC-SHA2 encryption types. You can view the encryption type of your IdM master key by entering the following command on the server: [subs="quotes"] ---- # kadmin.local getprinc K/M | grep -E '^Key:' ---- To work around the problem, enable the use of AES HMAC-SHA1 on the RHEL 9 replica: [subs="quotes"] ---- update-crypto-policies --set FIPS:AD-SUPPORT ---- WARNING:: This workaround might violate FIPS compliance. As a result, adding the RHEL 9 replica to the IdM deployment proceeds correctly. Note that there is ongoing work to provide a procedure to generate missing AES HMAC-SHA2-encrypted Kerberos keys on RHEL 7 and RHEL 8 servers. This will achieve FIPS 140-3 compliance on the RHEL 9 replica. However, this process will not be fully automated, because the design of Kerberos key cryptography makes it impossible to convert existing keys to different encryption types. The only way is to ask users to renew their passwords.
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:
Embargoed:
jrische: needinfo-


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 2006843 0 low CLOSED Disable SHA-1 in FIPS policy 2023-06-13 08:29:54 UTC
Red Hat Issue Tracker FREEIPA-8445 0 None None None 2022-07-02 09:04:34 UTC
Red Hat Issue Tracker RHELPLAN-126891 0 None None None 2022-07-02 09:04:39 UTC
Red Hat Knowledge Base (Solution) 6973768 0 None None None 2022-08-31 18:43:08 UTC

Description Abhijit Roy 2022-07-02 08:50:29 UTC
Description of problem:

The RHEL 9 client configured for FIPS fails to join an IPA realm if the IPA server was created in FIPS.

The RHEL 9 client NOT configured for FIPS will successfully join an IPA realm if the IPA server was created in FIPS.

The RHEL 9 client configured for FIPS will successfully an IPA realm of the IPA server was not created it FIPS.

Version-Release number of selected component (if applicable):

ipa-client-4.9.8-7.el9_0.x86_64

How reproducible:

To replicate the problem, follow the following instructions.  I have replicated this issue many times. We have hundreds of nodes set with FIPS enabled.  Only the RHEL 9.0 systems will not join the IPA realm.

1.  Create a RHEL 9.0 system
2.  Enable FIPS:  fips-mode-setup --enable
3.  Reboot
4.  login
5.  ipa-client-setup -N (enter username, password, etc.)
6.  The node fails to join the IPA realm
7.  Disable FIPS: fips-mode-setup --disable
6. Reboot
7.  Login
8.  ipa-client-setup -N (enter username, password, etc.)
9.  Node joins the IPA realm with no error.

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 3 Florence Blanc-Renaud 2022-07-03 15:13:26 UTC
Hi @abroy 

I was not able to reproduce the issue. I configured a RHEL 9 server in FIPS mode, then ran ipa-server-install, then configured a client machine in FIPS mode, and ran ipa-client-install. Both machines were installed with RHEL 9 and ipa 4.9.8-7.el9_0. The client installation succeeds with admin or a user member of the admins group.

Can you provide the server sos report as well as the client sos report, or link to a customer case?

Comment 6 Florence Blanc-Renaud 2022-07-07 09:07:06 UTC
In the linked case, the customer has a RHEL 8.6 server, and that is a completely different setup. This should have been mentioned in the BZ description.

With this specific config, the issue can be reproduced:
1. install a 8.6 server in FIPS mode
2. install a 9.0 client in FIPS mode
The installation fails when the client tries to obtain a kerberos TGT with the principal provided to  ipa-client-install --principal XXX:

In krb5kdc.log on the master:
Jul 07 04:58:20 master.testrelm.test krb5kdc[6251](info): AS_REQ (2 etypes {aes256-cts-hmac-sha384-192(20), aes128-cts-hmac-sha256-128(19)}) 10.0.192.183: BAD_ENCRYPTION_TYPE: admin for krbtgt/TESTRELM.TEST, KDC has no support for encryption type

On the master:
[root@master ~]# cat /etc/krb5.conf.d/crypto-policies 
[libdefaults]
permitted_enctypes = aes256-cts-hmac-sha1-96 aes256-cts-hmac-sha384-192 aes128-cts-hmac-sha1-96 aes128-cts-hmac-sha256-128

On the client:
# cat /etc/krb5.conf.d/crypto-policies 
[libdefaults]
permitted_enctypes = aes256-cts-hmac-sha384-192 aes128-cts-hmac-sha256-128


Moving the issue to krb5 component for further analysis.

Comment 7 Julien Rische 2022-07-08 16:19:34 UTC
A FIPS-enabled RHEL9 client will fail to authenticate against any RHEL8 IPA server (FIPS or non-FIPS) because none of the encryption types supported by IPA on RHEL8 are allowed on RHEL9 in FIPS mode, which aims to comply with FIPS 140-3, a newer and more strict version of the standard (more information in bug 2039684).

Fixing this issue is not trivial, because it requires to update user passwords and to add new keys to all services and import these new keys to service keytabs.

We are planning to provide batch script to automate this process as much as possible.

Comment 19 Ding-Yi Chen 2023-01-23 07:59:27 UTC
The encrypt type aes256-cts-hmac-sha1-96 was used.

It is the default for RHEL 8 because:

1. HMAC-SHA1 is approved in CMVP
2. AES SHA-1 HMAC encryption types remain essential for interoperability with Active Directory because they are the "best" ones MIT Kerberos has in common with AD [2].


However, FIPS mode in RHEL 9 does not contain HMAC-SHA1-96

~~~
mac = AEAD HMAC-SHA2-256 HMAC-SHA2-384 HMAC-SHA2-512

group = SECP256R1 SECP384R1 SECP521R1 \
    FFDHE-2048 FFDHE-3072 FFDHE-4096 FFDHE-6144 FFDHE-8192
~~~

Also Bug 2006843 - Disable SHA-1 in FIPS policy

That's why it failed.

The workaround will be using FIPS:AD-SUPPORT because 

~~~
...
# This subpolicy is provided for enabling aes256-cts-hmac-sha1-96,
# the strongest Kerberos encryption type interoperable with Active Directory.

cipher@kerberos = AES-256-CBC+
mac@kerberos = HMAC-SHA1+
~~~




1. https://csrc.nist.gov/publications/detail/sp/800-140c/rev-1/final
2. https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-kile/b3fa11e2-a878-4734-a9e2-2d77a5a06108


Note You need to log in before you can comment on or make changes to this bug.