Skip to content

[serverless] Adding env variables to support .net and java instruments#65

Merged
nine5two7 merged 4 commits into
mainfrom
dotNetAndJavaEnv
Jun 7, 2022
Merged

[serverless] Adding env variables to support .net and java instruments#65
nine5two7 merged 4 commits into
mainfrom
dotNetAndJavaEnv

Conversation

@nine5two7

Copy link
Copy Markdown
Contributor

What does this PR do?
Setting env variables in the dd_wrapper file to support .net and java instruments.
This is the step 1.
Step 2 is to update the corresponding datadog-ci and serverless plugin.

Motivation:
https://datadoghq.atlassian.net/browse/SLS-2190

Describe how to test/QA your changes
Manual e2e test

@nine5two7 nine5two7 added this to the Triage milestone Jun 1, 2022
@nine5two7 nine5two7 self-assigned this Jun 1, 2022
@nine5two7
nine5two7 marked this pull request as ready for review June 1, 2022 15:17
@nine5two7
nine5two7 requested a review from a team as a code owner June 1, 2022 15:17
@nine5two7
nine5two7 requested review from IvanTopolcic and maxday June 1, 2022 15:18
@@ -0,0 +1,48 @@
#!/bin/bash

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove the .sh extension from the wrapper? the examples from AWS are all without the .sh extension, i think one benefit is that we could potentially change it to a python or non-sh script down the road without asking users to update their configurations.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree it Should Be Fine to remove .sh as long as we have the shebang at the beginning of the file

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will create a new revision for it.

@maxday maxday left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I left some minor comments

Comment thread scripts/datadog_wrapper.sh Outdated
fi

# if it is .Net
echo "The runtime is $AWS_EXECUTION_ENV"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be protected by a if DD_LOG_LEVEL = debug ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix it in the next revision

Comment thread scripts/datadog_wrapper.sh Outdated
echo "The runtime is $AWS_EXECUTION_ENV"
if [[ "$AWS_EXECUTION_ENV" == *"dotnet"* ]];
then
echo "Configuring for the .NET runtime!"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix it in the next revision

Comment thread scripts/datadog_wrapper.sh Outdated
# if it is java
if [[ "$AWS_EXECUTION_ENV" == *"java"* ]];
then
echo "Configuring for the Java runtime!"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix it in the next revision

@nine5two7

Copy link
Copy Markdown
Contributor Author

A new revision of the PR has just been created.

@nine5two7
nine5two7 requested review from agocs, maxday and tianchu June 2, 2022 14:43
@nine5two7
nine5two7 merged commit f35d485 into main Jun 7, 2022
@nine5two7
nine5two7 deleted the dotNetAndJavaEnv branch June 7, 2022 18:01
jchrostek-dd added a commit that referenced this pull request Apr 15, 2026
## Summary

Resolves all **24 open Dependabot security alerts** (2 critical, 6 high,
14 medium, 2 low) across three ecosystems by updating vulnerable
dependencies in test infrastructure.

**Note:** All affected dependencies are in test infrastructure
(`integration-tests/`, `local_tests/`), not the production Rust
extension (`bottlecap/`).

## Changes

### npm (`integration-tests/`)
- **axios** `^1.6.7` → `^1.15.0` — fixes SSRF bypass via NO_PROXY
hostname normalization (CVE-2025-62718, critical)

### Go (`local_tests/golang/`)
- **golang.org/x/net** `v0.2.0` → `v0.52.0` — fixes 8 alerts: HTTP/2
rapid reset, uncontrolled resource consumption, XSS, IPv6 zone ID proxy
bypass, excessive memory growth, stream cancellation, improper text
rendering
- **google.golang.org/grpc** `v1.50.1` → `v1.80.0` — fixes 2 alerts:
authorization bypass via missing leading slash (CVE-2026-33186,
critical), HTTP/2 rapid reset
- **google.golang.org/protobuf** `v1.28.1` → `v1.36.11` — fixes infinite
loop in protojson.Unmarshal
- **github.com/golang/glog** `v1.0.0` → `v1.2.5` — fixes insecure
temporary file usage

### Python (`local_tests/serverless-init/`)
- **Flask** `2.1.2` → `3.1.3` — fixes session cookie disclosure, missing
Vary:Cookie header
- **Werkzeug** `2.2.2` → `3.1.8` — fixes 9 alerts: debugger RCE,
safe_join Windows device name bypasses, multipart form DoS, resource
exhaustion, nameless cookie bypass

## Reviewer Notes

⚠️ **Go minimum version**: The `go` directive in
`local_tests/golang/go.mod` was auto-upgraded from `go 1.22` to `go
1.25.0` (required by `golang.org/x/net v0.52.0`). This only affects the
test Lambda function, not CI build toolchains for the main extension.

⚠️ **Flask/Werkzeug major version jump**: Flask 2.x → 3.x and Werkzeug
2.x → 3.x are major version bumps. The test app (`app.py`) uses minimal
Flask APIs and was reviewed for compatibility. However, `ddtrace==1.4.1`
compatibility with Flask 3.x should be verified in CI.

## Alert Breakdown

| Severity | Count | Alerts |
|----------|-------|--------|
| Critical | 2 | #128 (axios SSRF), #104 (gRPC auth bypass) |
| High | 6 | #52, #43, #40, #38, #37, #20 |
| Medium | 14 | #88, #74, #73, #70, #68, #65, #60, #59, #53, #51, #49,
#45, #41, #36 |
| Low | 2 | #89, #39 |

Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants