Skip to content

[Backport 7.78.x] Add config provider based security controls for agent checks#48225

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
7.78.xfrom
backport-44544-to-7.78.x
Mar 24, 2026
Merged

[Backport 7.78.x] Add config provider based security controls for agent checks#48225
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
7.78.xfrom
backport-44544-to-7.78.x

Conversation

@dd-octo-sts

@dd-octo-sts dd-octo-sts Bot commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

Backport 07b2c8d from #44544.


What does this PR do?

Adds provider parameter to check configuration to track which config provider (kubernetes, file, etcd, etc.) issued the check config and allow for secure mode when dealing with agent python integrations/checks.

Changes:

  • Add provider parameter to Check.Configure() method
  • Add ConfigProvider() method to Check interface
  • Update CheckBase to store the provider value
  • Update all check implementations to pass the parameter through

Configuration Changes

Adds new integration security properties:

  • integration_ignore_untrusted_file_params: When enabled, integrations ignore file path parameters from untrusted providers
  • integration_file_paths_allowlist: Allowlist of file paths integrations can access even from untrusted providers
  • integration_trusted_providers: List of trusted providers (defaults to ["file", "remote-config"])
  • integration_security_excluded_checks: Integration names excluded from security restrictions

These settings enable security controls based on the config provider. Untrusted providers (container labels, pod annotations,

Motivation

Need to track where check configs come from to support provider-based security controls in the agent checks.

RFC: https://datadoghq.atlassian.net/wiki/spaces/AI/pages/5802623155/RFC+Remediate+untrusted+checks+configs+in+Integrations

Jira: https://datadoghq.atlassian.net/browse/AI-5322

Describe how you validated your changes

  • Updated all check implementations and tests to pass the provider parameter
  • Added tests in checkbase_test.go to verify provider is stored and returned correctly
  • Existing tests pass with empty string or "provider" placeholder values
  • Testing in a kubernetes lab environment using both an existing agent docker image and a pipeline docker image from this [DO NOT MERGE] Testing Config Provider Integrations Security #47971 where I update the release.json ints core hash to target the latest commit on this branch, and have a http_check configured via pod annotation and testing for the expected output. (currently waiting for CI to redeploy the environment with the new agent docker image from the pipeline)

Here is a report detailing the experiment: https://datadoghq.atlassian.net/wiki/spaces/~550367931/pages/6428329336/DEMO+Remediate+untrusted+checks+configs+in+Integrations

Additional Notes

Relates to: DataDog/integrations-core#22226

Update (2026-03-19)

Addressed review feedback:

  • Assert provider in CGo test mocks: Added get_check_provider and get_check_deprecated_provider globals with strdup/reset/assertions in testConfigure and testConfigureDeprecated, matching the pattern used for other parameters
  • Add ConfigProvider() to check.Info interface: For symmetry with ConfigSource(), so consumers operating on Info references don't need a type assertion to Check to read the provider. Updated MockInfo accordingly.
  • Move source/provider out of handleConf closure: Assignments were redundantly written twice (once per handleConf call). Moved them after both calls alongside initConfig/instanceConfig.

… ### What does this PR do?

Adds `provider` parameter to check configuration to track which config provider (kubernetes, file, etcd, etc.) issued the check config and allow for secure mode when dealing with agent python integrations/checks.

Changes:
- Add `provider` parameter to `Check.Configure()` method
- Add `ConfigProvider()` method to `Check` interface
- Update `CheckBase` to store the provider value
- Update all check implementations to pass the parameter through

#### Configuration Changes

Adds new integration security properties:
- `integration_ignore_untrusted_file_params`: When enabled, integrations ignore file path parameters from untrusted providers
- `integration_file_paths_allowlist`: Allowlist of file paths integrations can access even from untrusted providers
- `integration_trusted_providers`: List of trusted providers (defaults to `["file", "remote-config"]`)
- `integration_security_excluded_checks`: Integration names excluded from security restrictions

These settings enable security controls based on the config provider. Untrusted providers (container labels, pod annotations,

### Motivation

Need to track where check configs come from  to support provider-based security controls in the agent checks.

RFC: https://datadoghq.atlassian.net/wiki/spaces/AI/pages/5802623155/RFC+Remediate+untrusted+checks+configs+in+Integrations

Jira: https://datadoghq.atlassian.net/browse/AI-5322

### Describe how you validated your changes

- Updated all check implementations and tests to pass the provider parameter
- Added tests in `checkbase_test.go` to verify provider is stored and returned correctly
- Existing tests pass with empty string or "provider" placeholder values
- Testing in a kubernetes lab environment using both an existing agent docker image and a pipeline docker image from this #47971 where I update the release.json ints core hash to target the latest commit on this branch, and have a http_check configured via pod annotation and testing for the expected output. (currently waiting for CI to redeploy the environment with the new agent docker image from the pipeline)

Here is a report detailing the experiment: https://datadoghq.atlassian.net/wiki/spaces/~550367931/pages/6428329336/DEMO+Remediate+untrusted+checks+configs+in+Integrations

### Additional Notes

Relates to: DataDog/integrations-core#22226

### Update (2026-03-19)

Addressed review feedback:
- **Assert provider in CGo test mocks**: Added `get_check_provider` and `get_check_deprecated_provider` globals with `strdup`/reset/assertions in `testConfigure` and `testConfigureDeprecated`, matching the pattern used for other parameters
- **Add `ConfigProvider()` to `check.Info` interface**: For symmetry with `ConfigSource()`, so consumers operating on `Info` references don't need a type assertion to `Check` to read the provider. Updated `MockInfo` accordingly.
- **Move `source`/`provider` out of `handleConf` closure**: Assignments were redundantly written twice (once per `handleConf` call). Moved them after both calls alongside `initConfig`/`instanceConfig`.

Co-authored-by: noueman.khalikine <[email protected]>
(cherry picked from commit 07b2c8d)

___

Co-authored-by: NouemanKHAL <[email protected]>
@dd-octo-sts dd-octo-sts Bot added ask-review Ask in slack required teams to review this PR backport bot component/system-probe internal Identify a non-fork PR long review PR is complex, plan time to review it qa/rc-required Only for a PR that requires validation on the Release Candidate team/agent-apm trace-agent team/agent-build team/agent-configuration team/agent-delivery team/agent-discovery labels Mar 23, 2026
@dd-octo-sts
dd-octo-sts Bot requested a review from a team as a code owner March 23, 2026 15:49
@dd-octo-sts
dd-octo-sts Bot requested a review from a team as a code owner March 23, 2026 15:49
@dd-octo-sts
dd-octo-sts Bot requested a review from a team as a code owner March 23, 2026 15:49
@dd-octo-sts
dd-octo-sts Bot requested a review from a team as a code owner March 23, 2026 15:49
@dd-octo-sts dd-octo-sts Bot added team/ebpf-platform team/ecs-experiences Issues and PRs owned by the ECS Experiences team team/kubernetes-experiences labels Mar 23, 2026
@dd-octo-sts
dd-octo-sts Bot requested a review from a team as a code owner March 23, 2026 15:49
@dd-octo-sts
dd-octo-sts Bot requested a review from a team as a code owner March 23, 2026 15:49
@dd-octo-sts
dd-octo-sts Bot requested a review from a team as a code owner March 23, 2026 15:49
@dd-octo-sts
dd-octo-sts Bot requested review from a team as code owners March 23, 2026 15:49
@dd-octo-sts
dd-octo-sts Bot requested review from NouhaManai96, dustmop and nathan-b and removed request for a team March 23, 2026 15:49

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

Copy link
Copy Markdown

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: eac9454ac5

ℹ️ 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/collector/check/check.go
@agent-platform-auto-pr

agent-platform-auto-pr Bot commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

Files inventory check summary

File checks results against ancestor bb16b07b:

Results for datadog-agent_7.78.0~rc.1.git.9.eac9454.pipeline.104016624-1_amd64.deb:

No change detected

@agent-platform-auto-pr

agent-platform-auto-pr Bot commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

Static quality checks

✅ Please find below the results from static quality gates
Comparison made with ancestor bb16b07
📊 Static Quality Gates Dashboard
🔗 SQG Job

Successful checks

Info

Quality gate Change Size (prev → curr → max)
agent_deb_amd64 +16.24 KiB (0.00% increase) 751.473 → 751.488 → 753.380
agent_deb_amd64_fips +16.24 KiB (0.00% increase) 708.436 → 708.452 → 713.900
agent_heroku_amd64 +4.24 KiB (0.00% increase) 313.107 → 313.112 → 320.580
agent_msi +24.5 KiB (0.00% increase) 604.553 → 604.576 → 1062.520
agent_rpm_amd64 +16.24 KiB (0.00% increase) 751.456 → 751.472 → 753.350
agent_rpm_amd64_fips +16.24 KiB (0.00% increase) 708.419 → 708.435 → 713.880
agent_rpm_arm64 +4.24 KiB (0.00% increase) 729.816 → 729.820 → 735.290
agent_rpm_arm64_fips +4.24 KiB (0.00% increase) 689.796 → 689.800 → 696.840
agent_suse_amd64 +16.24 KiB (0.00% increase) 751.456 → 751.472 → 753.350
agent_suse_amd64_fips +16.24 KiB (0.00% increase) 708.419 → 708.435 → 713.880
agent_suse_arm64 +4.24 KiB (0.00% increase) 729.816 → 729.820 → 735.290
agent_suse_arm64_fips +4.24 KiB (0.00% increase) 689.796 → 689.800 → 696.840
docker_agent_amd64 +16.25 KiB (0.00% increase) 811.780 → 811.796 → 815.700
docker_agent_arm64 +4.25 KiB (0.00% increase) 814.902 → 814.906 → 821.970
docker_agent_jmx_amd64 +16.24 KiB (0.00% increase) 1002.695 → 1002.711 → 1006.580
docker_agent_jmx_arm64 +4.24 KiB (0.00% increase) 994.596 → 994.600 → 1001.570
docker_cluster_agent_amd64 +4.0 KiB (0.00% increase) 205.308 → 205.312 → 206.270
iot_agent_deb_amd64 +8.0 KiB (0.02% increase) 43.238 → 43.246 → 43.290
iot_agent_deb_armhf +4.0 KiB (0.01% increase) 41.036 → 41.040 → 41.100
iot_agent_rpm_amd64 +8.0 KiB (0.02% increase) 43.238 → 43.246 → 43.290
iot_agent_suse_amd64 +8.0 KiB (0.02% increase) 43.238 → 43.246 → 43.290
10 successful checks with minimal change (< 2 KiB)
Quality gate Current Size
docker_cluster_agent_arm64 219.677 MiB
docker_cws_instrumentation_amd64 7.142 MiB
docker_cws_instrumentation_arm64 6.689 MiB
docker_dogstatsd_amd64 39.230 MiB
docker_dogstatsd_arm64 37.445 MiB
dogstatsd_deb_amd64 29.870 MiB
dogstatsd_deb_arm64 28.023 MiB
dogstatsd_rpm_amd64 29.870 MiB
dogstatsd_suse_amd64 29.870 MiB
iot_agent_deb_arm64 40.293 MiB
On-wire sizes (compressed)
Quality gate Change Size (prev → curr → max)
agent_deb_amd64 -32.88 KiB (0.02% reduction) 174.792 → 174.760 → 178.360
agent_deb_amd64_fips -10.99 KiB (0.01% reduction) 165.388 → 165.377 → 172.790
agent_heroku_amd64 -2.41 KiB (0.00% reduction) 74.968 → 74.965 → 79.970
agent_msi -4.0 KiB (0.00% reduction) 138.316 → 138.312 → 146.220
agent_rpm_amd64 -11.69 KiB (0.01% reduction) 177.614 → 177.603 → 181.830
agent_rpm_amd64_fips +11.6 KiB (0.01% increase) 167.560 → 167.571 → 173.370
agent_rpm_arm64 -34.84 KiB (0.02% reduction) 159.556 → 159.522 → 163.060
agent_rpm_arm64_fips -32.45 KiB (0.02% reduction) 151.433 → 151.401 → 156.170
agent_suse_amd64 -11.69 KiB (0.01% reduction) 177.614 → 177.603 → 181.830
agent_suse_amd64_fips +11.6 KiB (0.01% increase) 167.560 → 167.571 → 173.370
agent_suse_arm64 -34.84 KiB (0.02% reduction) 159.556 → 159.522 → 163.060
agent_suse_arm64_fips -32.45 KiB (0.02% reduction) 151.433 → 151.401 → 156.170
docker_agent_amd64 +7.6 KiB (0.00% increase) 268.072 → 268.079 → 272.480
docker_agent_arm64 -3.84 KiB (0.00% reduction) 255.294 → 255.290 → 261.060
docker_agent_jmx_amd64 +4.55 KiB (0.00% increase) 336.721 → 336.725 → 341.100
docker_agent_jmx_arm64 +3.04 KiB (0.00% increase) 319.924 → 319.927 → 325.620
docker_cluster_agent_amd64 -2.29 KiB (0.00% reduction) 71.930 → 71.927 → 72.920
docker_cluster_agent_arm64 neutral 67.504 MiB → 68.220
docker_cws_instrumentation_amd64 neutral 2.999 MiB → 3.330
docker_cws_instrumentation_arm64 neutral 2.729 MiB → 3.090
docker_dogstatsd_amd64 neutral 15.168 MiB → 15.820
docker_dogstatsd_arm64 neutral 14.486 MiB → 14.830
dogstatsd_deb_amd64 neutral 7.891 MiB → 8.790
dogstatsd_deb_arm64 neutral 6.777 MiB → 7.710
dogstatsd_rpm_amd64 neutral 7.902 MiB → 8.800
dogstatsd_suse_amd64 neutral 7.902 MiB → 8.800
iot_agent_deb_amd64 neutral 11.389 MiB → 12.040
iot_agent_deb_arm64 neutral 9.698 MiB → 10.450
iot_agent_deb_armhf neutral 9.932 MiB → 10.620
iot_agent_rpm_amd64 neutral 11.407 MiB → 12.060
iot_agent_suse_amd64 neutral 11.407 MiB → 12.060

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Mar 23, 2026

Copy link
Copy Markdown

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Run ID: 3c795844-da11-429d-8bb8-e06fed263771

Baseline: bb16b07
Comparison: eac9454
Diff

Optimization Goals: ✅ No significant changes detected

Experiments ignored for regressions

Regressions in experiments with settings containing erratic: true are ignored.

perf experiment goal Δ mean % Δ mean % CI trials links
docker_containers_cpu % cpu utilization -0.91 [-3.91, +2.09] 1 Logs

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
quality_gate_metrics_logs memory utilization +0.68 [+0.43, +0.92] 1 Logs bounds checks dashboard
ddot_logs memory utilization +0.33 [+0.27, +0.39] 1 Logs
tcp_syslog_to_blackhole ingress throughput +0.26 [+0.14, +0.38] 1 Logs
ddot_metrics_sum_cumulativetodelta_exporter memory utilization +0.22 [-0.00, +0.44] 1 Logs
uds_dogstatsd_20mb_12k_contexts_20_senders memory utilization +0.10 [+0.04, +0.16] 1 Logs
quality_gate_idle_all_features memory utilization +0.06 [+0.02, +0.09] 1 Logs bounds checks dashboard
file_to_blackhole_100ms_latency egress throughput +0.05 [-0.02, +0.12] 1 Logs
file_tree memory utilization +0.04 [-0.01, +0.10] 1 Logs
file_to_blackhole_0ms_latency egress throughput +0.02 [-0.45, +0.48] 1 Logs
file_to_blackhole_1000ms_latency egress throughput +0.02 [-0.42, +0.45] 1 Logs
quality_gate_idle memory utilization +0.00 [-0.05, +0.05] 1 Logs bounds checks dashboard
uds_dogstatsd_to_api ingress throughput -0.00 [-0.20, +0.19] 1 Logs
tcp_dd_logs_filter_exclude ingress throughput -0.00 [-0.11, +0.10] 1 Logs
file_to_blackhole_500ms_latency egress throughput -0.01 [-0.40, +0.38] 1 Logs
uds_dogstatsd_to_api_v3 ingress throughput -0.01 [-0.21, +0.19] 1 Logs
docker_containers_memory memory utilization -0.04 [-0.11, +0.03] 1 Logs
otlp_ingest_logs memory utilization -0.07 [-0.16, +0.03] 1 Logs
otlp_ingest_metrics memory utilization -0.10 [-0.25, +0.06] 1 Logs
ddot_metrics_sum_cumulative memory utilization -0.20 [-0.34, -0.05] 1 Logs
ddot_metrics_sum_delta memory utilization -0.30 [-0.46, -0.14] 1 Logs
ddot_metrics memory utilization -0.49 [-0.68, -0.31] 1 Logs
docker_containers_cpu % cpu utilization -0.91 [-3.91, +2.09] 1 Logs
quality_gate_logs % cpu utilization -1.45 [-3.03, +0.12] 1 Logs bounds checks dashboard

Bounds Checks: ✅ Passed

perf experiment bounds_check_name replicates_passed observed_value links
docker_containers_cpu simple_check_run 10/10 709 ≥ 26
docker_containers_memory memory_usage 10/10 275.90MiB ≤ 370MiB
docker_containers_memory simple_check_run 10/10 690 ≥ 26
file_to_blackhole_0ms_latency memory_usage 10/10 0.19GiB ≤ 1.20GiB
file_to_blackhole_0ms_latency missed_bytes 10/10 0B = 0B
file_to_blackhole_1000ms_latency memory_usage 10/10 0.23GiB ≤ 1.20GiB
file_to_blackhole_1000ms_latency missed_bytes 10/10 0B = 0B
file_to_blackhole_100ms_latency memory_usage 10/10 0.20GiB ≤ 1.20GiB
file_to_blackhole_100ms_latency missed_bytes 10/10 0B = 0B
file_to_blackhole_500ms_latency memory_usage 10/10 0.22GiB ≤ 1.20GiB
file_to_blackhole_500ms_latency missed_bytes 10/10 0B = 0B
quality_gate_idle intake_connections 10/10 3 = 3 bounds checks dashboard
quality_gate_idle memory_usage 10/10 173.78MiB ≤ 175MiB bounds checks dashboard
quality_gate_idle_all_features intake_connections 10/10 2 ≤ 3 bounds checks dashboard
quality_gate_idle_all_features memory_usage 10/10 502.95MiB ≤ 550MiB bounds checks dashboard
quality_gate_logs intake_connections 10/10 4 ≤ 6 bounds checks dashboard
quality_gate_logs memory_usage 10/10 204.04MiB ≤ 220MiB bounds checks dashboard
quality_gate_logs missed_bytes 10/10 0B = 0B bounds checks dashboard
quality_gate_metrics_logs cpu_usage 10/10 339.19 ≤ 2000 bounds checks dashboard
quality_gate_metrics_logs intake_connections 10/10 4 ≤ 6 bounds checks dashboard
quality_gate_metrics_logs memory_usage 10/10 426.50MiB ≤ 475MiB bounds checks dashboard
quality_gate_metrics_logs missed_bytes 10/10 0B = 0B bounds checks dashboard

Explanation

Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%

Performance changes are noted in the perf column of each table:

  • ✅ = significantly better comparison variant performance
  • ❌ = significantly worse comparison variant performance
  • ➖ = no significant change in performance

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

  3. Its configuration does not mark it "erratic".

CI Pass/Fail Decision

Passed. All Quality Gates passed.

  • quality_gate_metrics_logs, bounds check missed_bytes: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check cpu_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check missed_bytes: 10/10 replicas passed. Gate passed.
  • quality_gate_idle_all_features, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle_all_features, bounds check intake_connections: 10/10 replicas passed. Gate passed.

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit a6b9820 into 7.78.x Mar 24, 2026
647 of 650 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the backport-44544-to-7.78.x branch March 24, 2026 10:49
@github-actions github-actions Bot added this to the 7.78.0 milestone Mar 24, 2026
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.

2 participants