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

Feature: ACME Certificate Signer #72

Merged

Conversation

davidjwbbc
Copy link
Contributor

This adds a new CertificateSigner class, ACMECertificateSigner, to the M1 client API python module. This class allows the python M1 client app to designate an ACME certificate signing service to use when signing certificates for ContentHostingConfigurations using domainNameAlias entries.

This class requires access to the private keys directory (it needs to regenerate the CSR and so needs to sign the new CSR), the default virtual host docroot (for when HTTP to the domainNameAlias is not setup and an ACME challenge is needed) and the domain docroots directory for the AS (to provide the acme challenge authentication for the domain name). These three directories are configured using the keyword parameters to the class instance initialisation.

The class also requires the URL of an ACME directory service.

There are two factory functions, LetsEncryptCertificateSigner and TestLetsEncryptCertificateSigner, which both only take the 3 directories noted above and automatically set the URL of the directory service to point to the Let's Encrypt live service and the Let's Encrypt Staging service respectively.

In a simple setup, this means that the M1 client app must run on the same host as both the AF & AS. It would be possible to run the M1 client on a different host as long as there are network shared directories accessible for the three directories given above.

For the m1-session and msaf-configuration tools the new class (or factory functions) can be configured using:

sudo m1-session configure set certificate_signing_class 'rt_m1_client.certificates.LetsEncryptCertificateSigner(default_docroot_dir=<default-host-docroot>,docroots_dir=<domain-docroots-directory>,private_keys_dir=<AF-privtate-keys-storage-directory>)'

So for the default settings this would be:

sudo m1-session configure set certificate_signing_class 'rt_m1_client.certificates.LetsEncryptCertificateSigner(default_docroot_dir=/usr/share/nginx/html,docroots_dir=/var/cache/rt-5gms/as/docroots,private_keys_dir=/usr/local/var/local/cache/rt-5gms/af/certificates/private)'

Note: This will not use Let's Encrypt for ContentHostingConfiguration distributionConfigurations which do not use domainNameAlias - a new Lets's Encrypt Certificate Manager script will be needed to handle that configuration.

@davidjwbbc davidjwbbc added the enhancement New feature or request label May 5, 2023
@davidjwbbc davidjwbbc requested a review from rjb1000 May 5, 2023 10:41
@davidjwbbc davidjwbbc self-assigned this May 5, 2023
Copy link
Contributor

@jordijoangimenez jordijoangimenez left a comment

Choose a reason for hiding this comment

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

@davidjwbbc
I cannot spot anything incorrent given this is up and running. I also think you offloaded code to other classes which is good.

So, I think I can just congratulate you for the efforts.

@davidjwbbc davidjwbbc merged commit 3d1cc14 into 5G-MAG:development May 26, 2023
@davidjwbbc davidjwbbc deleted the feature/acme-certificate-signer branch July 3, 2023 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants