Skip to content

Require authentication for remote gNOI KillProcess calls - #776

Draft
ashutosh-agrawal wants to merge 1 commit into
sonic-net:masterfrom
ashutosh-agrawal:reject-unauthenticated-writes
Draft

ashutosh-agrawal wants to merge 1 commit into
sonic-net:masterfrom
ashutosh-agrawal:reject-unauthenticated-writes

Conversation

@ashutosh-agrawal

Copy link
Copy Markdown
Member

Why I did it

KillProcess changes host service state, but the handler currently continues when the telemetry server has no client authentication configured. A remote TCP client can therefore stop or restart an allowed service without authenticating.

Local Unix-socket access is different: it is restricted through the socket’s filesystem permissions and should continue to work.

How I did it

  • Reject TCP KillProcess requests when no client authentication method is configured.
  • Keep the existing authentication and authorization checks for configured clients.
  • Preserve the filesystem-protected Unix-socket path.
  • Add focused tests for both the rejected remote path and the permitted Unix-socket path.

How to verify it

go test ./gnmi_server \
    -run 'TestKillProcess(RejectsUnauthenticatedWrite|AllowsUnixSocketPeer)$' \
    -count=1

git diff --check passes. The focused Go tests were not run locally because this host does not have the Go/build environment; repository CI will provide that result.

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

No backport requested.

Tested branch

  • master
  • N/A

Test result

Focused regression tests were added. Repository CI is pending.

Description for the changelog

Require authentication for remote gNOI KillProcess requests.

Link to config_db schema for YANG module changes

N/A

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

Signed-off-by: Ashutosh Agrawal <ashu@cisco.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
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

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.

2 participants