[DATASEC-331] Add Error translation #56931
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #56931"
general
weight: 0.35
aimenebelfodil
What does this PR do?
Stops forwarding raw postgres errors from the data security check. Errors are translated in
backend/postgres/error.rsinto aPostgresError:Server(SqlState): SQLSTATE code only, with a readable label for common cases (e.g.postgres server error: permission denied, the user lacks the required privileges (SQLSTATE 42501)).Client(String): top-levelpostgres::Errormessage only, without its cause (e.g.postgres client error: error performing TLS handshake).The original error is dropped and never logged.
Motivation
Postgres error messages can echo scanned values (e.g.
invalid input syntax for type integer: "<value>"), which were logged and sent in the payloadfailure_reason.Describe how you validated your changes
Ran the CI-built image
registry.ddbuild.io/ci/datadog-agent/agent:v140089586-83b4d5fc-7-amd64(after) against the previous build (before), with one sub task per error case.<details>
<summary>Check config: wrong password, wrong port, non-existing table, failed cast, write query, bad TLS</summary>
</details>
Before:
After:
Additional Notes
Diff stats (+139 / -1):
| | Lines |
|---|---|
| Code (
postgres.rs,postgres/error.rs) | +70 / -1 || Tests (
postgres/error.rstest module) | +63 || Release note | +6 |