Implementing mTLS with Azion: Advanced Security for your Web Applications

Pedro Ribeiro
aziontech
Published in
4 min readSep 23, 2024

Mutual TLS (mTLS) is an essential technology for enhancing the security of web applications, especially in scenarios requiring mutual authentication between client and server. In this article, we explore what mTLS is and how to implement it using the Azion platform easily.

What is mTLS?

mTLS, or Mutual Transport Layer Security, is an extension of the standard TLS protocol. While traditional TLS authenticates only the server to the client, mTLS requires both parties to authenticate each other.

In mTLS:

  1. The server presents its certificate to the client.
  2. The client verifies the server’s certificate.
  3. The client presents its own certificate to the server.
  4. The server verifies the client’s certificate.
  5. Only after both verifications succeed is the secure communication established.

This provides an additional layer of security, ensuring both sides of the communication are trusted.

Benefits of mTLS

  • Strong bidirectional authentication
  • Increased security for APIs, microservices, and critical applications
  • Significant reduction in the risk of unauthorized access
  • Compliance with security requirements in regulated industries

Implementing mTLS with Azion

Azion offers a simplified way to implement mTLS without the need to modify your application. Here are the main steps:

  1. Configure trusted certificate authorities
  2. Enable mTLS on the desired domain
  3. Choose between “enforce” or “permissive” mode
  4. Configure handling rules for invalid or missing certificates
  5. Optionally, configure certificate revocation lists (CRLs)

Operation Modes

  • Enforce: Requires valid certificates for all requests.
  • Permissive: Allows requests without a certificate but captures the validation state.

mTLS Variables

Azion provides several variables related to the client certificate, which can be forwarded to your origin application:

  • Certificate fingerprint
  • Full certificate (URL encoded)
  • Subject DN and parsed information
  • Serial number
  • Validity dates
  • Verification status

Use Cases for mTLS

mTLS is particularly valuable in scenarios where security and mutual authentication are crucial. Let’s explore some common use cases:

1. Secure APIs

For APIs handling sensitive data or critical operations, mTLS offers an additional layer of security. Only clients with valid and authorized certificates can access the API, significantly reducing the risk of unauthorized access.

Example: A fintech exposing APIs to partners for financial transactions. mTLS ensures that only authorized partners can interact with these APIs.

2. Microservices

In microservice architectures, mTLS can be used to authenticate communication between services, creating a trust network within your infrastructure where each service can verify the identity of others.

Example: An e-commerce platform where the order service communicates with the payment service. mTLS ensures that only the legitimate order service can initiate payment transactions.

3. Banking Systems and Open Banking

In the financial sector, especially with the adoption of Open Banking, mTLS is essential for securing communications between different financial institutions.

Example: In Open Banking, when a bank needs to access a client’s account information from another bank, mTLS is used to authenticate both institutions, ensuring security and regulatory compliance.

4. Corporate VPN Access

For corporate VPN access, mTLS can provide an additional security layer beyond traditional user credentials.

Example: A company allowing remote access to its internal systems. In addition to username and password, employees must have a valid certificate installed on their devices to establish the VPN connection.

5. Healthcare Systems

In healthcare, where data privacy and security are critical, mTLS can ensure secure communication between different entities and systems.

Example: An electronic medical record system exchanging information with labs and hospitals. mTLS ensures that only authorized entities can access and exchange sensitive patient information.

Implementing mTLS for Your Use Case

Regardless of your specific scenario, implementing mTLS on Azion follows the same basic principles discussed earlier. The flexibility of the platform allows you to adapt the configuration to meet the specific needs of each use case.

When implementing mTLS for your specific use case, consider:

  1. Which clients/services need authenticated access?
  2. How will you manage and distribute client certificates?
  3. What revocation policies are required?
  4. How will your application use client certificate information?

Remember, Azion’s support team is always available to help you implement the best mTLS solution for your specific scenario.

Important Considerations

  • Some advanced configurations, such as CRLs, require API usage.
  • Your origin application must be prepared to receive certificate information via HTTP headers.

Conclusion

mTLS is a powerful tool to enhance the security of your web applications. With Azion’s simplified implementation, you can add this layer of protection without significant changes to your infrastructure or code.

--

--