Skip to content

[DSEC] [SDS] [DO NOT MERGE] Data Security MVP#51830

Draft
aimenebelfodil wants to merge 9 commits into
mainfrom
aimene.belfodil/dsec/mvp-add-sds
Draft

[DSEC] [SDS] [DO NOT MERGE] Data Security MVP#51830
aimenebelfodil wants to merge 9 commits into
mainfrom
aimene.belfodil/dsec/mvp-add-sds

Conversation

@aimenebelfodil
Copy link
Copy Markdown

What does this PR do?

Motivation

Describe how you validated your changes

Additional Notes

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

@codex review

@datadog-datadog-prod-us1-2
Copy link
Copy Markdown
Contributor

datadog-datadog-prod-us1-2 Bot commented Jun 4, 2026

Pipelines

Fix all issues with BitsAI

⚠️ Warnings

🚦 28 Pipeline jobs failed

DataDog/datadog-agent | agent_dmg-arm64-a7   View in Datadog   GitLab

See error Custom git clone failed: remote origin already exists for repository https://github.com/DataDog/dd-sensitive-data-scanner.

DataDog/datadog-agent | agent_dmg-x64-a7   View in Datadog   GitLab

See error Custom git clone failed due to remote origin already exists while trying to fetch repository at revision b6508b798d1a.

DataDog/datadog-agent | agent_heroku_deb-x64-a7   View in Datadog   GitLab

See error Git clone failed due to existing remote origin for repository https://github.com/DataDog/dd-sensitive-data-scanner.

View all 28 failed jobs.

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: eddd839 | Docs | Datadog PR Page | Give us feedback!

@github-actions github-actions Bot added the long review PR is complex, plan time to review it label Jun 4, 2026
@aimenebelfodil
Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1e1b7a0ed1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread tasks/agent.py
rtloader_root=None,
python_home_3=None,
exclude_rtloader=False,
include_sds=False,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Propagate --include-sds into agent build tags

When omnibus and CI call dda inv agent.build --include-sds, this new option is accepted but never passed to compute_build_tags_for_flavor below, so the agent binary is still built without the sds tag and uses scanner_nosds.go while packaging the shared library. This makes the SDS-enabled package silently run the no-op scanner; please thread include_sds=include_sds into the build tag computation.

Useful? React with 👍 / 👎.

Comment thread pkg/util/sds/scanner.go
s.Lock()
defer s.Unlock()

log.Infof("Scanning event: %s", string(event))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Avoid logging unredacted scan inputs

For any integration that calls datadog_agent.scan or the new scan-and-submit path with a payload containing credentials/PII, this INFO log writes the original bytes before SDS has a chance to redact them. Since agent logs are commonly collected and shipped, this defeats the purpose of the scanner; log only non-sensitive metadata or remove this line.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes this is a POC just to show for now that events get scanner
This PR will not be merged as it is for now

//sender.EventPlatformEvent(processed, C.GoString(eventType))
// Submit the scanned payload as a regular Datadog event, keeping the JSON
// format in the event text, rather than forwarding it to the event platform.
sender.Event(metricsevent.Event{
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Submit scanned payloads to event platform

In the aggregator.scan_and_submit_event_platform_event path, this sends the scanned JSON as a regular Datadog event with hard-coded host/tags instead of forwarding it through EventPlatformEvent. Integrations using the new API for event-platform payloads will no longer hit the event-platform pipeline or preserve the intended payload semantics; the processed bytes should be submitted with the original event platform sender.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes comment is false but the code above will be updated (we are exploring for now different options which are intended only for poke)

@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented Jun 4, 2026

Gitlab CI Configuration Changes

Modified Jobs

.linux_tests
  .linux_tests:
    artifacts:
      expire_in: 2 weeks
      paths:
      - ${TEST_OUTPUT_FILE}.json
      - ${TEST_OUTPUT_FILE}_unified.json
      - junit-*.tgz
      - coverage.out
      reports:
        annotations:
        - $EXTERNAL_LINKS_PATH
        junit: '**/junit-out-*.xml'
      when: always
    before_script:
    - mkdir -p $GOPATH/pkg/mod/cache && zstd -dc modcache.tar.zst | tar xf - -C $GOPATH/pkg/mod/cache
    - rm -f modcache.tar.zst
    - "go_bin=\"$(go env GOBIN)\"\nif [ -z \"$go_bin\" ]; then\n  go_bin=\"$(go env\
      \ GOPATH)/bin\"\nfi\nmkdir -p \"$go_bin\" \"$GOPATH/pkg/mod/cache\"\nzstd -dc\
      \ go_tools_bin.tar.zst | tar xf - -C \"$go_bin\"\nzstd -dc modcache_tools.tar.zst\
      \ | tar xf - -C \"$GOPATH/pkg/mod/cache\"\n"
    - rm -f go_tools_bin.tar.zst modcache_tools.tar.zst
    - export PATH=$PATH:$go_bin
    cache:
    - key:
        files:
        - .bazelversion
        prefix: bazelversion-$CI_RUNNER_DESCRIPTION
      paths:
      - .cache/bazelisk
      - .cache/bazel/*/install
      policy: pull$BAZEL_CACHE_POLICY_SUFFIX
      when: on_success
    - key:
        files:
        - .go-version
        - .python-version
        prefix: bazel-$CI_JOB_NAME
      paths:
      - .cache/bazel/*/cache
      - .cache/go
      - .cache/ms-go
      - .cache/pip
      policy: pull$BAZEL_CACHE_POLICY_SUFFIX
      when: on_success
    id_tokens:
      BUILDBARN_ID_TOKEN:
        aud: buildbarn.us1.ddbuild.io
    needs:
    - go_deps
    - go_tools_deps
    rules:
    - if: $RUN_UNIT_TESTS == "off"
      when: never
    - if: $CI_COMMIT_BRANCH == "main"
      variables:
        COVERAGE_CACHE_FLAG: --push-coverage-cache
        FAST_TESTS: 'false'
    - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\.[0-9]+\.x$/
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - if: $CI_COMMIT_TAG != null
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - if: $CI_PIPELINE_SOURCE == "trigger" || $CI_PIPELINE_SOURCE == "pipeline"
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - if: $RUN_UNIT_TESTS == "on"
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - variables:
        COVERAGE_CACHE_FLAG: --pull-coverage-cache
        FAST_TESTS: 'true'
    script:
    - dda inv -- -e gitlab.generate-ci-visibility-links --output=$EXTERNAL_LINKS_PATH
    - FAST_TESTS_FLAG=""
    - if [[ "$FAST_TESTS" == "true" ]]; then FAST_TESTS_FLAG="--only-impacted-packages";
      fi
+   - dda inv -- -e sds.build-library
-   - dda inv -- -e agent.build
+   - dda inv -- -e agent.build --include-sds
?                              ++++++++++++++
-   - dda inv -- -e test $FLAVORS --race --profile --rerun-fails=2 --coverage --cpus
?                                                                            -------
+   - dda inv -- -e test $FLAVORS --include-sds --race --profile --rerun-fails=2 --coverage
?                                ++++++++++++++
-     $KUBERNETES_CPU_REQUEST $EXTRA_OPTS --result-json ${TEST_OUTPUT_FILE}.json --junit-tar
?                                                                               ------------
+     --cpus $KUBERNETES_CPU_REQUEST $EXTRA_OPTS --result-json ${TEST_OUTPUT_FILE}.json
?    +++++++
-     "junit-${CI_JOB_NAME}.tgz" --build-stdlib $FAST_TESTS_FLAG --test-washer
+     --junit-tar "junit-${CI_JOB_NAME}.tgz" --build-stdlib $FAST_TESTS_FLAG --test-washer
?    ++++++++++++
    stage: source_test
    variables:
      BAZELISK_HOME: $XDG_CACHE_HOME/bazelisk
      EXTERNAL_LINKS_PATH: external_links_$CI_JOB_ID.json
      FLAKY_PATTERNS_CONFIG: $CI_PROJECT_DIR/flaky-patterns-runtime.yaml
      FLAVORS: --flavor base
      KUBERNETES_CPU_REQUEST: 16
      KUBERNETES_MEMORY_LIMIT: 24Gi
      KUBERNETES_MEMORY_REQUEST: 24Gi
      TEST_OUTPUT_FILE: test_output
      XDG_CACHE_HOME: $CI_PROJECT_DIR/.cache
tests_flavor_dogstatsd_linux-x64
  tests_flavor_dogstatsd_linux-x64:
    after_script:
    - $CI_PROJECT_DIR/tools/ci/junit_upload.sh
    artifacts:
      expire_in: 2 weeks
      paths:
      - ${TEST_OUTPUT_FILE}.json
      - ${TEST_OUTPUT_FILE}_unified.json
      - junit-*.tgz
      - coverage.out
      reports:
        annotations:
        - $EXTERNAL_LINKS_PATH
        junit:
        - '**/junit-out-*.xml'
      when: always
    before_script:
    - mkdir -p $GOPATH/pkg/mod/cache && zstd -dc modcache.tar.zst | tar xf - -C $GOPATH/pkg/mod/cache
    - rm -f modcache.tar.zst
    - "go_bin=\"$(go env GOBIN)\"\nif [ -z \"$go_bin\" ]; then\n  go_bin=\"$(go env\
      \ GOPATH)/bin\"\nfi\nmkdir -p \"$go_bin\" \"$GOPATH/pkg/mod/cache\"\nzstd -dc\
      \ go_tools_bin.tar.zst | tar xf - -C \"$go_bin\"\nzstd -dc modcache_tools.tar.zst\
      \ | tar xf - -C \"$GOPATH/pkg/mod/cache\"\n"
    - rm -f go_tools_bin.tar.zst modcache_tools.tar.zst
    - export PATH=$PATH:$go_bin
    cache:
    - key:
        files:
        - .bazelversion
        prefix: bazelversion-$CI_RUNNER_DESCRIPTION
      paths:
      - .cache/bazelisk
      - .cache/bazel/*/install
      policy: pull$BAZEL_CACHE_POLICY_SUFFIX
      when: on_success
    - key:
        files:
        - .go-version
        - .python-version
        prefix: bazel-$CI_JOB_NAME
      paths:
      - .cache/bazel/*/cache
      - .cache/go
      - .cache/ms-go
      - .cache/pip
      policy: pull$BAZEL_CACHE_POLICY_SUFFIX
      when: on_success
    id_tokens:
      BUILDBARN_ID_TOKEN:
        aud: buildbarn.us1.ddbuild.io
    image: registry.ddbuild.io/ci/datadog-agent-buildimages/linux$CI_IMAGE_LINUX_SUFFIX:$CI_IMAGE_LINUX
    needs:
    - go_deps
    - go_tools_deps
    rules:
    - if: $RUN_UNIT_TESTS == "off"
      when: never
    - if: $CI_COMMIT_BRANCH == "main"
      variables:
        COVERAGE_CACHE_FLAG: --push-coverage-cache
        FAST_TESTS: 'false'
    - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\.[0-9]+\.x$/
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - if: $CI_COMMIT_TAG != null
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - if: $CI_PIPELINE_SOURCE == "trigger" || $CI_PIPELINE_SOURCE == "pipeline"
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - if: $RUN_UNIT_TESTS == "on"
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - variables:
        COVERAGE_CACHE_FLAG: --pull-coverage-cache
        FAST_TESTS: 'true'
    script:
    - dda inv -- -e gitlab.generate-ci-visibility-links --output=$EXTERNAL_LINKS_PATH
    - FAST_TESTS_FLAG=""
    - if [[ "$FAST_TESTS" == "true" ]]; then FAST_TESTS_FLAG="--only-impacted-packages";
      fi
+   - dda inv -- -e sds.build-library
-   - dda inv -- -e agent.build
+   - dda inv -- -e agent.build --include-sds
?                              ++++++++++++++
-   - dda inv -- -e test $FLAVORS --race --profile --rerun-fails=2 --coverage --cpus
?                                                                            -------
+   - dda inv -- -e test $FLAVORS --include-sds --race --profile --rerun-fails=2 --coverage
?                                ++++++++++++++
-     $KUBERNETES_CPU_REQUEST $EXTRA_OPTS --result-json ${TEST_OUTPUT_FILE}.json --junit-tar
?                                                                               ------------
+     --cpus $KUBERNETES_CPU_REQUEST $EXTRA_OPTS --result-json ${TEST_OUTPUT_FILE}.json
?    +++++++
-     "junit-${CI_JOB_NAME}.tgz" --build-stdlib $FAST_TESTS_FLAG --test-washer
+     --junit-tar "junit-${CI_JOB_NAME}.tgz" --build-stdlib $FAST_TESTS_FLAG --test-washer
?    ++++++++++++
    stage: source_test
    tags:
    - arch:amd64
    - specific:true
    variables:
      BAZELISK_HOME: $XDG_CACHE_HOME/bazelisk
      CONDA_ENV: ddpy3
      EXTERNAL_LINKS_PATH: external_links_$CI_JOB_ID.json
      FLAKY_PATTERNS_CONFIG: $CI_PROJECT_DIR/flaky-patterns-runtime.yaml
      FLAVORS: --flavor dogstatsd
      KUBERNETES_CPU_REQUEST: 16
      KUBERNETES_MEMORY_LIMIT: 24Gi
      KUBERNETES_MEMORY_REQUEST: 24Gi
      TEST_OUTPUT_FILE: test_output
      XDG_CACHE_HOME: $CI_PROJECT_DIR/.cache
tests_flavor_heroku_linux-x64
  tests_flavor_heroku_linux-x64:
    after_script:
    - $CI_PROJECT_DIR/tools/ci/junit_upload.sh
    artifacts:
      expire_in: 2 weeks
      paths:
      - ${TEST_OUTPUT_FILE}.json
      - ${TEST_OUTPUT_FILE}_unified.json
      - junit-*.tgz
      - coverage.out
      reports:
        annotations:
        - $EXTERNAL_LINKS_PATH
        junit:
        - '**/junit-out-*.xml'
      when: always
    before_script:
    - mkdir -p $GOPATH/pkg/mod/cache && zstd -dc modcache.tar.zst | tar xf - -C $GOPATH/pkg/mod/cache
    - rm -f modcache.tar.zst
    - "go_bin=\"$(go env GOBIN)\"\nif [ -z \"$go_bin\" ]; then\n  go_bin=\"$(go env\
      \ GOPATH)/bin\"\nfi\nmkdir -p \"$go_bin\" \"$GOPATH/pkg/mod/cache\"\nzstd -dc\
      \ go_tools_bin.tar.zst | tar xf - -C \"$go_bin\"\nzstd -dc modcache_tools.tar.zst\
      \ | tar xf - -C \"$GOPATH/pkg/mod/cache\"\n"
    - rm -f go_tools_bin.tar.zst modcache_tools.tar.zst
    - export PATH=$PATH:$go_bin
    cache:
    - key:
        files:
        - .bazelversion
        prefix: bazelversion-$CI_RUNNER_DESCRIPTION
      paths:
      - .cache/bazelisk
      - .cache/bazel/*/install
      policy: pull$BAZEL_CACHE_POLICY_SUFFIX
      when: on_success
    - key:
        files:
        - .go-version
        - .python-version
        prefix: bazel-$CI_JOB_NAME
      paths:
      - .cache/bazel/*/cache
      - .cache/go
      - .cache/ms-go
      - .cache/pip
      policy: pull$BAZEL_CACHE_POLICY_SUFFIX
      when: on_success
    id_tokens:
      BUILDBARN_ID_TOKEN:
        aud: buildbarn.us1.ddbuild.io
    image: registry.ddbuild.io/ci/datadog-agent-buildimages/linux$CI_IMAGE_LINUX_SUFFIX:$CI_IMAGE_LINUX
    needs:
    - go_deps
    - go_tools_deps
    rules:
    - if: $RUN_UNIT_TESTS == "off"
      when: never
    - if: $CI_COMMIT_BRANCH == "main"
      variables:
        COVERAGE_CACHE_FLAG: --push-coverage-cache
        FAST_TESTS: 'false'
    - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\.[0-9]+\.x$/
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - if: $CI_COMMIT_TAG != null
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - if: $CI_PIPELINE_SOURCE == "trigger" || $CI_PIPELINE_SOURCE == "pipeline"
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - if: $RUN_UNIT_TESTS == "on"
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - variables:
        COVERAGE_CACHE_FLAG: --pull-coverage-cache
        FAST_TESTS: 'true'
    script:
    - dda inv -- -e gitlab.generate-ci-visibility-links --output=$EXTERNAL_LINKS_PATH
    - FAST_TESTS_FLAG=""
    - if [[ "$FAST_TESTS" == "true" ]]; then FAST_TESTS_FLAG="--only-impacted-packages";
      fi
+   - dda inv -- -e sds.build-library
-   - dda inv -- -e agent.build
+   - dda inv -- -e agent.build --include-sds
?                              ++++++++++++++
-   - dda inv -- -e test $FLAVORS --race --profile --rerun-fails=2 --coverage --cpus
?                                                                            -------
+   - dda inv -- -e test $FLAVORS --include-sds --race --profile --rerun-fails=2 --coverage
?                                ++++++++++++++
-     $KUBERNETES_CPU_REQUEST $EXTRA_OPTS --result-json ${TEST_OUTPUT_FILE}.json --junit-tar
?                                                                               ------------
+     --cpus $KUBERNETES_CPU_REQUEST $EXTRA_OPTS --result-json ${TEST_OUTPUT_FILE}.json
?    +++++++
-     "junit-${CI_JOB_NAME}.tgz" --build-stdlib $FAST_TESTS_FLAG --test-washer
+     --junit-tar "junit-${CI_JOB_NAME}.tgz" --build-stdlib $FAST_TESTS_FLAG --test-washer
?    ++++++++++++
    stage: source_test
    tags:
    - arch:amd64
    - specific:true
    variables:
      BAZELISK_HOME: $XDG_CACHE_HOME/bazelisk
      CONDA_ENV: ddpy3
      EXTERNAL_LINKS_PATH: external_links_$CI_JOB_ID.json
      FLAKY_PATTERNS_CONFIG: $CI_PROJECT_DIR/flaky-patterns-runtime.yaml
      FLAVORS: --flavor heroku
      KUBERNETES_CPU_REQUEST: 16
      KUBERNETES_MEMORY_LIMIT: 24Gi
      KUBERNETES_MEMORY_REQUEST: 24Gi
      TEST_OUTPUT_FILE: test_output
      XDG_CACHE_HOME: $CI_PROJECT_DIR/.cache
tests_flavor_iot_linux-x64
  tests_flavor_iot_linux-x64:
    after_script:
    - $CI_PROJECT_DIR/tools/ci/junit_upload.sh
    artifacts:
      expire_in: 2 weeks
      paths:
      - ${TEST_OUTPUT_FILE}.json
      - ${TEST_OUTPUT_FILE}_unified.json
      - junit-*.tgz
      - coverage.out
      reports:
        annotations:
        - $EXTERNAL_LINKS_PATH
        junit:
        - '**/junit-out-*.xml'
      when: always
    before_script:
    - mkdir -p $GOPATH/pkg/mod/cache && zstd -dc modcache.tar.zst | tar xf - -C $GOPATH/pkg/mod/cache
    - rm -f modcache.tar.zst
    - "go_bin=\"$(go env GOBIN)\"\nif [ -z \"$go_bin\" ]; then\n  go_bin=\"$(go env\
      \ GOPATH)/bin\"\nfi\nmkdir -p \"$go_bin\" \"$GOPATH/pkg/mod/cache\"\nzstd -dc\
      \ go_tools_bin.tar.zst | tar xf - -C \"$go_bin\"\nzstd -dc modcache_tools.tar.zst\
      \ | tar xf - -C \"$GOPATH/pkg/mod/cache\"\n"
    - rm -f go_tools_bin.tar.zst modcache_tools.tar.zst
    - export PATH=$PATH:$go_bin
    cache:
    - key:
        files:
        - .bazelversion
        prefix: bazelversion-$CI_RUNNER_DESCRIPTION
      paths:
      - .cache/bazelisk
      - .cache/bazel/*/install
      policy: pull$BAZEL_CACHE_POLICY_SUFFIX
      when: on_success
    - key:
        files:
        - .go-version
        - .python-version
        prefix: bazel-$CI_JOB_NAME
      paths:
      - .cache/bazel/*/cache
      - .cache/go
      - .cache/ms-go
      - .cache/pip
      policy: pull$BAZEL_CACHE_POLICY_SUFFIX
      when: on_success
    id_tokens:
      BUILDBARN_ID_TOKEN:
        aud: buildbarn.us1.ddbuild.io
    image: registry.ddbuild.io/ci/datadog-agent-buildimages/linux$CI_IMAGE_LINUX_SUFFIX:$CI_IMAGE_LINUX
    needs:
    - go_deps
    - go_tools_deps
    rules:
    - if: $RUN_UNIT_TESTS == "off"
      when: never
    - if: $CI_COMMIT_BRANCH == "main"
      variables:
        COVERAGE_CACHE_FLAG: --push-coverage-cache
        FAST_TESTS: 'false'
    - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\.[0-9]+\.x$/
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - if: $CI_COMMIT_TAG != null
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - if: $CI_PIPELINE_SOURCE == "trigger" || $CI_PIPELINE_SOURCE == "pipeline"
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - if: $RUN_UNIT_TESTS == "on"
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - variables:
        COVERAGE_CACHE_FLAG: --pull-coverage-cache
        FAST_TESTS: 'true'
    script:
    - dda inv -- -e gitlab.generate-ci-visibility-links --output=$EXTERNAL_LINKS_PATH
    - FAST_TESTS_FLAG=""
    - if [[ "$FAST_TESTS" == "true" ]]; then FAST_TESTS_FLAG="--only-impacted-packages";
      fi
+   - dda inv -- -e sds.build-library
-   - dda inv -- -e agent.build
+   - dda inv -- -e agent.build --include-sds
?                              ++++++++++++++
-   - dda inv -- -e test $FLAVORS --race --profile --rerun-fails=2 --coverage --cpus
?                                                                            -------
+   - dda inv -- -e test $FLAVORS --include-sds --race --profile --rerun-fails=2 --coverage
?                                ++++++++++++++
-     $KUBERNETES_CPU_REQUEST $EXTRA_OPTS --result-json ${TEST_OUTPUT_FILE}.json --junit-tar
?                                                                               ------------
+     --cpus $KUBERNETES_CPU_REQUEST $EXTRA_OPTS --result-json ${TEST_OUTPUT_FILE}.json
?    +++++++
-     "junit-${CI_JOB_NAME}.tgz" --build-stdlib $FAST_TESTS_FLAG --test-washer
+     --junit-tar "junit-${CI_JOB_NAME}.tgz" --build-stdlib $FAST_TESTS_FLAG --test-washer
?    ++++++++++++
    stage: source_test
    tags:
    - arch:amd64
    - specific:true
    variables:
      BAZELISK_HOME: $XDG_CACHE_HOME/bazelisk
      CONDA_ENV: ddpy3
      EXTERNAL_LINKS_PATH: external_links_$CI_JOB_ID.json
      FLAKY_PATTERNS_CONFIG: $CI_PROJECT_DIR/flaky-patterns-runtime.yaml
      FLAVORS: --flavor iot
      KUBERNETES_CPU_REQUEST: 16
      KUBERNETES_MEMORY_LIMIT: 24Gi
      KUBERNETES_MEMORY_REQUEST: 24Gi
      TEST_OUTPUT_FILE: test_output
      XDG_CACHE_HOME: $CI_PROJECT_DIR/.cache
tests_gpu
  tests_gpu:
    after_script:
    - $CI_PROJECT_DIR/tools/ci/junit_upload.sh
    - CODECOV_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $CODECOV token) || exit
      $?; export CODECOV_TOKEN
    - dda inv -- -e coverage.upload-to-codecov $COVERAGE_CACHE_FLAG || true
    - DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_API_KEY_ORG2 token)
      || exit $?; export DD_API_KEY
    - datadog-ci coverage upload --format=go-coverprofile coverage.out || true
    allow_failure: true
    artifacts:
      expire_in: 2 weeks
      paths:
      - ${TEST_OUTPUT_FILE}.json
      - ${TEST_OUTPUT_FILE}_unified.json
      - junit-*.tgz
      - coverage.out
      reports:
        annotations:
        - $EXTERNAL_LINKS_PATH
        junit:
        - '**/junit-out-*.xml'
      when: always
    before_script:
    - mkdir -p $GOPATH/pkg/mod/cache && zstd -dc modcache.tar.zst | tar xf - -C $GOPATH/pkg/mod/cache
    - rm -f modcache.tar.zst
    - "go_bin=\"$(go env GOBIN)\"\nif [ -z \"$go_bin\" ]; then\n  go_bin=\"$(go env\
      \ GOPATH)/bin\"\nfi\nmkdir -p \"$go_bin\" \"$GOPATH/pkg/mod/cache\"\nzstd -dc\
      \ go_tools_bin.tar.zst | tar xf - -C \"$go_bin\"\nzstd -dc modcache_tools.tar.zst\
      \ | tar xf - -C \"$GOPATH/pkg/mod/cache\"\n"
    - rm -f go_tools_bin.tar.zst modcache_tools.tar.zst
    - export PATH=$PATH:$go_bin
    cache:
    - key:
        files:
        - .bazelversion
        prefix: bazelversion-$CI_RUNNER_DESCRIPTION
      paths:
      - .cache/bazelisk
      - .cache/bazel/*/install
      policy: pull$BAZEL_CACHE_POLICY_SUFFIX
      when: on_success
    - key:
        files:
        - .go-version
        - .python-version
        prefix: bazel-$CI_JOB_NAME
      paths:
      - .cache/bazel/*/cache
      - .cache/go
      - .cache/ms-go
      - .cache/pip
      policy: pull$BAZEL_CACHE_POLICY_SUFFIX
      when: on_success
    id_tokens:
      BUILDBARN_ID_TOKEN:
        aud: buildbarn.us1.ddbuild.io
    image: registry.ddbuild.io/ci/datadog-agent-buildimages/linux$CI_IMAGE_LINUX_SUFFIX:$CI_IMAGE_LINUX
    needs:
    - go_deps
    - go_tools_deps
    rules:
    - if: $DDR_WORKFLOW_ID != null && $CI_COMMIT_BRANCH == "main"
      when: always
    - changes:
        compare_to: $COMPARE_TO_BRANCH
        paths:
        - pkg/gpu/**/*
        - pkg/collector/corechecks/gpu/**/*
        - comp/core/workloadmeta/collectors/internal/nvml/**/*
        - .gitlab/build/source_test/linux.yml
      when: on_success
    - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
      when: never
    - allow_failure: true
      when: manual
    - if: $RUN_UNIT_TESTS == "off"
      when: never
    script:
    - dda inv -- -e gitlab.generate-ci-visibility-links --output=$EXTERNAL_LINKS_PATH
    - FAST_TESTS_FLAG=""
    - if [[ "$FAST_TESTS" == "true" ]]; then FAST_TESTS_FLAG="--only-impacted-packages";
      fi
+   - dda inv -- -e sds.build-library
-   - dda inv -- -e agent.build
+   - dda inv -- -e agent.build --include-sds
?                              ++++++++++++++
-   - dda inv -- -e test $FLAVORS --race --profile --rerun-fails=2 --coverage --cpus
?                                                                            -------
+   - dda inv -- -e test $FLAVORS --include-sds --race --profile --rerun-fails=2 --coverage
?                                ++++++++++++++
-     $KUBERNETES_CPU_REQUEST $EXTRA_OPTS --result-json ${TEST_OUTPUT_FILE}.json --junit-tar
?                                                                               ------------
+     --cpus $KUBERNETES_CPU_REQUEST $EXTRA_OPTS --result-json ${TEST_OUTPUT_FILE}.json
?    +++++++
-     "junit-${CI_JOB_NAME}.tgz" --build-stdlib $FAST_TESTS_FLAG --test-washer
+     --junit-tar "junit-${CI_JOB_NAME}.tgz" --build-stdlib $FAST_TESTS_FLAG --test-washer
?    ++++++++++++
    stage: source_test
    tags:
    - gpu:a10-amd64
    variables:
      BAZELISK_HOME: $XDG_CACHE_HOME/bazelisk
      EXTERNAL_LINKS_PATH: external_links_$CI_JOB_ID.json
      EXTRA_OPTS: --targets=./pkg/gpu/integrationtests,./pkg/collector/corechecks/gpu/integrationtests
      FLAKY_PATTERNS_CONFIG: $CI_PROJECT_DIR/flaky-patterns-runtime.yaml
      FLAVORS: ''
      KUBERNETES_CPU_REQUEST: 4
      KUBERNETES_MEMORY_LIMIT: 8Gi
      KUBERNETES_MEMORY_REQUEST: 8Gi
      TEST_OUTPUT_FILE: test_output
      XDG_CACHE_HOME: $CI_PROJECT_DIR/.cache
tests_linux-arm64-py3
  tests_linux-arm64-py3:
    after_script:
    - $CI_PROJECT_DIR/tools/ci/junit_upload.sh
    - CODECOV_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $CODECOV token) || exit
      $?; export CODECOV_TOKEN
    - dda inv -- -e coverage.upload-to-codecov $COVERAGE_CACHE_FLAG || true
    - DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_API_KEY_ORG2 token)
      || exit $?; export DD_API_KEY
    - datadog-ci coverage upload --format=go-coverprofile coverage.out || true
    artifacts:
      expire_in: 2 weeks
      paths:
      - ${TEST_OUTPUT_FILE}.json
      - ${TEST_OUTPUT_FILE}_unified.json
      - junit-*.tgz
      - coverage.out
      reports:
        annotations:
        - $EXTERNAL_LINKS_PATH
        junit:
        - '**/junit-out-*.xml'
      when: always
    before_script:
    - mkdir -p $GOPATH/pkg/mod/cache && zstd -dc modcache.tar.zst | tar xf - -C $GOPATH/pkg/mod/cache
    - rm -f modcache.tar.zst
    - "go_bin=\"$(go env GOBIN)\"\nif [ -z \"$go_bin\" ]; then\n  go_bin=\"$(go env\
      \ GOPATH)/bin\"\nfi\nmkdir -p \"$go_bin\" \"$GOPATH/pkg/mod/cache\"\nzstd -dc\
      \ go_tools_bin_arm64.tar.zst | tar xf - -C \"$go_bin\"\nzstd -dc modcache_tools_arm64.tar.zst\
      \ | tar xf - -C \"$GOPATH/pkg/mod/cache\"\n"
    - rm -f go_tools_bin_arm64.tar.zst modcache_tools_arm64.tar.zst
    - export PATH=$PATH:$go_bin
    cache:
    - key:
        files:
        - .bazelversion
        prefix: bazelversion-$CI_RUNNER_DESCRIPTION
      paths:
      - .cache/bazelisk
      - .cache/bazel/*/install
      policy: pull$BAZEL_CACHE_POLICY_SUFFIX
      when: on_success
    - key:
        files:
        - .go-version
        - .python-version
        prefix: bazel-$CI_JOB_NAME
      paths:
      - .cache/bazel/*/cache
      - .cache/go
      - .cache/ms-go
      - .cache/pip
      policy: pull$BAZEL_CACHE_POLICY_SUFFIX
      when: on_success
    id_tokens:
      BUILDBARN_ID_TOKEN:
        aud: buildbarn.us1.ddbuild.io
    image: registry.ddbuild.io/ci/datadog-agent-buildimages/linux$CI_IMAGE_LINUX_SUFFIX:$CI_IMAGE_LINUX
    needs:
    - go_deps
    - go_tools_deps_arm64
    rules:
    - if: $RUN_UNIT_TESTS == "off"
      when: never
    - if: $CI_COMMIT_BRANCH == "main"
      variables:
        COVERAGE_CACHE_FLAG: --push-coverage-cache
        FAST_TESTS: 'false'
    - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\.[0-9]+\.x$/
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - if: $CI_COMMIT_TAG != null
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - if: $CI_PIPELINE_SOURCE == "trigger" || $CI_PIPELINE_SOURCE == "pipeline"
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - if: $RUN_UNIT_TESTS == "on"
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - variables:
        COVERAGE_CACHE_FLAG: --pull-coverage-cache
        FAST_TESTS: 'true'
    script:
    - dda inv -- -e gitlab.generate-ci-visibility-links --output=$EXTERNAL_LINKS_PATH
    - FAST_TESTS_FLAG=""
    - if [[ "$FAST_TESTS" == "true" ]]; then FAST_TESTS_FLAG="--only-impacted-packages";
      fi
+   - dda inv -- -e sds.build-library
-   - dda inv -- -e agent.build
+   - dda inv -- -e agent.build --include-sds
?                              ++++++++++++++
-   - dda inv -- -e test $FLAVORS --race --profile --rerun-fails=2 --coverage --cpus
?                                                                            -------
+   - dda inv -- -e test $FLAVORS --include-sds --race --profile --rerun-fails=2 --coverage
?                                ++++++++++++++
-     $KUBERNETES_CPU_REQUEST $EXTRA_OPTS --result-json ${TEST_OUTPUT_FILE}.json --junit-tar
?                                                                               ------------
+     --cpus $KUBERNETES_CPU_REQUEST $EXTRA_OPTS --result-json ${TEST_OUTPUT_FILE}.json
?    +++++++
-     "junit-${CI_JOB_NAME}.tgz" --build-stdlib $FAST_TESTS_FLAG --test-washer
+     --junit-tar "junit-${CI_JOB_NAME}.tgz" --build-stdlib $FAST_TESTS_FLAG --test-washer
?    ++++++++++++
    stage: source_test
    tags:
    - arch:arm64
    - specific:true
    variables:
      BAZELISK_HOME: $XDG_CACHE_HOME/bazelisk
      CONDA_ENV: ddpy3
      EXTERNAL_LINKS_PATH: external_links_$CI_JOB_ID.json
      FLAKY_PATTERNS_CONFIG: $CI_PROJECT_DIR/flaky-patterns-runtime.yaml
      FLAVORS: --flavor base
      KUBERNETES_CPU_REQUEST: 16
      KUBERNETES_MEMORY_LIMIT: 24Gi
      KUBERNETES_MEMORY_REQUEST: 24Gi
      TEST_OUTPUT_FILE: test_output
      XDG_CACHE_HOME: $CI_PROJECT_DIR/.cache
tests_linux-x64-py3
  tests_linux-x64-py3:
    after_script:
    - $CI_PROJECT_DIR/tools/ci/junit_upload.sh
    - CODECOV_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $CODECOV token) || exit
      $?; export CODECOV_TOKEN
    - dda inv -- -e coverage.upload-to-codecov $COVERAGE_CACHE_FLAG || true
    - DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_API_KEY_ORG2 token)
      || exit $?; export DD_API_KEY
    - datadog-ci coverage upload --format=go-coverprofile coverage.out || true
    artifacts:
      expire_in: 2 weeks
      paths:
      - ${TEST_OUTPUT_FILE}.json
      - ${TEST_OUTPUT_FILE}_unified.json
      - junit-*.tgz
      - coverage.out
      reports:
        annotations:
        - $EXTERNAL_LINKS_PATH
        junit:
        - '**/junit-out-*.xml'
      when: always
    before_script:
    - mkdir -p $GOPATH/pkg/mod/cache && zstd -dc modcache.tar.zst | tar xf - -C $GOPATH/pkg/mod/cache
    - rm -f modcache.tar.zst
    - "go_bin=\"$(go env GOBIN)\"\nif [ -z \"$go_bin\" ]; then\n  go_bin=\"$(go env\
      \ GOPATH)/bin\"\nfi\nmkdir -p \"$go_bin\" \"$GOPATH/pkg/mod/cache\"\nzstd -dc\
      \ go_tools_bin.tar.zst | tar xf - -C \"$go_bin\"\nzstd -dc modcache_tools.tar.zst\
      \ | tar xf - -C \"$GOPATH/pkg/mod/cache\"\n"
    - rm -f go_tools_bin.tar.zst modcache_tools.tar.zst
    - export PATH=$PATH:$go_bin
    cache:
    - key:
        files:
        - .bazelversion
        prefix: bazelversion-$CI_RUNNER_DESCRIPTION
      paths:
      - .cache/bazelisk
      - .cache/bazel/*/install
      policy: pull$BAZEL_CACHE_POLICY_SUFFIX
      when: on_success
    - key:
        files:
        - .go-version
        - .python-version
        prefix: bazel-$CI_JOB_NAME
      paths:
      - .cache/bazel/*/cache
      - .cache/go
      - .cache/ms-go
      - .cache/pip
      policy: pull$BAZEL_CACHE_POLICY_SUFFIX
      when: on_success
    id_tokens:
      BUILDBARN_ID_TOKEN:
        aud: buildbarn.us1.ddbuild.io
    image: registry.ddbuild.io/ci/datadog-agent-buildimages/linux$CI_IMAGE_LINUX_SUFFIX:$CI_IMAGE_LINUX
    needs:
    - go_deps
    - go_tools_deps
    rules:
    - if: $RUN_UNIT_TESTS == "off"
      when: never
    - if: $CI_COMMIT_BRANCH == "main"
      variables:
        COVERAGE_CACHE_FLAG: --push-coverage-cache
        FAST_TESTS: 'false'
    - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\.[0-9]+\.x$/
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - if: $CI_COMMIT_TAG != null
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - if: $CI_PIPELINE_SOURCE == "trigger" || $CI_PIPELINE_SOURCE == "pipeline"
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - if: $RUN_UNIT_TESTS == "on"
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - variables:
        COVERAGE_CACHE_FLAG: --pull-coverage-cache
        FAST_TESTS: 'true'
    script:
    - dda inv -- -e gitlab.generate-ci-visibility-links --output=$EXTERNAL_LINKS_PATH
    - FAST_TESTS_FLAG=""
    - if [[ "$FAST_TESTS" == "true" ]]; then FAST_TESTS_FLAG="--only-impacted-packages";
      fi
+   - dda inv -- -e sds.build-library
-   - dda inv -- -e agent.build
+   - dda inv -- -e agent.build --include-sds
?                              ++++++++++++++
-   - dda inv -- -e test $FLAVORS --race --profile --rerun-fails=2 --coverage --cpus
?                                                                            -------
+   - dda inv -- -e test $FLAVORS --include-sds --race --profile --rerun-fails=2 --coverage
?                                ++++++++++++++
-     $KUBERNETES_CPU_REQUEST $EXTRA_OPTS --result-json ${TEST_OUTPUT_FILE}.json --junit-tar
?                                                                               ------------
+     --cpus $KUBERNETES_CPU_REQUEST $EXTRA_OPTS --result-json ${TEST_OUTPUT_FILE}.json
?    +++++++
-     "junit-${CI_JOB_NAME}.tgz" --build-stdlib $FAST_TESTS_FLAG --test-washer
+     --junit-tar "junit-${CI_JOB_NAME}.tgz" --build-stdlib $FAST_TESTS_FLAG --test-washer
?    ++++++++++++
    stage: source_test
    tags:
    - arch:amd64
    - specific:true
    variables:
      BAZELISK_HOME: $XDG_CACHE_HOME/bazelisk
      CONDA_ENV: ddpy3
      EXTERNAL_LINKS_PATH: external_links_$CI_JOB_ID.json
      FLAKY_PATTERNS_CONFIG: $CI_PROJECT_DIR/flaky-patterns-runtime.yaml
      FLAVORS: --flavor base
      KUBERNETES_CPU_REQUEST: 16
      KUBERNETES_MEMORY_LIMIT: 24Gi
      KUBERNETES_MEMORY_REQUEST: 24Gi
      TEST_OUTPUT_FILE: test_output
      XDG_CACHE_HOME: $CI_PROJECT_DIR/.cache
tests_nodetreemodel
  tests_nodetreemodel:
    after_script:
    - $CI_PROJECT_DIR/tools/ci/junit_upload.sh
    - CODECOV_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $CODECOV token) || exit
      $?; export CODECOV_TOKEN
    - dda inv -- -e coverage.upload-to-codecov $COVERAGE_CACHE_FLAG || true
    - DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_API_KEY_ORG2 token)
      || exit $?; export DD_API_KEY
    - datadog-ci coverage upload --format=go-coverprofile coverage.out || true
    artifacts:
      expire_in: 2 weeks
      paths:
      - ${TEST_OUTPUT_FILE}.json
      - ${TEST_OUTPUT_FILE}_unified.json
      - junit-*.tgz
      - coverage.out
      reports:
        annotations:
        - $EXTERNAL_LINKS_PATH
        junit:
        - '**/junit-out-*.xml'
      when: always
    before_script:
    - mkdir -p $GOPATH/pkg/mod/cache && zstd -dc modcache.tar.zst | tar xf - -C $GOPATH/pkg/mod/cache
    - rm -f modcache.tar.zst
    - "go_bin=\"$(go env GOBIN)\"\nif [ -z \"$go_bin\" ]; then\n  go_bin=\"$(go env\
      \ GOPATH)/bin\"\nfi\nmkdir -p \"$go_bin\" \"$GOPATH/pkg/mod/cache\"\nzstd -dc\
      \ go_tools_bin.tar.zst | tar xf - -C \"$go_bin\"\nzstd -dc modcache_tools.tar.zst\
      \ | tar xf - -C \"$GOPATH/pkg/mod/cache\"\n"
    - rm -f go_tools_bin.tar.zst modcache_tools.tar.zst
    - export PATH=$PATH:$go_bin
    cache:
    - key:
        files:
        - .bazelversion
        prefix: bazelversion-$CI_RUNNER_DESCRIPTION
      paths:
      - .cache/bazelisk
      - .cache/bazel/*/install
      policy: pull$BAZEL_CACHE_POLICY_SUFFIX
      when: on_success
    - key:
        files:
        - .go-version
        - .python-version
        prefix: bazel-$CI_JOB_NAME
      paths:
      - .cache/bazel/*/cache
      - .cache/go
      - .cache/ms-go
      - .cache/pip
      policy: pull$BAZEL_CACHE_POLICY_SUFFIX
      when: on_success
    id_tokens:
      BUILDBARN_ID_TOKEN:
        aud: buildbarn.us1.ddbuild.io
    image: registry.ddbuild.io/ci/datadog-agent-buildimages/linux$CI_IMAGE_LINUX_SUFFIX:$CI_IMAGE_LINUX
    needs:
    - go_deps
    - go_tools_deps
    rules:
    - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
      when: never
    - if: $RUN_UNIT_TESTS == "off"
      when: never
    - if: $CI_COMMIT_BRANCH == "main"
      variables:
        COVERAGE_CACHE_FLAG: --push-coverage-cache
        FAST_TESTS: 'false'
    - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\.[0-9]+\.x$/
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - if: $CI_COMMIT_TAG != null
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - if: $CI_PIPELINE_SOURCE == "trigger" || $CI_PIPELINE_SOURCE == "pipeline"
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - if: $RUN_UNIT_TESTS == "on"
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - variables:
        COVERAGE_CACHE_FLAG: --pull-coverage-cache
        FAST_TESTS: 'true'
    script:
    - dda inv -- -e gitlab.generate-ci-visibility-links --output=$EXTERNAL_LINKS_PATH
    - FAST_TESTS_FLAG=""
    - if [[ "$FAST_TESTS" == "true" ]]; then FAST_TESTS_FLAG="--only-impacted-packages";
      fi
+   - dda inv -- -e sds.build-library
-   - dda inv -- -e agent.build
+   - dda inv -- -e agent.build --include-sds
?                              ++++++++++++++
-   - dda inv -- -e test $FLAVORS --race --profile --rerun-fails=2 --coverage --cpus
?                                                                            -------
+   - dda inv -- -e test $FLAVORS --include-sds --race --profile --rerun-fails=2 --coverage
?                                ++++++++++++++
-     $KUBERNETES_CPU_REQUEST $EXTRA_OPTS --result-json ${TEST_OUTPUT_FILE}.json --junit-tar
?                                                                               ------------
+     --cpus $KUBERNETES_CPU_REQUEST $EXTRA_OPTS --result-json ${TEST_OUTPUT_FILE}.json
?    +++++++
-     "junit-${CI_JOB_NAME}.tgz" --build-stdlib $FAST_TESTS_FLAG --test-washer
+     --junit-tar "junit-${CI_JOB_NAME}.tgz" --build-stdlib $FAST_TESTS_FLAG --test-washer
?    ++++++++++++
    stage: source_test
    tags:
    - arch:amd64
    - specific:true
    variables:
      BAZELISK_HOME: $XDG_CACHE_HOME/bazelisk
      CONDA_ENV: ddpy3
      DD_CONF_NODETREEMODEL: enable
      EXTERNAL_LINKS_PATH: external_links_$CI_JOB_ID.json
      FLAKY_PATTERNS_CONFIG: $CI_PROJECT_DIR/flaky-patterns-runtime.yaml
      FLAVORS: --flavor base
      KUBERNETES_CPU_REQUEST: 16
      KUBERNETES_MEMORY_LIMIT: 24Gi
      KUBERNETES_MEMORY_REQUEST: 24Gi
      TEST_OUTPUT_FILE: test_output
      XDG_CACHE_HOME: $CI_PROJECT_DIR/.cache

Changes Summary

Removed Modified Added Renamed
0 8 0 0

ℹ️ Diff available in the job log.

@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented Jun 4, 2026

Go Package Import Differences

Baseline: 2d4cf88
Comparison: eddd839

binaryosarchchange
agentlinuxamd64
+1, -0
+github.com/DataDog/datadog-agent/pkg/util/sds
agentlinuxarm64
+1, -0
+github.com/DataDog/datadog-agent/pkg/util/sds
agentwindowsamd64
+1, -0
+github.com/DataDog/datadog-agent/pkg/util/sds
agentdarwinamd64
+1, -0
+github.com/DataDog/datadog-agent/pkg/util/sds
agentdarwinarm64
+1, -0
+github.com/DataDog/datadog-agent/pkg/util/sds
agentaixppc64
+1, -0
+github.com/DataDog/datadog-agent/pkg/util/sds
heroku-agentlinuxamd64
+1, -0
+github.com/DataDog/datadog-agent/pkg/util/sds

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6c6b2a5995

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread tasks/agent.py
rtloader_root=None,
python_home_3=None,
exclude_rtloader=False,
include_sds=False,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Pass the SDS flag into agent build tags

When dda inv agent.build --include-sds is used by the updated CI and omnibus paths, this new option is never forwarded to compute_build_tags_for_flavor in build(), so the agent is still compiled without the sds tag and uses the no-op implementation from scanner_nosds.go. That means shipped Linux/macOS packages can include libdd_sds while the binary never links or runs the real scanner; pass include_sds=include_sds when computing the agent build tags.

Useful? React with 👍 / 👎.

Comment thread pkg/util/sds/scanner.go
s.Lock()
defer s.Unlock()

log.Infof("Scanning event: %s", string(event))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Stop logging raw SDS payloads

For any check calling datadog_agent.scan or the new scan-and-submit path, this logs the full pre-redaction event at INFO level before SDS can remove secrets. Since the payload is expected to contain sensitive data, default agent logs will retain exactly the values SDS is meant to protect; remove this log or make it non-payload metadata only.

Useful? React with 👍 / 👎.

//sender.EventPlatformEvent(processed, C.GoString(eventType))
// Submit the scanned payload as a regular Datadog event, keeping the JSON
// format in the event text, rather than forwarding it to the event platform.
sender.Event(metricsevent.Event{
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve event-platform submission after scanning

In the new scan_and_submit_event_platform_event flow, the scanned payload is no longer sent through sender.EventPlatformEvent; it is converted into a regular Datadog event with hard-coded host/tags instead. Integrations that call this new method expecting the same event-platform ingestion semantics as submit_event_platform_event will have their payloads routed to the wrong pipeline, so submit processed via EventPlatformEvent after scanning.

Useful? React with 👍 / 👎.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b595a6b596

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread pkg/util/sds/scanner.go
s.Lock()
defer s.Unlock()

log.Infof("Scanning event: %s", string(event))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Avoid logging raw SDS input

When SDS is enabled, every call to Scan logs the full pre-redaction event at INFO before applying any rules. For the Python datadog_agent.scan path and the new event-platform scanning path, this is precisely the data expected to contain secrets/PII, so enabling SDS can leak sensitive payloads into Agent logs even when redaction succeeds.

Useful? React with 👍 / 👎.

Comment on lines +220 to +223
//sender.EventPlatformEvent(processed, C.GoString(eventType))
// Submit the scanned payload as a regular Datadog event, keeping the JSON
// format in the event text, rather than forwarding it to the event platform.
sender.Event(metricsevent.Event{
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Route scanned payloads through EventPlatformEvent

This new rtloader API is documented and named as scan_and_submit_event_platform_event, but after scanning it submits a classic Datadog event instead of calling sender.EventPlatformEvent(processed, C.GoString(eventType)). Any integration using this path for event-platform payloads will stop sending to the event-platform forwarder and instead emit a regular event with hard-coded host/tags, so the backend intake and payload semantics are wrong.

Useful? React with 👍 / 👎.

Comment thread tasks/agent.py
rtloader_root=None,
python_home_3=None,
exclude_rtloader=False,
include_sds=False,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Propagate include_sds into agent build tags

The new agent.build --include-sds option is never passed into compute_build_tags_for_flavor in this task, so building the agent with the option still omits the sds build tag and compiles the no-op scanner_nosds.go implementation. In the dev image path this can copy libdd_sds.so into the image while the agent binary cannot use it, making the advertised SDS-enabled build silently ineffective.

Useful? React with 👍 / 👎.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 26855fb9e2

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

}

rawEvent := C.GoBytes(unsafe.Pointer(rawEventPtr), rawEventSize)
log.Infof("AIMENE: eventplatform: received: %s", string(rawEvent))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Stop logging unredacted SDS payloads

When this new callback is used for sensitive-data scanning, the raw payload is written to the Agent log before SDS has a chance to redact it. That exposes exactly the secrets this path is meant to protect, and the later processed log can still contain sensitive data when no rule matches or scanning falls back to the original event.

Useful? React with 👍 / 👎.

Comment thread tasks/agent.py
rtloader_root=None,
python_home_3=None,
exclude_rtloader=False,
include_sds=False,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Pass include_sds into the agent build tags

The new --include-sds option is accepted by agent.build, and CI/omnibus now pass it, but this function never forwards it to compute_build_tags_for_flavor when constructing build_tags below. As a result, those builds still omit the sds build tag and compile the no-op scanner_nosds.go path, so packaged agents will ship the SDS library but the new scan APIs won't actually redact anything.

Useful? React with 👍 / 👎.

Comment on lines +220 to +223
//sender.EventPlatformEvent(processed, C.GoString(eventType))
// Submit the scanned payload as a regular Datadog event, keeping the JSON
// format in the event text, rather than forwarding it to the event platform.
sender.Event(metricsevent.Event{
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Submit scanned payloads through Event Platform

For callers of aggregator.scan_and_submit_event_platform_event, this replaces the event-platform submission with a regular Datadog event, so payloads meant for Event Platform ingestion are routed to the Events product with hard-coded metadata instead of the caller's event-platform stream. This changes the contract described by the rtloader method and prevents downstream Event Platform consumers from receiving the scanned payload.

Useful? React with 👍 / 👎.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eddd8399a5

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread pkg/util/sds/scanner.go
s.Lock()
defer s.Unlock()

log.Infof("Scanning event: %s", string(event))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Avoid logging raw SDS payloads

When SDS scans payloads that contain credentials or PII, this INFO log writes the unredacted event to the Agent log before any redaction happens. That defeats the purpose of routing the data through Sensitive Data Scanner and can leak exactly the values SDS is meant to protect whenever datadog_agent.scan or the scan-and-submit path is used.

Useful? React with 👍 / 👎.

//sender.EventPlatformEvent(processed, C.GoString(eventType))
// Submit the scanned payload as a regular Datadog event, keeping the JSON
// format in the event text, rather than forwarding it to the event platform.
sender.Event(metricsevent.Event{
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Submit scanned payloads through the event-platform path

For callers using the new scan_and_submit_event_platform_event rtloader method, the existing unscanned path submits bytes via sender.EventPlatformEvent, and the new C/API docs also say this method submits an event-platform event; however this code sends a generic Datadog event with hard-coded host/tags instead. That changes routing and payload semantics for scanned events, so downstream event-platform consumers will not receive the data they requested.

Useful? React with 👍 / 👎.

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.

1 participant