Skip to Content
Asterrr's Handbook
3 · Infrastructure security

Direct Connect Encryption

Direct Connect carries traffic unencrypted by default. IPsec VPN over public or transit VIFs and MACsec are the two ways to encrypt it.

Exam tasks: 3.3 (Direct Connect and MACsec), 5.1 (encryption in transit)

The decision: does the link need encryption, and is it a dedicated connection that supports MACsec or one that needs IPsec VPN?

AWS Direct Connect is a dedicated private network path to AWS. Private does not mean encrypted. Traffic is not encrypted by default. Add IPsec at layer 3 or MACsec at layer 2 when policy requires it.

On-premisesAWSMACsec L2transit VIFIPsec over VIFCustomer routerDirect ConnectgatewayTransit gatewayVPCsDirect Connectlocation
Two encryption choices. MACsec protects the cross-connect between your router and AWS. IPsec protects end to end, riding over Direct Connect.
10, 100, 400 Gbps
Dedicated Direct Connect speeds that support MACsec.
3
CKN/CAK pairs a MACsec connection can hold at once, for rotation.

Compare the options

IPsec VPN over Direct ConnectMACsec
OSI layer3 (network)2 (data link)
ScopeEnd to end between your gateway and the AWS VPN endpointPoint to point between your router and the AWS device at the location
WherePublic VIF to a VPN public endpoint, or private IP VPN over a transit VIFDedicated connections and LAGs. Not on hosted connections
SpeedA standard VPN tunnel tops out at 1.25 Gbps. Large bandwidth tunnels reach 5 Gbps on a transit gateway. Aggregate tunnels beyond thatLine rate encryption on 10, 100 and 400 Gbps dedicated ports
RequirementCustomer gateway device that speaks IPsecA MACsec capable router. Every Layer 2 hop must support MACsec
KeysIKE negotiatedStatic CKN and CAK, 256-bit, you generate and rotate. Up to three pairs for rotation. SAK derived and rotated automatically

Private IP VPN

Classic encryption over Direct Connect needed a public VIF and public IP addresses for the VPN endpoints. That opened the link to all public AWS services and exposed endpoints to attack.

Private IP VPN builds the IPsec tunnel over a transit VIF with private addresses. It terminates on a transit gateway and uses a Direct Connect gateway. Route limits are also higher than Direct Connect alone.

MACsec modes

ModeBehavior
must_encryptTraffic stops if MACsec cannot be established
should_encryptFalls back to unencrypted if negotiation fails. Default for a new MACsec connection

Exam signal

"Direct Connect traffic must be encrypted at layer 2 on a 10 or 100 Gbps connection": MACsec. "Encrypt site traffic across VPCs through a transit gateway without public IPs": private IP VPN over a transit VIF.

Exam trap

Direct Connect alone does not satisfy "encrypted in transit". Also, MACsec ends at the Direct Connect location edge, so it is not end-to-end encryption across other network segments.

More on keys and resilience

  • You generate a CKN/CAK pair (256-bit), associate it with the connection (AWS stores it in Secrets Manager) and configure the same pair on your router.
  • Private and transit virtual interfaces carry traffic in the clear across the cross-connect and provider network.
  • For critical workloads use two connections at two locations, with a Site-to-Site VPN as a cheaper backup path.

Exam signal

"Encrypt all traffic on a 100 Gbps dedicated Direct Connect at line rate" is MACsec. "Encrypt traffic over a 1 Gbps hosted connection" is IPsec VPN over Direct Connect (MACsec isn't available on hosted connections). "Encryption end to end from the on-premises router to the VPC" is also VPN over DX, since MACsec only covers the link it runs on.

Scenarios

Scenario
A payments processor has a 100 Gbps dedicated AWS Direct Connect connection. A regulator requires that all data crossing the link between its colocation router and AWS be encrypted, at close to full line rate, and that traffic stop rather than flow unencrypted if encryption fails. What should the network team configure?

Further reading

On this page