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

[debops.pki] Nginx OCSP issue with DST Root CA X3 expiration, pki-realm script and ca-certificates package update #1860

Closed
alo-is opened this issue Sep 24, 2021 · 5 comments

Comments

@alo-is
Copy link
Contributor

alo-is commented Sep 24, 2021

Hi,

Following the depreciation of LE DST Root CA X3 and its removal from ca-certificates package, it looks like the pki-realm script fails to grep the CA in /etc/ca-certificates.conf folder and thus, to create the required files for the Nginx role (/etc/pki/realms/<domain>/trusted.crt, which is used for OCSP validation). This causes Nginx to fail after ca-certificates has been upgraded to it's last version.

The following line seems to cause the error :

if [ -r "${config['acme_root_ca_path']}/${config['acme_root_ca_file']}" ] && grep -q "${config['acme_root_ca_file']}" /etc/ca-certificates.conf ; then

Which has an hardcoded value to :

config["acme_root_ca_file"]="mozilla/DST_Root_CA_X3.crt"

It looks like that it should now be replaced by mozilla/ISRG_Root_X1.crt, but I don't know how to handle the full chain right now, as Nginx still complains after the update.

Related discussions :

@jptreen
Copy link

jptreen commented Sep 28, 2021

With that single edit that you suggested to debops/ansible/roles/pki/files/usr/local/lib/pki/pki-realm, my nginx will happily restart following a run of service/nginx and service/pki.

Out of interest, how is your nginx failing after the update?

@alinalexandru
Copy link
Contributor

I confirm that the fix works

@imrejonk
Copy link
Contributor

imrejonk commented Nov 2, 2021

I believe this has been fixed with #1881, feel free to re-open if you are still having issues.

@imrejonk
Copy link
Contributor

imrejonk commented Dec 6, 2021

After updating my host's PKI realm scripts using the patched debops.pki role, I had to update my PKI realms like this:

  1. Update all realm configurations: ansible -b -m shell -a 'grep -rl DST_Root_CA_X3 /etc/pki/realms | grep "config\/realm\.conf" | xargs -I{} sed -i "s/DST_Root_CA_X3/ISRG_Root_X1/g" {}' debops_all_hosts
  2. Update all acme/root.pem symlinks: ansible -b -m shell -a 'find /etc/pki/realms -wholename "*/acme/root.pem" | xargs -I{} ln -fs /usr/share/ca-certificates/mozilla/ISRG_Root_X1.crt {}' debops_all_hosts
  3. Manually update public/full.pem and public/intermediate_root.pem files that still contain the DST root. You can find those with ansible -b -m shell -a 'grep -rl "Ob8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ" /etc/pki/realms' debops_all_hosts. Remember to replace both the intermediate and root certificates in those files. I haven't been able to come up with a more clever way to do this; if you know any, please share.

@pdobrigkeit

@imrejonk
Copy link
Contributor

imrejonk commented Dec 6, 2021

You can also verify that you are not using the old cross-signed R3 CA anymore with ansible -b -m shell -a 'grep -rl "UdHkhVNcsAKX1H7GNNLOEADksd86wuoXvg==" /etc/pki/realms' debops_all_hosts. This didn't return any hits on my infrastructure, so this one should probably be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants