[202605] Backport payload-safe tablePath logging (#768) - #770
Conversation
Signed-off-by: donghaolicd <leedonhom@gmail.com> (cherry picked from commit 23e3737)
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
202605 physical validationValidated the amd64 package from this PR on a physical SmartSwitch running
The full physical-lab logs and testbed identity are intentionally not published. After validation, I removed the test key, certificates/role/checkpoints, staged package, and runtime overlay. I recreated the Separately, the release DASH fixture currently launches telemetry without explicit certificate-auth flags. With the translib-write package it defaults to JWT/password and rejects its certificate-only client before reaching the protobuf handler. That fixture issue is not caused by this PR and was excluded from the product result above. |
Why I did it
Backport #768 so the 202605 release does not write raw protobuf payload bytes from
tablePathvalues into gNMI text logs. Those bytes can be invalid UTF-8, which made Ansible omitstdoutwhile collecting diagnostics and masked the original gNMI result.How I did it
Cherry-picked the merged #768 commit (
23e37370e65edbce6d348d19b2514f66d57aa4a6) onto202605as one backport commit.git range-diffreports the code patch as identical to the merged change; the only commit-message difference is the-xcherry-pick provenance line.The change adds payload-safe
StringandGoStringformatting fortablePath, keeps useful path metadata, and replaces JSON/protobuf values with their byte lengths.How to verify it
git range-diff: code patch identical to sonic_data_client: redact table path payloads #768gofmt -d sonic_data_client/db_client.go sonic_data_client/table_path_test.go: cleangit diff --check: passTestTablePathFormattingRedactsPayloadspassedWhich release branch to backport (provide reason below if selected)
Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO): https://msazure.visualstudio.com/One/_workitems/edit/39376939
Failure type: other - latent payload-unsafe logging exposed by DASH protobuf SETs
The target release failure was reproduced on
SONiC.20260510.11in Elastictest plan https://elastictest.org/scheduler/testplan/6a8ced4c5585d0b8ab0a86e5.Tested branch
Test result
sonic_data_clientregression test passed in the SONiC Trixie build environment as documented in sonic_data_client: redact table path payloads #768.SONiC.20260510.11; authenticated protobuf Set update/delete succeeded, payload-safetablePathlogging remained valid UTF-8, and the release gNMI auth module passed both cases. See the sanitized validation comment below.Description for the changelog
Prevent
tablePathlogging from exposing request payloads or writing invalid UTF-8 bytes to gNMI text logs.Link to config_db schema for YANG module changes
N/A