Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KRB instance: make provision to work with crypto policy without SHA-1… #6197

Closed
wants to merge 4 commits into from

Conversation

abbra
Copy link
Contributor

@abbra abbra commented Feb 25, 2022

… HMAC types

RHEL 9 system-wide crypto policies aim at eventual removal of SHA-1 use.

Due to bootstrapping process, force explicitly supported encryption
types in kdc.conf or we may end up with AES128-CTS and AES256-CTS only
in FIPS mode at bootstrap time which then fails to initialize kadmin
principals requiring use of AES256-SHA2 and AES128-SHA2.

Camellia ciphers must be filtered out in FIPS mode, we do that already
in the kerberos.ldif.

Fixes: https://pagure.io/freeipa/issue/9119

Signed-off-by: Alexander Bokovoy abokovoy@redhat.com

@abbra abbra added ipa-4-9 Mark for backport to ipa 4.9 needs review Pull Request is waiting for a review labels Feb 25, 2022
@f-trivino f-trivino self-requested a review February 25, 2022 08:13
@abbra
Copy link
Contributor Author

abbra commented Feb 25, 2022

@f-trivino and I tested this patchset on the current internal RHEL 9 compose and in general it works for base installation and use. We are collecting failure cases to classify them and see what we can fix. So far, most of problems are within test infra setup but we also depend on very new versions of OpenSSL 3.0.0 build, crypto-policies, and krb5 fixes which aren't yet merged to CentOS 9 Stream.

So this PR will need to be updated when we'll have all proper package requirements available. Some of the tests need additional setup to work in FIPS mode (like AD-related tests).

@jrisc
Copy link
Contributor

jrisc commented Feb 25, 2022

I think it would be nice to rename aes128-cts and aes256-cts encryption types to aes128-sha1/aes256-sha1. They all are aliases to aes*-cts-hmac-sha1-96, but since aes128-sha2 and aes256-sha2 encryption types are also using CTS, it may be confusing.

I am not sure if it could cause conflicts with older versions though.

@abbra
Copy link
Contributor Author

abbra commented Feb 25, 2022

Sure, I can do that. Since all of the shorter ones are aliases, they all will be accepted, so aes256-cts and aes256-sha1 are the same.

There will be no conflicts with old versions because we only generate this file once at the install file and never change it again. The master key itself is in LDAP and these references only used to choose correct cipher to decode the mkey.

… HMAC types

RHEL 9 system-wide crypto policies aim at eventual removal of SHA-1 use.

Due to bootstrapping process, force explicitly supported encryption
types in kdc.conf or we may end up with AES128-SHA1 and AES256-SHA2 only
in FIPS mode at bootstrap time which then fails to initialize kadmin
principals requiring use of AES256-SHA2 and AES128-SHA2.

Camellia ciphers must be filtered out in FIPS mode, we do that already
in the kerberos.ldif.

At this point we are not changing the master key encryption type to
AES256-SHA2 because upgrading existing deployments is complicated and
at the time when a replica configuration is deployed, we don't know what
is the encryption type of the master key of the original server as well.

Fixes: https://pagure.io/freeipa/issue/9119

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Use AD-SUPPORT subpolicy when testing trust to Active Directory in FIPS
mode. This is required in FIPS mode due to AD not supporting Kerberos
AES-bases encryption types using FIPS-compliant PBKDF2 and KDF, as
defined in RFC 8009.

Fixes: https://pagure.io/freeipa/issue/9119

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
@abbra abbra added the re-run Trigger a new run of PR-CI label Feb 28, 2022
@freeipa-pr-ci freeipa-pr-ci removed the re-run Trigger a new run of PR-CI label Feb 28, 2022
@abbra
Copy link
Contributor Author

abbra commented Mar 3, 2022

We did a test on RHEL 9 internal CI run and with some arrangement of openssl, crypto-policies, and krb5 versions we've got successful run for trust to Active Directory environment when FIPS mode is relaxed with AES encryption types using SHA-1 HMAC. @f-trivino is going to run a full test suite before giving a final ack here. Since this only affects RHEL 9, we'll add specific version pinning downstream. I will do a follow-up patch for upstream once openssl and crypto-policies updates will be in Fedora (they focus on RHEL 9 / CentOS 9 Stream changes now).

Fixes: https://pagure.io/freeipa/issue/9119

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Copy link
Contributor

@f-trivino f-trivino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, extensively tested in rhel and works for me.

@f-trivino f-trivino added ack Pull Request approved, can be merged and removed needs review Pull Request is waiting for a review labels Mar 7, 2022
@flo-renaud flo-renaud added the pushed Pull Request has already been pushed label Mar 8, 2022
@flo-renaud
Copy link
Contributor

master:

  • d38dd26 KRB instance: make provision to work with crypto policy without SHA-1 HMAC types
  • 2eee593 tests: ensure AD-SUPPORT subpolicy is active
  • 985dffe ipatests: extend AES keyset to SHA2-based ones
  • 7d25eea freeipa.spec: bump crypto-policies dependency for CentOS 9 Stream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ack Pull Request approved, can be merged ipa-4-9 Mark for backport to ipa 4.9 pushed Pull Request has already been pushed
Projects
None yet
5 participants