#9271 Support PKINIT with ipa-client-install
Closed: fixed by frenaud. Opened by cheimes.

Request for enhancement

As an admin, I want to use PKINIT with ipa-client-install so that I can enroll clients with X.509 client certificates. The feature would allow me to register clients with existing host identities like Red Hat subscription manager certificates or other provisioned cert/key pairs.

ipa-client-install requires credentials to authenticate host enrollment. Currently the command supports three ways to authenticate:

  • kinit with principal name + password of a privileged user account
  • kinit with an existing KRB5 keytab
  • OTP enrollment with a one time password

I like to request a forth option that uses PKINIT to acquire a TGT for the host principal. Internally the option would run kinit with cert, key, and trust anchor options like this:

kinit \
    -X X509_user_identity=FILE:/path/to/cert.pem,/path/to/key.pem \
    -X X509_anchors=FILE:/path/to/ipa/ca.crt \
    -X X509_anchors=FILE:/path/to/additional-pem-bundle.pem \
    ...
    host/{hostname}

or provide these options in temp krb5.conf

[realms]
  MY.REALM = {
    pkinit_identities = FILE:/path/to/cert.pem,/path/to/key.pem
    pkinit_anchors = FILE:/path/to/ipa/ca.crt
    pkinit_anchors = FILE:/path/to/additional-pem-bundle.pem
}

The feature is going to need up to three new arguments:

  • --pkinit-identity raw argument for pkinit_identities / X509_user_identity

or

  • --pkinit-cert path to a PEM file containing the certificate
  • --pkinit-key path to a PEM file containing the private key of the certificate

and

  • --pkinit-anchors path to a PEM bundle with trust anchors (has to support multiple bundles, either multiple arguments or a single argument with : as path separator). The certs from --ca-cert-file should be used as anchors, too.

--pkinit-identity option may be preferable. MIT KRB5 also supports PKCS12 files and PKCS11 (smartcard / HSM / TPM) options.

NOTES

  • pkinit_anchors / X509_anchors can be repeated multiple times
  • settings in [libdefaults] are ignored if a realm-specific setting has an option.
  • kinit options takes precedence over krb5.conf options
  • during testing I noticed that clients and KDC must have access to the full cert chain of the client cert as well as the full cert chain of the KDC server cert.
  • PKINIT also needs a certmap rule that maps the host certificate to a host entry.

References

  • https://web.mit.edu/kerberos/krb5-1.19/doc/admin/pkinit.html
  • https://web.mit.edu/kerberos/krb5-1.19/doc/user/user_commands/kinit.html
  • https://web.mit.edu/kerberos/krb5-1.19/doc/admin/conf_files/krb5_conf.html#pkinit-options

Metadata Update from @cheimes:
- Custom field rhbz adjusted to 2075452

https://github.com/freeipa/freeipa/compare/master...tiran:freeipa:issue9271-pkinit-install is a rough prototype of the feature. It is missing tests and docs update.

Metadata Update from @cheimes:
- Custom field on_review adjusted to https://github.com/freeipa/freeipa/pull/6543

Upstream PR 6543 implements the feature + design document as:

$ ipa-client-install \
    --pkinit-identity=FILE:/path/to/cert.pem,/path/to/key.pem \
    --pkinit-anchor=FILE:/path/to/kdc-ca-bundle.pem

I have some very experimental code that uses the host certificate from Red Hat subscription manager to automate self-enrollment of hosts. TPM 2.0 device identity (IDevID/IAK certificates) attestation may be another use case for the feature.

Metadata Update from @cheimes:
- Issue assigned to cheimes
- Issue set to the milestone: FreeIPA 4.9

master:

  • dbebed2e3a8d3d27e7344bec0d829364891bb00b Add PKINIT support to ipa-client-install

ipa-4-10:

  • 9d902d340793d01aa6b65d01a1facaf480819526 Add PKINIT support to ipa-client-install

ipa-4-9:

  • 80da53eaada1b5ad61b8cff2f9ed1217fea600c9 Add PKINIT support to ipa-client-install

Metadata Update from @frenaud:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

Metadata Update from @frenaud:
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=2075452 (was: 2075452)

Issue linked to bug 2075452

Metadata Update from @frenaud:
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=2143224 (was: https://bugzilla.redhat.com/show_bug.cgi?id=2075452)

Issue linked to bug 2143224

Metadata Update from @frenaud:
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=2143224, https://bugzilla.redhat.com/show_bug.cgi?id=2075452 (was: https://bugzilla.redhat.com/show_bug.cgi?id=2143224)

Metadata