Page MenuHomePhabricator

cergen should include the cert's name in SAN too
Closed, ResolvedPublic

Description

While investigating T291946 I noticed that karthoterian doesn't have its discovery name in SAN but only as Common Name instead.

msg="Error for HTTP request" err="Get https://10.2.2.13:443/osm-intl/6/23/24.png: x509: certificate is valid for kartotherian.svc.eqiad.wmnet, kartotherian.svc.codfw.wmnet, maps.wikimedia.org, not kartotherian.discovery.wmnet"

Karto's cergen entry looks like this:

kartotherian.discovery.wmnet:
  authority: puppet_ca
  expiry: null
  alt_names: [kartotherian.svc.eqiad.wmnet,kartotherian.svc.codfw.wmnet,maps.wikimedia.org]
  key:
     passwork: foo
     algorithm: ec

Checking Common Name is deprecated, I think cergen should add the cert's name to alt_names if not there already (we have a few cases where we already duplicate the .discovery.wmnet entry manually in alt_names). What do you think @Ottomata ?

Event Timeline

I have some vague feeling that there was a reason not to do this, but I can't recall why and I can't find any docs by my past self to indicate that it was (which I usually do if intentional).

I'm ok with it! But, I wonder if it is better to be explicit about this and manually add it to the list of alt_names instead of always doing it? Perhaps there is some reason to not have the CN in the SAN?

I have some vague feeling that there was a reason not to do this, but I can't recall why and I can't find any docs by my past self to indicate that it was (which I usually do if intentional).

I'm ok with it! But, I wonder if it is better to be explicit about this and manually add it to the list of alt_names instead of always doing it? Perhaps there is some reason to not have the CN in the SAN?

AFAIK there's no downside to it, and I think it is handy to not have to repeat ourselves. However I'm fine either way, so far the case I found is kartotherian, there might be others.

Change 746892 had a related patch set uploaded (by Filippo Giunchedi; author: Filippo Giunchedi):

[cergen@master] Make sure CN is included in SAN

https://gerrit.wikimedia.org/r/746892

Change 751411 had a related patch set uploaded (by Filippo Giunchedi; author: Filippo Giunchedi):

[cergen@master] tox: test on oldstable + stable python versions

https://gerrit.wikimedia.org/r/751411

Change 751411 merged by Filippo Giunchedi:

[cergen@master] tox: test on oldstable python version

https://gerrit.wikimedia.org/r/751411

Change 746892 merged by Filippo Giunchedi:

[cergen@master] Make sure CN is included in SAN

https://gerrit.wikimedia.org/r/746892

Mentioned in SAL (#wikimedia-operations) [2022-01-18T15:35:11Z] <godog> regenerate kartotherian certs via cergen - T297604

Change 754968 had a related patch set uploaded (by Filippo Giunchedi; author: Filippo Giunchedi):

[operations/puppet@production] ssl: update kartotherian cert

https://gerrit.wikimedia.org/r/754968

Change 754968 merged by Filippo Giunchedi:

[operations/puppet@production] ssl: update kartotherian cert

https://gerrit.wikimedia.org/r/754968

Mentioned in SAL (#wikimedia-operations) [2022-01-18T15:54:49Z] <godog> update kartotherian certs on maps hosts and roll-reload nginx - T297604

fgiunchedi claimed this task.

This is done, cergen 0.2.6 includes this feature