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
install: fix CA-less PKINIT #758
Conversation
| trust_flags[i] += 'u' | ||
|
|
||
| trust_flags = ','.join(trust_flags) | ||
| return trust_flags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would be perfect for unit testing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I second that, a unittest for flag parsing/unparsing would be welcome.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please file a ticket, this is old code moved here from certstore.py, adding unit tests for it is out of the scope of this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only a few nitpicks for now.
| trust_flags[i] += 'u' | ||
|
|
||
| trust_flags = ','.join(trust_flags) | ||
| return trust_flags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I second that, a unittest for flag parsing/unparsing would be welcome.
| raise admintool.ScriptError( | ||
| "Peer's certificate issuer is not trusted (%s). " | ||
| "Please run ipa-cacert-manage install and ipa-certupdate " | ||
| "to install the CA certificate." % str(e)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer new-style string interpolation. Also the str(e) is rather redundant here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is consistent with the code in ServerCertInstall.check_chain() and the lack of refactoring is intentional.
|
External CA (rebased on current master to be able to install): and on replica: => this breaks WebUI on external CA installations. ================================= but I guess that's expected, WebUI works since the following does work as well: ================================= when run with own PKINIT certificate from |
|
@stlaz, FTFY. Also fixed wrong permissions on the CA-less KDC key file (props to @dkupka). The "preauthentication failed" with |
|
This does not happen without this patchset so the question is whether it is OK that this is happening or not. If so, we should add a check which would prevent this + probably warn our QA team because I guess this is just the way they are testing this. |
|
@stlaz, this seems to be a bug in kinit. When you have a certificate chain root CA -> intermediate CA -> KDC and want to trust the intermediate CA, but not the root CA, the validation will always fail. This is the case in external CA setup (the external CA is the root CA, IPA CA is the intermediate CA), but I haven't confirmed it without IPA yet. Without this patchset, both the CA certificates are trusted, which is a bug, but makes kinit work. |
|
Fixed kdc.conf upgrade. |
|
Upgrade from 4.4 to 4.5 during external-CA installation prints error messages, related log: but as you can see, CA is enabled and running. |
|
Did not realize this was unrelated to your patches. Please rebase. |
Add named constants for common trust flag combinations. Use the named constants instead of trust flags strings in the code. https://pagure.io/freeipa/issue/6831
Make the trust flags argument mandatory in all functions in `certdb` and `certs`. https://pagure.io/freeipa/issue/6831
Replace trust flag strings with `TrustFlags` objects. The `TrustFlags` class encapsulates `certstore` key policy and has an additional flag indicating the presence of a private key. https://pagure.io/freeipa/issue/6831
Trust IPA CA to issue PKINIT KDC and client authentication certificates in the IPA certificate store. https://pagure.io/freeipa/issue/6831
Set `pkinit_anchors` in `krb5.conf` to a CA certificate bundle of CAs trusted to issue KDC certificates rather than `/etc/ipa/ca.crt`. Set `pkinit_pool` in `krb5.conf` to a CA certificate bundle of all CAs known to IPA. Make sure both bundles are exported in all installation code paths. https://pagure.io/freeipa/issue/6831
Introduce new IPAKrb5 lens to handle krb5.conf and kdc.conf changes using Augeas. The stock Krb5 lens does not work on our krb5.conf and kdc.conf. https://pagure.io/freeipa/issue/6831
Set `pkinit_pool` in `kdc.conf` to a CA certificate bundle of all CAs known to IPA. Make sure `cacert.pem` is exported in all installation code paths. Use the KDC certificate itself as a PKINIT anchor in `login_password`. https://pagure.io/freeipa/issue/6831
Make sure the exported private key files are readable only by the owner. https://pagure.io/freeipa/issue/6831
This fixes `kdc.crt` containing the full chain rather than just the KDC certificate in CA-less server install. https://pagure.io/freeipa/issue/6831 https://pagure.io/freeipa/issue/6869
Verify that the provided certificate has the extended key usage and subject alternative name required for KDC. https://pagure.io/freeipa/issue/6831 https://pagure.io/freeipa/issue/6869
When --pkinit-cert-file is used, make sure the certificate and key is actually passed to `KrbInstance`. https://pagure.io/freeipa/issue/6831
Allow installing 3rd party CA certificates trusted to issue PKINIT KDC and/or client certificates. https://pagure.io/freeipa/issue/6831
Allow replacing the KDC certificate. https://pagure.io/freeipa/issue/6831
|
master:
|
certdb: add named trust flag constants
Add named constants for common trust flag combinations.
Use the named constants instead of trust flags strings in the code.
certdb, certs: make trust flags argument mandatory
Make the trust flags argument mandatory in all functions in
certdbandcerts.certdb: use custom object for trust flags
Replace trust flag strings with
TrustFlagsobjects. TheTrustFlagsclass encapsulates
certstorekey policy and has an additional flagindicating the presence of a private key.
install: trust IPA CA for PKINIT
Trust IPA CA to issue PKINIT KDC and client authentication certificates in
the IPA certificate store.
client install: fix client PKINIT configuration
Set
pkinit_anchorsinkrb5.confto a CA certificate bundle of CAstrusted to issue KDC certificates rather than
/etc/ipa/ca.crt.Set
pkinit_poolinkrb5.confto a CA certificate bundle of all CAsknown to IPA.
Make sure both bundles are exported in all installation code paths.
server install: fix KDC PKINIT configuration
Make sure
cacert.pemcontains only certificates of CAs trusted to issuePKINIT client certificates and is exported in all installation code paths.
Set
pkinit_poolinkdc.confto a CA certificate bundle of all CAs knownto IPA.
Use the KDC certificate itself as a PKINIT anchor in
login_password.certs: do not export CA certs in install_pem_from_p12
This fixes
kdc.crtcontaining the full chain rather than just the KDCcertificate in CA-less server install.
server install: fix KDC certificate validation in CA-less
Verify that the provided certificate has the extended key usage and subject
alternative name required for KDC.
cacert manage: support PKINIT
Allow installing 3rd party CA certificates trusted to issue PKINIT KDC
and/or client certificates.
server certinstall: support PKINIT
Allow replacing the KDC certificate.
https://pagure.io/freeipa/issue/6831
https://pagure.io/freeipa/issue/6869