Get an A on ssllabs.com with VMware Avi / NSX ALB (and keep it that way with SemVer!)
Tags: avi, loadbalancing, nsxalb, tls
Published: 2021-10-03 15:59:51

---
title: Get an A on ssllabs.com with VMware Avi / NSX ALB (and keep it that way with SemVer!)
published: true
date: 2021-09-19 22:06:00 UTC
tags: Avi,LoadBalancing,NSXALB,TLS
canonical_url: 
---

 **Cryptographic security is an important aspect of hosting any business-critical service.**

When hosting a public service secured by TLS, it is important to strike a balance between **compatibility**  (The **Availability** aspect of CIA), and strong cryptography (the **Integrity**  or **Authentication**  and **Confidentiality**  aspects of CIA). To illustrate, let's look at the CIA model:

In this case, we need to balance backward compatibility with using good quality cryptography -  here's a brief and probably soon-to-be-dated overview of what we ought to use and why.

### Protocols

This block is fairly easy, as older protocols are worse, right? 

  

#### TLS 1.3

As a protocol, TLS 1.3 has quite a few great improvements and is fundamentally simpler to manage with fewer knobs and dials. **There is a major concern**  with TLS 1.3 currently - security tooling in the large enterprise hasn't caught up with this protocol yet as new ciphers like **ChaCha20**  don't have hardware-assisted lanes for decryption. Here are some of the new capabilities you'll like::

- **Simplified Crypto sets:**  TLS 1.3 deprecates a ton of less-than-secure crypto - TLS 1.2 supports up to **356** cipher suites, **37 of which are new with TLS 1.2**. This is a mess - TLS 1.3 supports **five**.

  - Note: The designers for TLS 1.3 achieved this by removing forward secrecy methods from the cipher suite, and they must be separately selected.
- **Simplified handshake:** TLS 1.3 connections require fewer round-trips, and session resumption features allow a 0-RTT handshake.
- **AEAD Support:** AEAD ciphers both support integrity and confidentiality. **AES Galois Counter Mode (GCM)** and Google's **ChaCha20**  serve this purpose.
- **Forward Secrecy:**  If a cipher suite doesn't have PFS (I disagree with **perfect** ) support, it means that a user can capture your network traffic and replay it to decrypt if the private keys are acquired. PFS support is **mandatory** in TLS 1.2

  

Here are some of the things you can do to mitigate the risk if you're in a large enterprise that performs decryption:

- Use a load balancer - since this is about a load balancer, you can protect your customer's traffic in transit by performing **SSL/TLS bridging.**  Set the LB-to-Server ( **serverssl** ) profile to a high-efficiency cipher suite ( **TLS 1.2 + AES-CBC** ) to maintain confidentiality while still protecting privacy.

#### TLS 1.2

TLS 1.2 is like the Toyota Corolla of TLS, it's run for forever and not everyone maintains it properly.

  

It can still perform well if properly configured and maintained - we'll go into more detail on how in the next section. The practices outlined here are good for all editions of TLS.

  

**Generally, TLS 1.0 and 1.1 should not be used.** Two OS providers (Windows XP, Android 4, and below) were disturbingly slow to adopt TLS 1.2, so if this is part of your customer base, beware.

  

### Ciphers

This information is much more likely to be dated. I'll try to keep this short:

  

#### Confidentiality

