Back to Blog

HTTPS and SSL: Automate Your Certificate Management with ACME

  • Security
  • July 5, 2024
Share this post
HTTPS and SSL: Automate Your Certificate Management with ACME

In our increasingly digital world, the importance of secure online communication cannot be overstated.  SSL/TLS certificates are digital certificates that play a crucial role.  They enable systems to authenticate identities and establish encrypted connections https with other systems.  Acting as digital passports, they provide encryption between the browser and the website, verify and assure the website’s identity, and safeguard our online presence. As a result, SSL/TLS certificates allow privacy and authentication on the Internet.

However, the traditional process and method of obtaining and managing these SSL/TLS certificates can be complex and time-consuming.  It involves a lot of manual and often difficult processes that involve numerous steps, from generating CSR (Certificate Signing Request) to manually installing the certificate on a web server.  This can lead to increased costs, longer deployment times and a higher risk of errors.

With the RFC 8555 ACME standard (Automatic Certificate Management Environment), the protocol acts as a digital bridge between certificate authorities and your server.  It is designed to automate the process of certificate issuance, validation, revocation, and renewal.  Therefore, ACME is making it easier and more efficient for organizations to deploy and maintain a large number of SSL/TLS security certificates.

In this blog post, we’ll dive deeper into ACME RFC 8555 standards, exploring how it has streamlined and automated the process of certificate issuance and revocation.  We’ll discuss the advantages and security aspects to consider.  Finally, we’ll guide you on how to deploy ACME for your website’s digital certificates.

What is RFC 8555 ACME?

 

RFC 855 defines the Automatic Certificate Management Environment (ACME) standard and protocol.  It primarily aims to enable the secure and scalable issuance of digital certificates, which are essentials for establishing secure https communications and connections over the Internet.  ACME addresses the challenges of the traditional installation and maintaining digital certificates by automating the process.

Key Features of RFC 8555 ACME

 

  • Automated Communication.  ACME utilizes a RESTful API for communication between the server and CA (Certificate Authority).  This allows tools like certbot to automate the entire lifecycle of certificates, from issuance and renewal to revocation.  The automation reduces manual effort required and minimizes the risk of errors associated with manual certificate management.
  • Domain Validation. ACME relies on challenges to verify domain ownership instead of manual checks through various validation methods such as DNS and HTTP Challenge.  Automated domain validation eliminates manual steps like email and document uploads, saving time and reducing errors.  It also scales well for large developments where manual verification becomes cumbersome.
    1. DNS Challenge. The client proves control over a domain by provisioning a DNS TXT record with specific value under the domain.  ACME server verifies control by querying the DNS system for the TXT record, and checking the presence of the expected value.
    2. HTTP Challenge. The client proves control over a domain by provisioning a specific HTTP resource on a web server that is accessible via HTTP. The ACME server verifies control by sending an HTTP GET request to the specified URL and checking the presence of the expected value.
  • Automated Certificate Issuance.  As part of this process, the agent generates a CSR and a public key, signs them both with the server’s private key, and sends them to the issuing CA.  The CA verifies both signatures, and sends the certificate over to the agent, which proceeds to install it on the server.
  • Automated Certificate Revocation. The agent generates a revocation request for the digital certificate and sings the request with its private key.  The CA verifies the signature to ensure the request is authorized, then revokes the certificate.  The certificate’s revocation status is published to Certificate Revocation Lists (CRLs) and Online Certificate Status Protocol (OCSP) responders.
  • Automated Certificate Renewal.  Renewals work in a similar way to the initial certificate issuance.  This automation helps to ensure that certificates are renewed in a timely manner, reducing the risk of website downtime.
  • Scalability.   ACME protocol automates the entire process of digital certificates, and can handle certificates in bulk.  This means that large numbers of multiple types of certificates can be implemented in a short time.

 

By automating tasks, ACME frees up administrator time and reduces the risk of errors.

RFC 8555 ACME Security Considerations

 

While ACME offers significant advantages in automating digital certificate SSL/TLS management, there are some potential security considerations.

  • API Security. The ACME protocol utilizes a RESTful API. Therefore, it’s important to ensure the server implementing ACME is secure and not vulnerable to potential API attacks.
  • Integrity of Authorizations. It is crucial for maintaining the integrity of the certificate issuance process. This allows and ensures that only the rightful owner of a domain can get a digital certificate for it.
  • Denial-of-Service (DoS) Considerations. ACME includes measures to mitigate attacks. However, DoS attacks can overwhelm a system with traffic, causing it to become unavailable.
  • Server-Side Request Forgery (SSRF). Measures are provided to prevent SSRF type attacks, but such attacks can cause the server to make requests that it shouldn’t.

 

