Skip to content

Conversation

@ZetaoZhuang
Copy link
Contributor

@ZetaoZhuang ZetaoZhuang commented Oct 15, 2025

Reason for Change:

filter mTLS connections based on SANs from client cert with the mtls client subject name from cns config. If client subject name does not match with any client cert SAN, then fall back to common name match. This is pre-requisite to isolate CNS in separate infra virtual networks.

Issue Fixed:

Requirements:

Notes:

@ZetaoZhuang ZetaoZhuang requested review from a team as code owners October 15, 2025 18:34
@ZetaoZhuang ZetaoZhuang changed the title filtering TLS connections based on the subject name from Caller filtering mTLS connections based on the subject name from Caller Oct 15, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds TLS client certificate subject name filtering functionality to the CNS service. It introduces a new configuration field AllowedClientSubjectName that allows filtering TLS connections based on the subject name from the client certificate in mutual TLS connections.

  • Added AllowedClientSubjectName configuration field to control client certificate validation
  • Implemented custom certificate verification logic using VerifyPeerCertificate callback
  • Updated tests to verify both allowed and disallowed client subject names

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
server/tls/tlscertificate_retriever.go Added AllowedClientSubjectName field to TlsSettings struct
cns/service.go Implemented verifyPeerCertificate function and integrated it into TLS configurations
cns/service/main.go Wired up the new configuration field from CNS config to TLS settings
cns/configuration/configuration.go Added AllowedClientSubjectName field to CNSConfig struct
cns/configuration/configuration_test.go Updated tests to include the new configuration field
cns/configuration/cns_config.json Added default empty value for the new configuration field
cns/service_test.go Enhanced mutual TLS tests to verify client subject name filtering

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ZetaoZhuang ZetaoZhuang requested a review from rbtr October 23, 2025 21:15
@ZetaoZhuang ZetaoZhuang requested a review from Copilot October 23, 2025 21:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ZetaoZhuang ZetaoZhuang requested a review from Copilot October 23, 2025 21:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ZetaoZhuang
Copy link
Contributor Author

/azp run Azure Container Networking PR

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ZetaoZhuang ZetaoZhuang requested a review from Copilot October 27, 2025 21:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ZetaoZhuang ZetaoZhuang requested a review from jackieluc October 30, 2025 04:37
@ZetaoZhuang ZetaoZhuang requested review from Copilot and msvik October 30, 2025 04:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ZetaoZhuang
Copy link
Contributor Author

/azp run Azure Container Networking PR

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ZetaoZhuang ZetaoZhuang added this pull request to the merge queue Nov 3, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants