Skip to content
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

V4.48.0 proposal #4787

Merged
merged 36 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
ab3812b
[DI] Add stack trace to log probe results (#4727)
watson Oct 2, 2024
a7f1855
Don't use deprecated url.parse function (#4743)
watson Oct 2, 2024
0f60317
[test visibility] Read `pull_request` and `pull_request_target` event…
juan-fernandez Oct 2, 2024
ef13c23
[DI] Switch unit tests to Mocha instead of Tap (#4728)
watson Oct 2, 2024
e3226fa
[DI] Fix probe.location.lines to be string[] instead of number[] (#4750)
watson Oct 2, 2024
1c24413
[DI] Add GitHub repo and SHA tags to probe results (#4751)
watson Oct 3, 2024
1f9df98
prefix system-tests env var names (#4746)
wconti27 Oct 3, 2024
eb709db
Fix child process not maintaining previous parent span after executio…
uurien Oct 4, 2024
a67c5d0
Fix appsec rate limiter flaky test (#4754)
uurien Oct 4, 2024
cd69e2e
[DI] Add hostname to probe result (#4756)
watson Oct 4, 2024
cd62f0a
Sql injection Exploit Prevention implementation for mysql2 library (#…
uurien Oct 4, 2024
1a21035
[DI] Add ability to take state snapshot feature (#4549)
watson Oct 4, 2024
6a9e735
feat(tracing): implement protobufjs DSM schema support (#4701)
wconti27 Oct 4, 2024
e7af9d8
feat(dsm): implement avro schemas for avsc package (#4726)
wconti27 Oct 4, 2024
1d5c445
use AsyncLocalStorage instead of our home-grown solutions (#4201)
bengl Oct 7, 2024
508da12
Upgrade iast rewriter to 2.5.0 (#4761)
iunanua Oct 8, 2024
1138717
Exploit Prevention LFI (#4676)
iunanua Oct 8, 2024
9a4438a
[ASM] Add support for attacker fingerprinting (#4698)
CarlesDD Oct 8, 2024
6a7f81f
Keep a profiling context object in spans (#4763)
szegedi Oct 8, 2024
7fb161c
[test visibility] Add option to automatically report logs within test…
juan-fernandez Oct 9, 2024
86eac8b
Use static vulnerability hash source when the cookie name is too long…
uurien Oct 9, 2024
f2bff7d
Fix capability identifier (#4767)
iunanua Oct 10, 2024
9d1e3ad
Add Plugin for @azure/functions (#4716)
duncanpharvey Oct 10, 2024
c9a2469
Update waf rules to 1.13.1 (#4768)
uurien Oct 11, 2024
69fcb00
Add support for Fastify entry spans for Code Origin for Spans (#4449)
watson Oct 14, 2024
d5bd4a4
Unsubscribe NextJS body and query channels on appsec disable (#4776)
CarlesDD Oct 14, 2024
aad5957
[DI] Refactor unit tests (#4777)
watson Oct 14, 2024
fcaaec1
Suspicious request blocking - Express Path Parameters (#4769)
CarlesDD Oct 16, 2024
eaf3c8a
[test visibility] Fix num tests reported by EFD (#4783)
juan-fernandez Oct 16, 2024
668bce1
vendor jsonpath-plus (#4785)
bengl Oct 16, 2024
73f8257
Don't stop the profiler if encoding a profile fails (#4779)
szegedi Oct 16, 2024
5032d8e
Remove old debug option from docs (#4786)
simon-id Oct 16, 2024
547351f
pin latest to 22 (#4793)
bengl Oct 16, 2024
e5008a1
update body-parser (#4790)
bengl Oct 16, 2024
ab5028e
update sinon (#4794)
bengl Oct 16, 2024
b9b7b76
v4.48.0
rochdev Oct 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ vendor
integration-tests/esbuild/out.js
integration-tests/esbuild/aws-sdk-out.js
packages/dd-trace/src/appsec/blocked_templates.js
packages/dd-trace/src/payload-tagging/jsonpath-plus.js
2 changes: 1 addition & 1 deletion .github/actions/node/latest/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ runs:
steps:
- uses: actions/setup-node@v3
with:
node-version: 'latest'
node-version: '22' # Update this line to the latest Node.js version
14 changes: 14 additions & 0 deletions .github/workflows/appsec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,3 +256,17 @@ jobs:
- run: yarn test:integration:appsec
- uses: ./.github/actions/node/latest
- run: yarn test:integration:appsec

passport:
runs-on: ubuntu-latest
env:
PLUGINS: passport-local|passport-http
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/node/setup
- uses: ./.github/actions/install
- uses: ./.github/actions/node/oldest
- run: yarn test:appsec:plugins:ci
- uses: ./.github/actions/node/latest
- run: yarn test:appsec:plugins:ci
- uses: codecov/codecov-action@v3
26 changes: 26 additions & 0 deletions .github/workflows/plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,15 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/plugins/test-and-upstream

avsc:
runs-on: ubuntu-latest
env:
PLUGINS: avsc
DD_DATA_STREAMS_ENABLED: true
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/plugins/test-and-upstream

aws-sdk:
strategy:
matrix:
Expand Down Expand Up @@ -187,6 +196,14 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/plugins/upstream

azure-functions:
runs-on: ubuntu-latest
env:
PLUGINS: azure-functions
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/plugins/test

bluebird:
runs-on: ubuntu-latest
env:
Expand Down Expand Up @@ -798,6 +815,15 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/plugins/test

protobufjs:
runs-on: ubuntu-latest
env:
PLUGINS: protobufjs
DD_DATA_STREAMS_ENABLED: true
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/plugins/test-and-upstream

q:
runs-on: ubuntu-latest
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
with:
node-version: ${{ matrix.version }}
- uses: ./.github/actions/install
- run: node node_modules/.bin/mocha --colors --timeout 30000 -r packages/dd-trace/test/setup/core.js integration-tests/init.spec.js
- run: node node_modules/.bin/mocha --colors --timeout 30000 integration-tests/init.spec.js

integration-ci:
strategy:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/system-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,8 @@ jobs:
TEST_LIBRARY: nodejs
WEBLOG_VARIANT: ${{ matrix.weblog-variant }}
DD_API_KEY: ${{ secrets.DD_API_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.IDM_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.IDM_AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
AWS_DEFAULT_REGION: us-east-1 # AWS services should use `AWS_REGION`, but some still use the older `AWS_DEFAULT_REGION`
SYSTEM_TESTS_AWS_ACCESS_KEY_ID: ${{ secrets.IDM_AWS_ACCESS_KEY_ID }}
SYSTEM_TESTS_AWS_SECRET_ACCESS_KEY: ${{ secrets.IDM_AWS_SECRET_ACCESS_KEY }}

steps:
- name: Checkout system tests
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,4 @@ packages/dd-trace/test/appsec/next/*/package.json
packages/dd-trace/test/appsec/next/*/node_modules
packages/dd-trace/test/appsec/next/*/yarn.lock
!packages/dd-trace/**/telemetry/logs
packages/datadog-plugin-azure-functions/test/integration-test/fixtures/node_modules
1 change: 0 additions & 1 deletion LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ require,import-in-the-middle,Apache license 2.0,Copyright 2021 Datadog Inc.
require,int64-buffer,MIT,Copyright 2015-2016 Yusuke Kawasaki
require,istanbul-lib-coverage,BSD-3-Clause,Copyright 2012-2015 Yahoo! Inc.
require,jest-docblock,MIT,Copyright Meta Platforms, Inc. and affiliates.
require,jsonpath-plus,MIT,Copyright (c) 2011-2019 Stefan Goessner, Subbu Allamaraju, Mike Brevoort, Robert Krahn, Brett Zamir, Richard Schneider
require,koalas,MIT,Copyright 2013-2017 Brian Woodward
require,limiter,MIT,Copyright 2011 John Hurliman
require,lodash.sortby,MIT,Copyright JS Foundation and other contributors
Expand Down
13 changes: 10 additions & 3 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ tracer.use('pg', {
<h5 id="amqplib"></h5>
<h5 id="amqplib-tags"></h5>
<h5 id="amqplib-config"></h5>
<h5 id="avsc"></h5>
<h5 id="aws-sdk"></h5>
<h5 id="aws-sdk-tags"></h5>
<h5 id="aws-sdk-config"></h5>
<h5 id="azure-functions"></h5>
<h5 id="bunyan"></h5>
<h5 id="couchbase"></h5>
<h5 id="cucumber"></h5>
Expand Down Expand Up @@ -87,6 +89,7 @@ tracer.use('pg', {
<h5 id="pg"></h5>
<h5 id="pg-tags"></h5>
<h5 id="pg-config"></h5>
<h5 id="protobufjs"></h5>
<h5 id="redis"></h5>
<h5 id="redis-tags"></h5>
<h5 id="redis-config"></h5>
Expand All @@ -101,7 +104,9 @@ tracer.use('pg', {

* [amqp10](./interfaces/export_.plugins.amqp10.html)
* [amqplib](./interfaces/export_.plugins.amqplib.html)
* [avsc](./interfaces/export_.plugins.avsc.html)
* [aws-sdk](./interfaces/export_.plugins.aws_sdk.html)
* [azure-functions](./interfaces/export_.plugins.azure_functions.html)
* [bluebird](./interfaces/export_.plugins.bluebird.html)
* [couchbase](./interfaces/export_.plugins.couchbase.html)
* [cucumber](./interfaces/export_.plugins.cucumber.html)
Expand Down Expand Up @@ -142,6 +147,7 @@ tracer.use('pg', {
* [pg](./interfaces/export_.plugins.pg.html)
* [promise](./interfaces/export_.plugins.promise.html)
* [promise-js](./interfaces/export_.plugins.promise_js.html)
* [protobufjs](./interfaces/export_.plugins.protobufjs.html)
* [q](./interfaces/export_.plugins.q.html)
* [redis](./interfaces/export_.plugins.redis.html)
* [restify](./interfaces/export_.plugins.restify.html)
Expand Down Expand Up @@ -375,7 +381,7 @@ Options can be configured as a parameter to the [init()](./interfaces/tracer.htm

<h3 id="custom-logging">Custom Logging</h3>

By default, logging from this library is disabled. In order to get debugging information and errors sent to logs, the `debug` options should be set to `true` in the [init()](./interfaces/tracer.html#init) method.
By default, logging from this library is disabled. In order to get debugging information and errors sent to logs, the `DD_TRACE_DEBUG` env var should be set to `true`.

The tracer will then log debug information to `console.log()` and errors to `console.error()`. This behavior can be changed by passing a custom logger to the tracer. The logger should contain a `debug()` and `error()` methods that can handle messages and errors, respectively.

Expand All @@ -388,14 +394,15 @@ const logger = bunyan.createLogger({
level: 'trace'
})

process.env.DD_TRACE_DEBUG = 'true'

const tracer = require('dd-trace').init({
logger: {
error: err => logger.error(err),
warn: message => logger.warn(message),
info: message => logger.info(message),
debug: message => logger.trace(message),
},
debug: true
}
})
```

Expand Down
2 changes: 2 additions & 0 deletions docs/add-redirects.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ echo "writing redirects..."
declare -a plugins=(
"amqp10"
"amqplib"
"avsc"
"aws_sdk"
"bluebird"
"couchbase"
Expand Down Expand Up @@ -55,6 +56,7 @@ declare -a plugins=(
"pg"
"promise"
"promise_js"
"protobufjs"
"q"
"redis"
"restify"
Expand Down
5 changes: 5 additions & 0 deletions docs/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ tracer.init({
},
iast: {
enabled: true,
cookieFilterPattern: '.*',
requestSampling: 50,
maxConcurrentRequests: 4,
maxContextOperations: 30,
Expand All @@ -143,6 +144,7 @@ tracer.init({
experimental: {
iast: {
enabled: true,
cookieFilterPattern: '.*',
requestSampling: 50,
maxConcurrentRequests: 4,
maxContextOperations: 30,
Expand Down Expand Up @@ -281,8 +283,10 @@ const openSearchOptions: plugins.opensearch = {

tracer.use('amqp10');
tracer.use('amqplib');
tracer.use('avsc');
tracer.use('aws-sdk');
tracer.use('aws-sdk', awsSdkOptions);
tracer.use('azure-functions');
tracer.use('bunyan');
tracer.use('couchbase');
tracer.use('cassandra-driver');
Expand Down Expand Up @@ -362,6 +366,7 @@ tracer.use('playwright');
tracer.use('pg');
tracer.use('pg', { service: params => `${params.host}-${params.database}` });
tracer.use('pino');
tracer.use('protobufjs');
tracer.use('redis');
tracer.use('redis', redisOptions);
tracer.use('restify');
Expand Down
1 change: 1 addition & 0 deletions ext/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
declare const types: {
HTTP: 'http'
SERVERLESS: 'serverless'
WEB: 'web'
}

Expand Down
1 change: 1 addition & 0 deletions ext/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@

module.exports = {
HTTP: 'http',
SERVERLESS: 'serverless',
WEB: 'web'
}
26 changes: 26 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ interface Plugins {
"amqp10": tracer.plugins.amqp10;
"amqplib": tracer.plugins.amqplib;
"apollo": tracer.plugins.apollo;
"avsc": tracer.plugins.avsc;
"aws-sdk": tracer.plugins.aws_sdk;
"azure-functions": tracer.plugins.azure_functions;
"bunyan": tracer.plugins.bunyan;
"cassandra-driver": tracer.plugins.cassandra_driver;
"child_process": tracer.plugins.child_process;
Expand Down Expand Up @@ -190,6 +192,7 @@ interface Plugins {
"playwright": tracer.plugins.playwright;
"pg": tracer.plugins.pg;
"pino": tracer.plugins.pino;
"protobufjs": tracer.plugins.protobufjs;
"redis": tracer.plugins.redis;
"restify": tracer.plugins.restify;
"rhea": tracer.plugins.rhea;
Expand Down Expand Up @@ -1191,6 +1194,12 @@ declare namespace tracer {
signature?: boolean;
}

/**
* This plugin automatically patches the [avsc](https://github.com/mtth/avsc) module
* to collect avro message schemas when Datastreams Monitoring is enabled.
*/
interface avsc extends Integration {}

/**
* This plugin automatically instruments the
* [aws-sdk](https://github.com/aws/aws-sdk-js) module.
Expand Down Expand Up @@ -1229,6 +1238,12 @@ declare namespace tracer {
[key: string]: boolean | Object | undefined;
}

/**
* This plugin automatically instruments the
* @azure/functions module.
*/
interface azure_functions extends Instrumentation {}

/**
* This plugin patches the [bunyan](https://github.com/trentm/node-bunyan)
* to automatically inject trace identifiers in log records when the
Expand Down Expand Up @@ -1731,6 +1746,11 @@ declare namespace tracer {
* on the tracer.
*/
interface pino extends Integration {}
/**
* This plugin automatically patches the [protobufjs](https://protobufjs.github.io/protobuf.js/)
* to collect protobuf message schemas when Datastreams Monitoring is enabled.
*/
interface protobufjs extends Integration {}

/**
* This plugin automatically instruments the
Expand Down Expand Up @@ -2146,6 +2166,12 @@ declare namespace tracer {
*/
maxContextOperations?: number,

/**
* Defines the pattern to ignore cookie names in the vulnerability hash calculation
* @default ".{32,}"
*/
cookieFilterPattern?: string,

/**
* Whether to enable vulnerability deduplication
*/
Expand Down
Loading
Loading