Skip to content

[action] [PR:175] Changing the wildcard matching logic for client cert common names#179

Merged
mssonicbld merged 1 commit intosonic-net:202511from
mssonicbld:cherry/202511/175
Jan 16, 2026
Merged

[action] [PR:175] Changing the wildcard matching logic for client cert common names#179
mssonicbld merged 1 commit intosonic-net:202511from
mssonicbld:cherry/202511/175

Conversation

@mssonicbld
Copy link

Microsoft ADO ID: 36341347

PR #168 added support for wildcard matching between client cert CNs and trusted CNs. This PR changes the wildcard matching logic based on a discussion with @qiluo-msft and @prsunny.

Changes:

  1. Wildcard patterns starting with * but not *. (e.g., *example.sonic) are no longer valid. These patterns are skipped during the matching.
  2. *. is not a valid trusted CN and will be skipped if present.
  3. * must match one or more characters. For example, *.example.sonic will not match .example.sonic.

Note 1: Comparison is always case sensitive, but * can match both upper and lower case characters. For example, *.example.sonic matches TEST.example.sonic, but it does not match TEST.EXAMPLE.SONIC.

Note 2: Multi-level subdomain matching is allowed for wildcard patterns. For example, *.example.sonic matches test.example.sonic, sub.test.example.sonic, one.sub.test.example.sonic, and so on.

Microsoft ADO ID: 36341347

PR sonic-net#168 added support for wildcard matching between client cert CNs and trusted CNs. This PR changes the wildcard matching logic based on a discussion with @qiluo-msft and @prsunny.

Changes:
1. Wildcard patterns starting with `*` but not `*.` (e.g., `*example.sonic`) are no longer valid. These patterns are skipped during the matching.
2. `*.` is not a valid trusted CN and will be skipped if present.
3. `*` must match one or more characters. For example, `*.example.sonic` will not match `.example.sonic`.

**Note 1:** Comparison is always case sensitive, but `*` can match both upper and lower case characters. For example, `*.example.sonic` matches `TEST.example.sonic`, but it does not match `TEST.EXAMPLE.SONIC`.

**Note 2:** Multi-level subdomain matching is allowed for wildcard patterns. For example, `*.example.sonic` matches `test.example.sonic`, `sub.test.example.sonic`, `one.sub.test.example.sonic`, and so on.
@mssonicbld
Copy link
Author

Original PR: #175

@mssonicbld
Copy link
Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld mssonicbld merged commit c80e7a8 into sonic-net:202511 Jan 16, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant