-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AWS payload report as tags #4131
Conversation
Overall package sizeSelf size: 6.21 MB Dependency sizes
🤖 This report was automatically generated by heaviest-objects-in-the-universe |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4131 +/- ##
==========================================
- Coverage 85.25% 85.23% -0.02%
==========================================
Files 247 250 +3
Lines 10848 10962 +114
Branches 33 33
==========================================
+ Hits 9248 9344 +96
- Misses 1600 1618 +18 ☔ View full report in Codecov by Sentry. |
ec01bc4
to
41f2cec
Compare
017814d
to
ea5cec7
Compare
a9bf916
to
b9d4462
Compare
b9d4462
to
2f1d675
Compare
|
I'm going to close this PR as work is continuing in #4309. |
What does this PR do?
This PR introduces AWS payload reporting as tags.
Configuration
We introduce 3 new environment variables:
DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING
defines the activation of the feature for requests, values being either"all"
(no additional redactionor a comma-separated list of JSONPath queries identifying payload paths to be replaced with the value
"redacted"`.DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING
DD_TRACE_CLOUD_PAYLOAD_TAGGING_MAX_DEPTH
sets the depth after which we stop creating tags from a payloadBehaviour
With the feature activated,
aws-sdk
calls to the enabled plugins will create additional tags representing the payload, with the following modifications:This PR only provides the feature for SNS as a first service, but the framework introduced here only requires slight adaptations of a given AWS service plugin to make it available, as well as the addition of the static PII fields configuration.
New dependencies
Adding
jsonpath
seems safe given the constraints it imposes on its scripts, even if I don't expect scripts to be used. Usingrfdc
is more questionable - we need a deep clone because JSONPathapply
can only do side-effects, and we must not modify the payload, but maybe something simpler works.Remaining work
In some cases, JSONPath filter expressions are not sufficient to do what we want.
For example, setting attributes for entities (like SNS topics) requires setting an
AttributeName
and anAttributeValue
at top-level of the JSON payload. Ideally, we should be able to redact theAttributeValue
only when theAttributeName
matches a disallowed value (for exampleKMSMasterKeyId
). JSONPath syntax does not allow such a complex query, so we need to also specify custom logic hooks that do not go through JSONPath to redact data.Motivation
This come from:
datadog-lambda-js
, but only scoped to lambda function input and output. This provides the same level of information, with additional redaction granularity, for AWS plugins.Plugin Checklist
Additional Notes
Security
Datadog employees:
@DataDog/security-design-and-guidance
.Unsure? Have a question? Request a review!