#7726 [RFE] Easily Support DNS Alt names on HTTPS and LDAPS certificates
Closed: worksforme Opened by bryceml.

Request for enhancement

As a sysadmin , I want there to be an easy way, either when doing ipa-server-install, ipa-replica-install, or some other easy way after the fact to be able to add a dns alt name to the certificates used for ldaps and https.

This would make it easy to do maintenance on ipa-servers that have a lot of ldap resources pointing to them by being able to make a ldap.domain.com record in dns and being able to point it to any of the ipa-servers. That way when I have to do maintenance on ipa1.domain.com, I can just change the ldap.domain.com record to point to another ipa server temporarily. Most clients using sssd will just use srv records to accomplish this but many web-apps/servers don't support using srv records to find an available ldap server.

It would also be nice to be able to do the same for http so I can tell users to go to accounts.domain.com to change their password and change the a record to point to an available ipa-server. Note that this is already accomplishable with a proxy, but that requires running an extra machine.

Issue

There is not an easy way to add a dns alt-name to certificates used for https and ldaps on ipa-servers.

Steps to Reproduce

man ipa-replica-install
See that there isn't an option to add a second dns alt name to the certificate used by ldaps/https

Actual behavior

You have to do a lot of certutil/getcert commands to change the certificate after the fact.

Expected behavior

There to be a flag on ipa-replica-install, or ipa-server-install that adds dns alt names to the certificates used.

Version/Release/Distribution

ipa-server-4.5.4-10.el7.centos.4.4.x86_64
ipa-client-4.5.4-10.el7.centos.4.4.x86_64
389-ds-base-1.3.7.5-28.el7_5.x86_64
pki-ca-10.5.1-15.el7_5.noarch
krb5-server-1.15.1-19.el7.x86_64


Thanks for filing the issue. In general we are not planning any extension of ipa-replica-install/ipa-server-install options as there are too many already and we want to reduce their count instead.

Could you please explain what do you mean by

You have to do a lot of certutil/getcert commands to change the certificate after the fact.

can you demonstrate that by providing the commands?

Our typical approach to service availability is to allow clients to switch over. I guess you are talking about those LDAP applications that do not support a fail-over and want to use a single LDAP host reference. Could you please confirm this is the case?

These are the commands I had to run on a test-instance to accomplish this on an ipa-server:

ipa dnsrecord-add domain.com ldap --a-ip-address=10.1.1.1 # Fake ip
ipa host-add ldap.domain.com
ipa service-add ldap/ldap.domain.com
cd /etc/dirsrv/slapd-DOMAIN-COM/
certutil -R -k Server-Cert 0 -d ./ -a -s "CN=ipa1.domain.com,O=DOMAIN.COM" -8 \
ipa1.domain.com,ldap.domain.com -f ./pwdfile.txt -z /dev/random -o /tmp/file

ipa cert-request /tmp/file --principal='ldap/ipa1.domain.com' --certificate-out=/tmp/file2
certutil -D -n Server-Cert -n Server-Cert -d ./ -f ./pwdfile.txt
certutil -A -i /tmp/file2 -n Server-Cert -d ./ -f ./pwdfile.txt -t ",,"
systemctl stop certmonger
systemctl start certmonger
ipa dnsrecord-add domain.com ldap --a-ip-address=10.2.2.2 # Real ip
ipa dnsrecord-del domain.com ldap --a-rec='10.1.1.1' # Delete Fake
ipactl restart

Yes, I am confirming that when using something such as openvpn, or mediawiki, or dokuwiki, pfsense or something similar, they often do not support a failover. it would be nice to have an ldap record, kind of like there is ipa-ca.domain.com record for pointing certificate revocation at. http is less of an issue because you can easily use a proxy. in an ideal world, all applications that use ldap could figure out what to connect to using srv records.

At the very least it would be nice if this were documented somewhere possible to find.

OCSP and CRL do not need TLS so the name of the responding server doesn't matter. The contents are signed so the traffic does not need to be encrypted.

Whereas for TLS the name is everything.

This will remove all the certutil steps.

Make sure there is a host and it has a service entry and that the host you are requesting the cert on has write access to it:

ipa host-add ldap.domain.com
ipa service-add ldap/ldap.domain.com
ipa service-add-host --hosts ipa1.domain.com ldap/ldap.domain.com

Get a new cert with new DNS subject-alt names

ipa-getcert resubmit -d /etc/dirsrv/slapd-DOMAIN-COM -n Server-Cert -D ldap.domain.com -D ipa1.domain.com

No need to restart certmonger or IPA.

Oh, that's not bad at all then. Is there a good way to get this into documentation? I guess if this issue stays around forever and google finds it that could be good enough.

Be sure to have a very short DNS TTL on that generic ldap entry.

I'm going to go ahead and mark this as closed.

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

Metadata