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

ipa-cacert-manage: add --external-ca-type #728

Closed
wants to merge 7 commits into from
Closed

ipa-cacert-manage: add --external-ca-type #728

wants to merge 7 commits into from

Conversation

HonzaCholasta
Copy link
Contributor

@HonzaCholasta HonzaCholasta commented Apr 24, 2017

server upgrade: always fix certmonger tracking request

Fix certmonger tracking requests on every run of ipa-server-upgrade rather
than only when the tracking configuration has changed and the requests have
not yet been updated.

This allows fixing broken tracking requests just by re-running
ipa-server-upgrade.

cainstance: use correct profile for lightweight CA certificates

Use Dogtag's caCACert CA certificate profile rather than the
ipaCACertRenewal virtual profile for lightweight CA certificates.

The ipaCACertRenewal virtual profile adds special handling of externally
signed CA certificates and LDAP replication of issued certificates on top
of caCACert, neither of which is relevant for lightweight CA
certificates.

Remove all of the special casing of lightweight CA certificates from
dogtag-ipa-ca-renew-agent-submit.

Make sure existing lightweight CA certmonger tracking requests are updated
on server upgrade.

renew agent: allow reusing existing certs

Add a switch which makes dogtag-ipa-ca-renew-agent-submit reuse the
existing certificate rather than request a new one from the CA while
maintaining LDAP replication of the certificate.

Make this available as a new dogtag-ipa-ca-renew-agent-reuse certmonger
CA.

This allows redoing the LDAP replication and reexecuting pre- and post-save
commands of a tracking request without reissuing the certificate.

renew agent: always export CSR on IPA CA certificate renewal

Make sure a CSR is exported for the IPA CA whenever certmonger detects that
the CA certificate is about to expire.

This is a pre-requisite for using the dogtag-ipa-ca-renew-agent-reuse CA
instead of the ipaCSRExport virtual profile to export the CSR.

renew agent: get rid of virtual profiles

Replace all uses of virtual profiles with dogtag-ipa-ca-renew-agent-reuse
and remove profile from the IPA CA certificate tracking request.

This prevents virtual profiles from making their way into CSRs and in turn
being rejected by certain CAs. This affected the IPA CA CSR with Microsoft
CS in particular.

ipa-cacert-manage: add --external-ca-type

Add the --external-ca-type, as known from ipa-server-install and
ipa-ca-install, to ipa-cacert-manage.

This allows creating IPA CA CSRs suitable for use with Microsoft CS using
ipa-cacert-manage:

ipa-cacert-manage renew --external-ca --external-ca-type=ms-cs

https://pagure.io/freeipa/issue/5799

@stlaz stlaz self-assigned this Apr 25, 2017
@ghost ghost self-assigned this May 3, 2017
@@ -282,7 +282,7 @@ class CAInstance(DogtagInstance):
tracking_reqs = (('auditSigningCert cert-pki-ca', None),
('ocspSigningCert cert-pki-ca', None),
('subsystemCert cert-pki-ca', None),
('caSigningCert cert-pki-ca', 'ipaCACertRenewal'))
('caSigningCert cert-pki-ca', None))
Copy link
Contributor

Choose a reason for hiding this comment

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

By removing the one special snowflake, you can remove the second part of each tuple (also in KRAInstance) and simplify DogtagInstance.configure_renewal() as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right.

@@ -939,7 +937,7 @@ def certificate_renewal_update(ca, ds, http):
'cert-presave-command': template % 'stop_pkicad',
'cert-postsave-command':
(template % 'renew_ca_cert "caSigningCert cert-pki-ca"'),
'template-profile': 'ipaCACertRenewal',
'template-profile': '',
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the empty string here required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the profile name needs to be removed.

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought so, OK.

Jan Cholasta added 7 commits May 9, 2017 05:56
Do not bypass the renewal master check when a non-virtual profile is used
in dogtag-ipa-ca-renew-agent-submit.

This fixes dogtag-ipa-ca-renew-agent not respecting the CA renewal master
setting for certificates tracked with a real profile. (Note that there
currently aren't any such certificates tracked by us.)

Request the RA certificate using dogtag-submit rather than
dogtag-ipa-ca-renew-agent-submit as the CA renewal master setting is not
available so early in the install process.

https://pagure.io/freeipa/issue/5799
Fix certmonger tracking requests on every run of ipa-server-upgrade rather
than only when the tracking configuration has changed and the requests have
not yet been updated.

This allows fixing broken tracking requests just by re-running
ipa-server-upgrade.

https://pagure.io/freeipa/issue/5799
Use Dogtag's `caCACert` CA certificate profile rather than the
`ipaCACertRenewal` virtual profile for lightweight CA certificates.

The `ipaCACertRenewal` virtual profile adds special handling of externally
signed CA certificates and LDAP replication of issued certificates on top
of `caCACert`, neither of which is relevant for lightweight CA
certificates.

Remove all of the special casing of lightweight CA certificates from
dogtag-ipa-ca-renew-agent-submit.

Make sure existing lightweight CA certmonger tracking requests are updated
on server upgrade.

https://pagure.io/freeipa/issue/5799
Add a switch which makes `dogtag-ipa-ca-renew-agent-submit` reuse the
existing certificate rather than request a new one from the CA while
maintaining LDAP replication of the certificate.

Make this available as a new `dogtag-ipa-ca-renew-agent-reuse` certmonger
CA.

This allows redoing the LDAP replication and reexecuting pre- and post-save
commands of a tracking request without reissuing the certificate.

https://pagure.io/freeipa/issue/5799
Make sure a CSR is exported for the IPA CA whenever certmonger detects that
the CA certificate is about to expire.

This is a pre-requisite for using the `dogtag-ipa-ca-renew-agent-reuse` CA
instead of the `ipaCSRExport` virtual profile to export the CSR.

https://pagure.io/freeipa/issue/5799
Replace all uses of virtual profiles with `dogtag-ipa-ca-renew-agent-reuse`
and remove profile from the IPA CA certificate tracking request.

This prevents virtual profiles from making their way into CSRs and in turn
being rejected by certain CAs. This affected the IPA CA CSR with Microsoft
CS in particular.

https://pagure.io/freeipa/issue/5799
Add the `--external-ca-type`, as known from `ipa-server-install` and
`ipa-ca-install`, to `ipa-cacert-manage`.

This allows creating IPA CA CSRs suitable for use with Microsoft CS using
`ipa-cacert-manage`:

```
ipa-cacert-manage renew --external-ca --external-ca-type=ms-cs
```

https://pagure.io/freeipa/issue/5799
@stlaz
Copy link
Contributor

stlaz commented May 12, 2017

LGTM

@ghost
Copy link

ghost commented May 12, 2017

Work for me.

@ghost ghost added the ack Pull Request approved, can be merged label May 12, 2017
@ghost
Copy link

ghost commented May 15, 2017

master:

  • ce9eefe renew agent: respect CA renewal master setting

  • 5abd9bb server upgrade: always fix certmonger tracking request

  • 09a49ad cainstance: use correct profile for lightweight CA certificates

  • 25aeeaf renew agent: allow reusing existing certs

  • 0bf41e8 renew agent: always export CSR on IPA CA certificate renewal

  • 21f4cbf renew agent: get rid of virtual profiles

  • b03ede8 ipa-cacert-manage: add --external-ca-type
    ipa-4-5:

  • 36fc44b renew agent: respect CA renewal master setting

  • b55dd9c server upgrade: always fix certmonger tracking request

  • 4a01114 cainstance: use correct profile for lightweight CA certificates

  • 920d56a renew agent: allow reusing existing certs

  • 25b0a9c renew agent: always export CSR on IPA CA certificate renewal

  • bb95282 renew agent: get rid of virtual profiles

  • c56d12a ipa-cacert-manage: add --external-ca-type

@ghost ghost added the pushed Pull Request has already been pushed label May 15, 2017
@ghost ghost removed their assignment May 15, 2017
@ghost ghost closed this May 15, 2017
This pull request was closed.
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 pushed Pull Request has already been pushed
Projects
None yet
2 participants