Skip to content

Cherry-pick: [gnmi_server]: Run access checks before native Set bypass writes (#791) - #239

Merged
Anish Narsian (anish-n) merged 2 commits into
Azure:202511_azdfrom
alawing:202511_azd
Oct 3, 2026
Merged

Anish Narsian (anish-n) merged 2 commits into
Azure:202511_azdfrom
alawing:202511_azd

Conversation

@alawing

Copy link
Copy Markdown
  • [gnmi_server]: Authorize native Set bypass before backend

Require configured authentication and gNMI write-role authorization before invoking bypass.TrySet. Add focused certificate coverage for mapped read-write success, mapped read-only and unknown-identity denial, and zero backend effect after denial.

  • [gnmi_server]: Clarify bypass access-check wording

Describe the bypass header as a path request and use precise access-denial wording in the focused certificate tests.

  • [gnmi_server]: Use CONFIG_DB role for native Set bypass

Resolve the native database target before bypass authorization. When role authorization is configured, require gnmi_config_db_readwrite for direct CONFIG_DB bypass requests. Do not attempt this bypass for other database targets.


Why I did it

How I did it

How to verify it

Which release branch to backport (provide reason below if selected)

  • 202511_azd

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

* [gnmi_server]: Authorize native Set bypass before backend

Require configured authentication and gNMI write-role authorization before invoking bypass.TrySet. Add focused certificate coverage for mapped read-write success, mapped read-only and unknown-identity denial, and zero backend effect after denial.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>

* [gnmi_server]: Clarify bypass access-check wording

Describe the bypass header as a path request and use precise access-denial wording in the focused certificate tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>

* [gnmi_server]: Use CONFIG_DB role for native Set bypass

Resolve the native database target before bypass authorization. When role authorization is configured, require `gnmi_config_db_readwrite` for direct CONFIG_DB bypass requests. Do not attempt this bypass for other database targets.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>

---------

Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
1 pipeline(s) were filtered out due to trigger conditions.

Signed-off-by: Ubuntu <Bugbash@S360VM-davizhang.zemxztqi2vcupejg5t5q45g0sd.cbnx.internal.cloudapp.net>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
1 pipeline(s) were filtered out due to trigger conditions.

@anish-n
Anish Narsian (anish-n) merged commit f28281f into Azure:202511_azd Oct 3, 2026
3 checks passed
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.

5 participants