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

Automate ssl certificate generation using certbot on HAProxy for wildcard certs #5

Closed
igobranco opened this issue Nov 30, 2023 · 9 comments
Assignees

Comments

@igobranco
Copy link
Member

igobranco commented Nov 30, 2023

Previous work:
We already have a PROC for SSL certificate generation using Let's Encrypt.

Motivation:
Currently we are using on nau.edu.pt certificates issued by Sectigo, from the RCTSaai community.
But it was decided from the major players, like Google that manages Chrome and the major Certificate entities, to reduce the max time of certificates ssl validation to 90 days.

We need to automate the SSl certificate generation using CertBot, because the Sectigo Certificate authority supports ACME protocol.


We already have been done a POC prof of concept to use the lets encrypt certificates.
This was implemented directly on HAProxy.

On the move to Kubernetes we should the cert-manager, but instead of using the Lets Encrypt servers, we should use the Sectigo servers.

https://share.fccn.pt/sites/rctscertificados/ACME/acme_internal_fccn/#page-toc-10
https://forms.office.com/pages/responsepage.aspx?id=0aBHeQvToEyYmDfUhhxlnO_mc0SdF0JIt4x7BHMOCmJUNFFWMVFHTVpFMFlWR0RaWTVSVkdGM0RNTS4u
https://share.fccn.pt/sites/rctscertificados/ManualUtilizador/#page-toc-3
During the internal FCCN event "Cartas na Mesa" the Emanuel Massano told me that Felipe Santana from ASR already have done that.

I've talked with Filipe Santana from ASR department, he has told that he is emitting the certificates directy using Traefik and not using cert-manager.

@igobranco igobranco self-assigned this Nov 30, 2023
@igobranco
Copy link
Member Author

Alternativelly we could use Caddy web server with a shared storage, for example using Redis.

@igobranco
Copy link
Member Author

@igobranco
Copy link
Member Author

The Kubernetes ingress for DEV environment was configured to use cert manager.

We still need to issue an wildcard certificate on HAProxy when any service is down.
https://www.haproxy.com/blog/haproxy-and-let-s-encrypt

@igobranco
Copy link
Member Author

We just need to do this on HAProxy for wildcard certificates, when the backends are down.

@igobranco igobranco changed the title Automate ssl certificate generation using certbot Automate ssl certificate generation using certbot on HAProxy for wildcard certs Jul 1, 2024
igobranco added a commit that referenced this issue Jul 31, 2024
Automate ssl certificate generation using ACME/certbot on HAProxy for wildcard certs.

#5
@igobranco
Copy link
Member Author

Implemented.
Need to configure a Jenkins job or in future run it inside K8s on a dedicated pod.

To clean old certificate files, we need to run manually the follow script:

cd /nau/ops/nau-balancer
find /nau/ops/nau-balancer/certs/ -type f -mtime +15 -exec rm {} \;

@igobranco
Copy link
Member Author

In future we need to execute the acme playbook regularly.

@igobranco
Copy link
Member Author

Configured Jenkins jobs.
When run for DEV environment, it has issued certificates. On July we were on middle of migration to Kubernetes, so didn't run this playbook for DEV.

@igobranco
Copy link
Member Author

Done!

@igobranco
Copy link
Member Author

Jobs running on Jenkins!

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

1 participant