Best Practices for Secure ACME Usage

 

By following best practices, you can leverage the automation benefits of ACME while maintaining a secure environment for your SSL/TLS digital certificates.

  • Strong Credentials. A strong password and enabling two-factor authentication (2FA) for your ACME account is a must. This significantly reduces the risk of unauthorized access and malicious certificate issuance.
  • DNS Challenges and HTTP Challenges. Secure your DNS zone with strong access controls. This prevents hackers from modifying records, redirecting traffic, or stealing validation tokens. Likewise, your web server needs to lock down the directory where challenge files are placed. This safeguards any sensitive information they might contain.
  • Cautious Renewal Automation. Configuration for proper validation checks to prevent accidental issuance of unwanted digital certificates.
  • Log Monitoring. Regularly review logs associated with ACME transactions to identify any suspicious activity.

 

Implementation ACME Digital Certificate

 

ACME (Automatic Certificate Management Environment) streamlined the digital certificate management.  Certbot is a popular ACME client that simplifies the process. It provides multiple methods for domain validation, certificate retrieval and automatic configuration server such as Apache or Nginx. Likewise, we’ll install on Ubuntu 22.04 server with domain your-domain as an example. In this guide, we’ll demonstrate how to implement Certbot with Let’s Encrypt for an ACME SSL certificate. Let’s Encrypt is an SSL certificate authority managed by the Internet Security Research Group (ISRG).

There are many ways to deploy and implement ACME protocol. We’ll be using the Snap package to deploy Certbot. It provides an easy way to ensure that you have the latest version of Certbot. Any firewall configured on your server needs to allow connection for ssh, http and https.

Step 1: SSH into the server Install snapd

Log into your HTTP website’s server using SSH with your sudo permissions. With Ubuntu 22.04, Snap packages are natively supported. But you need to ensure that your snap core is up-to-date.

$ sudo snap install core; sudo snap refresh core

Remove any older version certbot.

$ sudo apt remove certbot

Install Certbot

$ sudo snap install --classic certbot

Step 2: Prepare and Run the Certbot

$ sudo ln -s /snap/bin/certbot /usr/bin/certbot

Step 3: Request Your Certificates Using Certbot

Request a certificate and automatically configure it on NGINX (Recommended)

$ sudo certbot --nginx

During the installation process, Certbot will prompt you for some basic information including email address, accept terms of service, optionally subscribe to mailing list, enter domain name.

www.your-domain.com your-domain.com

Request a certificate without configuring NGINX. Using a “standalone” web server, the plugin needs to bind to port 80 in order to perform domain validation. Certbot will attempt to bind to the port for all interfaces using IPv6 then port using IPv4. Use —address to explicitly tell Certbot which protocol to bind.

$sudo certbot certonly --nginx

Step 4: Test Automatic Renewal

The Certbot packages on your system come with a cron job or systemd timer that will renew your certificates automatically before they expire.

$ sudo certbot renew --dry-run

Renew Certbot is installed in one of the following locations:

$ /etc/crontab/
$ /etc/cron.*/*
$ systemctl list-timers

Delete a certificate using Certbot.

$ sudo certbot revoke --
cert-path /etc/letsencrypt/live/www.your-domain.com/fullchain.pem

Step 5: Confirm that Certbot Worked
To confirm that your website is set up properly, and look for the lock icon in the URL bar – meaning secure and encrypted connection.

https://your-domain.com

RFC 8555 ACME is a pivotal protocol. It automates the management of digital certificates, enabling secure and encrypted connections between browsers and websites. This is particularly important for all the large-scale deployment of https, which requires the server to have valid certificates. Furthermore, its automation reduces the complexity and potential for human error in the certificate process. In conclusion, RFC 8555 ACME represents a significant advancement of Internet security. It is facilitating the widespread use of secure protocols like https to contribute to a safer and more secure Internet.

Sources:

https://datatracker.ietf.org/doc/rfc8555/
https://letsencrypt.org/
https://eff-certbot.readthedocs.io/en/latest/install.html