- **(AEAD)** AES-GCM: This is usually my all-around cipher. It's decently fast and supports **partial acceleration** with hardware ADCs / CPUs. AES is generally pretty fast, so it's a good balance of performance and confidentiality. I don't personally think it's worth running anything but 256-bit on modern hardware.
- **(AEAD)** [ChaCha20](https://datatracker.ietf.org/doc/html/rfc7539): This was developed by Google, and is still "being proven". Generally trusted by the public, this novel cipher suite is fast despite a lack of hardware acceleration.
- AES-CBC: This has been the "advanced" cipher for confidentiality before AES-GCM. Developed in 1993, this crypto is highly performant and motivated users to move from suites like DES and RC4 by being both more performant and stronger. Like with AES-GCM, I prefer not to use anything but 256-bit on modern hardware
- Everything else: This is the "don't bother" bucket: RC4, DES, 3DES

#### Integrity

Generally, AEAD provides an advantage here - SHA3 isn't generally available yet but SHA2 variants should be the only thing used. The more bits the better!

#### Forward Secrecy

- ECDHE (Elliptic Curve Diffie Hellman): This should be mandatory with TLS 1.2 unless you have customers with old Android phones and Windows XP.
- TLS 1.3 lets you select multiple PFS algorithms that are EC-based.

### Matters of Practice

Before we move into the Avi-specific configuration, I have a recommendation that is true for all platforms:

**[Semantic Versioning](https://semver.org/)**

Cryptography practices change over time - and some of these changes break compatibility. Semantic versioning provides the capability to support three scales of change:

- **Major Changes:** First number in a version. Since the specification is focused on APIs, I'll be more clear here. This is what you'd iterate if you are removing cipher suites or negotiation parameters that might break existing clients
- **Minor Changes:** This category would be for tuning and adding support for something new that **won't break compatibility**. Examples here would be **cipher order preference**  changes or adding new ciphers.
- **Patch Changes:** This won't be used much in this case - here's where we'd document a change that matches the **Minor Change**'s intent, like mistakes on cipher order preference.

### Let's do it!

Let's move into an example leveraging NSX ALB (Avi Vantage). Here, I'll be creating a "first version," but the practices are the same. First, navigate to **Templates -> Security -> SSL/TLS Profile** :

[![](https://lh3.googleusercontent.com/-ytlTSCFz3RM/YUex6k8yq_I/AAAAAAAABiA/bKh1xgSyxtwJ1AGKeBhylJva1orK_YpAACLcBGAsYHQ/w640-h435/image.png)](https://lh3.googleusercontent.com/-ytlTSCFz3RM/YUex6k8yq_I/AAAAAAAABiA/bKh1xgSyxtwJ1AGKeBhylJva1orK_YpAACLcBGAsYHQ/image.png)
  
  

[![](https://lh3.googleusercontent.com/-R1oUgKyQGNI/YUetE5WUReI/AAAAAAAABhg/HS9oS3mTt0AVWguY11KEUr7fFBWme_ItgCLcBGAsYHQ/w1055-h531/image.png)](https://lh3.googleusercontent.com/-R1oUgKyQGNI/YUetE5WUReI/AAAAAAAABhg/HS9oS3mTt0AVWguY11KEUr7fFBWme_ItgCLcBGAsYHQ/image.png)
Note: I really like this about Avi Vantage, even if I'm not using it here. The security scores here are accurate, albeit capped out - VMware is probably doing this to encourage use of AEAD ciphers:

[![](https://lh3.googleusercontent.com/-fYdknMmUKj4/YUetnwLKIbI/AAAAAAAABho/XfhCZpIGnR0M1_CSISDA616smPqknDf4wCLcBGAsYHQ/w1054-h333/image.png)](https://lh3.googleusercontent.com/-fYdknMmUKj4/YUetnwLKIbI/AAAAAAAABho/XfhCZpIGnR0M1_CSISDA616smPqknDf4wCLcBGAsYHQ/image.png)
...but, I'm somewhat old-school. I like using Apache-style cipher strings because they can apply to anything, and everything will run TLS eventually. Here are the cipher strings I'm using - the first is TLS 1.2, the second is TLS 1.3.  

ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384

TLS\_AES\_256\_GCM\_SHA384:TLS\_CHACHA20\_POLY1305\_SHA256

[![](https://lh3.googleusercontent.com/-LWkdZyUxFwA/YUe3vUY1jhI/AAAAAAAABiQ/DZ3RkPjEmqA6iG7AfleTxAdUHm52NF7LgCLcBGAsYHQ/w897-h193/image.png)](https://lh3.googleusercontent.com/-LWkdZyUxFwA/YUe3vUY1jhI/AAAAAAAABiQ/DZ3RkPjEmqA6iG7AfleTxAdUHm52NF7LgCLcBGAsYHQ/image.png)
  
  

One gripe I have here is that Avi won't add the "What If" analysis like F5's TM-OS does (14+ only).  Conversely, applying this profile is much easier. To do this, open the virtual service, and navigate to the bottom right:  

[![](https://lh3.googleusercontent.com/-L4cCPMKXZSA/YUeyq7YTn_I/AAAAAAAABiI/G8CnnrqT6fMNUGI2p_Dinr0ukuVs0cYRwCLcBGAsYHQ/w793-h274/image.png)](https://lh3.googleusercontent.com/-L4cCPMKXZSA/YUeyq7YTn_I/AAAAAAAABiI/G8CnnrqT6fMNUGI2p_Dinr0ukuVs0cYRwCLcBGAsYHQ/image.png)
  
That's it! Later on, we'll provide examples of coverage reporting for these profiles. In a production-like deployment, these services should be managed with release strategies given that versioning is applied.