[DO NOT MERGE] Testing Config Provider Integrations Security#47971
[DO NOT MERGE] Testing Config Provider Integrations Security#47971NouemanKHAL wants to merge 33 commits into
Conversation
…d-provider-base-check
Files inventory check summaryFile checks results against ancestor d953a5b5: Results for datadog-agent_7.78.0~devel.git.753.d21dce7.pipeline.103668637-1_amd64.deb:Detected file changes:
|
Static quality checks✅ Please find below the results from static quality gates Successful checksInfo
11 successful checks with minimal change (< 2 KiB)
On-wire sizes (compressed)
|
Regression DetectorRegression Detector ResultsMetrics dashboard Baseline: d953a5b Optimization Goals: ✅ No significant changes detected
|
| perf | experiment | goal | Δ mean % | Δ mean % CI | trials | links |
|---|---|---|---|---|---|---|
| ➖ | docker_containers_cpu | % cpu utilization | -1.90 | [-4.83, +1.03] | 1 | Logs |
Fine details of change detection per experiment
| perf | experiment | goal | Δ mean % | Δ mean % CI | trials | links |
|---|---|---|---|---|---|---|
| ➖ | quality_gate_metrics_logs | memory utilization | +1.52 | [+1.28, +1.76] | 1 | Logs bounds checks dashboard |
| ➖ | ddot_metrics_sum_cumulative | memory utilization | +0.69 | [+0.54, +0.83] | 1 | Logs |
| ➖ | otlp_ingest_metrics | memory utilization | +0.60 | [+0.45, +0.76] | 1 | Logs |
| ➖ | ddot_metrics_sum_cumulativetodelta_exporter | memory utilization | +0.47 | [+0.24, +0.69] | 1 | Logs |
| ➖ | ddot_metrics | memory utilization | +0.34 | [+0.16, +0.52] | 1 | Logs |
| ➖ | uds_dogstatsd_20mb_12k_contexts_20_senders | memory utilization | +0.24 | [+0.18, +0.30] | 1 | Logs |
| ➖ | docker_containers_memory | memory utilization | +0.10 | [+0.02, +0.17] | 1 | Logs |
| ➖ | file_to_blackhole_0ms_latency | egress throughput | +0.04 | [-0.45, +0.53] | 1 | Logs |
| ➖ | file_to_blackhole_100ms_latency | egress throughput | +0.04 | [-0.06, +0.14] | 1 | Logs |
| ➖ | tcp_dd_logs_filter_exclude | ingress throughput | +0.00 | [-0.11, +0.11] | 1 | Logs |
| ➖ | uds_dogstatsd_to_api | ingress throughput | -0.00 | [-0.21, +0.20] | 1 | Logs |
| ➖ | uds_dogstatsd_to_api_v3 | ingress throughput | -0.01 | [-0.21, +0.19] | 1 | Logs |
| ➖ | ddot_metrics_sum_delta | memory utilization | -0.05 | [-0.22, +0.12] | 1 | Logs |
| ➖ | file_to_blackhole_500ms_latency | egress throughput | -0.08 | [-0.47, +0.32] | 1 | Logs |
| ➖ | quality_gate_idle_all_features | memory utilization | -0.12 | [-0.15, -0.08] | 1 | Logs bounds checks dashboard |
| ➖ | file_to_blackhole_1000ms_latency | egress throughput | -0.12 | [-0.56, +0.31] | 1 | Logs |
| ➖ | file_tree | memory utilization | -0.17 | [-0.22, -0.12] | 1 | Logs |
| ➖ | quality_gate_idle | memory utilization | -0.20 | [-0.25, -0.14] | 1 | Logs bounds checks dashboard |
| ➖ | quality_gate_logs | % cpu utilization | -0.20 | [-1.79, +1.39] | 1 | Logs bounds checks dashboard |
| ➖ | otlp_ingest_logs | memory utilization | -0.29 | [-0.39, -0.19] | 1 | Logs |
| ➖ | ddot_logs | memory utilization | -0.57 | [-0.65, -0.50] | 1 | Logs |
| ➖ | tcp_syslog_to_blackhole | ingress throughput | -1.47 | [-1.61, -1.33] | 1 | Logs |
| ➖ | docker_containers_cpu | % cpu utilization | -1.90 | [-4.83, +1.03] | 1 | Logs |
Bounds Checks: ✅ Passed
| perf | experiment | bounds_check_name | replicates_passed | observed_value | links |
|---|---|---|---|---|---|
| ✅ | docker_containers_cpu | simple_check_run | 10/10 | 699 ≥ 26 | |
| ✅ | docker_containers_memory | memory_usage | 10/10 | 273.39MiB ≤ 370MiB | |
| ✅ | docker_containers_memory | simple_check_run | 10/10 | 723 ≥ 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.19GiB ≤ 1.20GiB | |
| ✅ | file_to_blackhole_100ms_latency | missed_bytes | 10/10 | 0B = 0B | |
| ✅ | file_to_blackhole_500ms_latency | memory_usage | 10/10 | 0.21GiB ≤ 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 | 174.53MiB ≤ 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 | 500.93MiB ≤ 550MiB | bounds checks dashboard |
| ✅ | quality_gate_logs | intake_connections | 10/10 | 4 ≤ 6 | bounds checks dashboard |
| ✅ | quality_gate_logs | memory_usage | 10/10 | 201.79MiB ≤ 220MiB | bounds checks dashboard |
| ✅ | quality_gate_logs | missed_bytes | 10/10 | 0B = 0B | bounds checks dashboard |
| ✅ | quality_gate_metrics_logs | cpu_usage | 10/10 | 367.41 ≤ 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 | 420.55MiB ≤ 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:
-
Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.
-
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.
-
Its configuration does not mark it "erratic".
CI Pass/Fail Decision
✅ Passed. All Quality Gates 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_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_idle_all_features, bounds check intake_connections: 10/10 replicas passed. Gate passed.
- quality_gate_idle_all_features, bounds check memory_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 cpu_usage: 10/10 replicas passed. Gate passed.
- quality_gate_metrics_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.
- quality_gate_metrics_logs, bounds check missed_bytes: 10/10 replicas passed. Gate passed.
- Assert provider value in CGo test mocks (get_check and get_check_deprecated) - Add ConfigProvider() to check.Info interface for symmetry with ConfigSource() - Move source/provider assignments out of handleConf closure in CheckBase Co-Authored-By: Claude Opus 4.6 <[email protected]>
…d-provider-base-check
a1f7366 to
b35c6bb
Compare
### 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]>
… ### 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]>
…nt checks (#48225) 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 #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: ali.benabdallah <[email protected]>
What does this PR do?
Motivation
Describe how you validated your changes
Additional Notes