Skip to content

Conversation

shraddhabang
Copy link
Collaborator

Add Mutual Authentication Support for Gateway API TLS

Overview

This PR adds support for Mutual Authentication (mTLS) to the AWS Load Balancer Controller's Gateway API implementation. The changes enable configuring mTLS on ALB listeners in multiple modes, enhance HTTPS route functionality, and provide comprehensive E2E tests for these new features.

Key Changes

1. Mutual Authentication Support for L7 Gateway

  • Added support for configuring mTLS on ALB listeners through Gateway API TLS configuration

  • Implemented three mTLS modes:

    • off: Client certificates not requested (default behavior)
    • passthrough: Client certificates are requested but not verified
    • verify: Client certificates are requested and validated against a trust store (tests to be added in future PR)

2. Added Default for ALPNPolicy

  • Added ALPN policy configuration for TLS listeners with a default of None

3. HTTP Verifier Enhancements

  • Extended the HTTP verifier with options to properly test HTTPS endpoints
  • Added support for setting custom Host headers for hostname-based routing tests
  • Implemented URLOptions with InsecureSkipVerify to handle self-signed certificates in tests

4. Test Framework Improvements

  • Added VerifyListenerMutualAuthentication to validate mTLS configuration on listeners
  • Enhanced VerifyLoadBalancerListener to incorporate mutual authentication verification
  • Added MutualAuthenticationExpectation struct to enable verification of mTLS settings
  • Extended the HTTP verifier to support testing hostname-based routing

5. New End-to-End Tests

  • Added tests for secure HTTP routes using both instance and IP target types
  • Implemented dual protocol tests that verify HTTP and HTTPS listeners on the same load balancer
  • Added specific tests for mTLS in off and passthrough modes
  • Tests for verify mode will be added in a future PR once a trust store is created in the prow account

Testing

The PR includes comprehensive E2E tests that verify:

  1. Basic HTTPS functionality with instance and IP targets
  2. Combined HTTP/HTTPS listener configurations
  3. Mutual authentication in off and passthrough modes

Each test validates both the configuration application to AWS resources and the actual runtime behavior by making requests to the provisioned endpoints.

Future Work

A follow-up PR will add support for verify mode testing, which requires creating a trust store in the test AWS account.

Checklist

  • Added tests that cover your change (if possible)
  • Added/modified documentation as required (such as the README.md, or the docs directory)
  • Manually tested
  • Made sure the title of the PR is a good description that can go into the release notes

BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯

  • Backfilled missing tests for code in same general area 🎉
  • Refactored something and made the world a better place 🌟

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 7, 2025
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jul 7, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: shraddhabang, zac-nixon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [shraddhabang,zac-nixon]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@shuqz
Copy link
Collaborator

shuqz commented Jul 8, 2025

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 8, 2025
@zac-nixon
Copy link
Collaborator

/approved

@k8s-ci-robot k8s-ci-robot merged commit e8cd29a into kubernetes-sigs:main Jul 8, 2025
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants