Skip to content

[ACTP] PAR: warn on misconfigured rshell allowed_paths entries#49948

Open
julesmcrt wants to merge 1 commit intojules.macret/Q/rshell/01-fix-bugsfrom
jules.macret/Q/rshell/02-warnings
Open

[ACTP] PAR: warn on misconfigured rshell allowed_paths entries#49948
julesmcrt wants to merge 1 commit intojules.macret/Q/rshell/01-fix-bugsfrom
jules.macret/Q/rshell/02-warnings

Conversation

@julesmcrt
Copy link
Copy Markdown
Contributor

What does this PR do?

Adds two advisory warnings at PAR config load that surface common allowed_paths misconfigurations which would otherwise silently fail at task execution:

  • Backslash entries: the operator-side allow-list is forward-slash (Linux-form) only; Windows-native paths never match the backend's Linux-style list.
  • Non-directory entries: rshell's sandbox is built on os.Root, which only accepts directory handles. File entries get silently dropped at runner creation, producing permission-denied for every open.

Both warnings are advisory — entries still flow through to the handler; the warnings make the silent-failure modes observable in agent logs.

Stacked on top of #49945 (PR1 in the split)

This is PR2 of 4 splitting #49825. Base: PR1 branch. Will retarget to main after PR1 lands.

Describe how you validated your changes

  • New pass-through tests in transform_test.go verify that backslash and non-directory entries flow to the handler unchanged (the warnings are side effects).
  • All 36 tests in pkg/privateactionrunner/adapters/config pass; linter clean.

🤖 Generated with Claude Code

Two advisory warnings at config load surface misconfigurations that
would otherwise silently fail at task execution:

- Backslash entries: the operator-side allow-list is forward-slash only
  (Linux form). Windows-native paths never match the backend's
  Linux-style entries.
- Non-directory entries: rshell's sandbox is built on os.Root, which
  only accepts directory handles. File entries get silently dropped at
  runner creation, producing permission-denied for every open with no
  operator-facing message.

Both warnings are advisory — entries still flow through to the handler;
the warnings make the silent-failure modes observable in agent logs.
@julesmcrt julesmcrt requested a review from a team as a code owner April 27, 2026 17:34
@julesmcrt julesmcrt requested review from asiya-sh and removed request for a team April 27, 2026 17:34
@julesmcrt julesmcrt added changelog/no-changelog No changelog entry needed qa/rc-required Only for a PR that requires validation on the Release Candidate backport/7.79.x Automatically create a backport PR to the 7.79.x branch once the PR is merged labels Apr 27, 2026
@datadog-prod-us1-3
Copy link
Copy Markdown
Contributor

datadog-prod-us1-3 Bot commented Apr 27, 2026

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 50.21%

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

@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented Apr 27, 2026

Files inventory check summary

File checks results against ancestor c1888d89:

Results for datadog-agent_7.80.0~devel.git.264.da001c9.pipeline.109970833-1_amd64.deb:

No change detected

@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented Apr 27, 2026

Static quality checks

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

Successful checks

Info

Quality gate Change Size (prev → curr → max)
agent_deb_amd64 +4.0 KiB (0.00% increase) 738.997 → 739.001 → 750.310
agent_msi +6.5 KiB (0.00% increase) 604.157 → 604.163 → 620.770
agent_rpm_amd64 +4.0 KiB (0.00% increase) 738.980 → 738.984 → 750.280
agent_rpm_arm64 +4.0 KiB (0.00% increase) 717.073 → 717.077 → 724.050
agent_suse_amd64 +4.0 KiB (0.00% increase) 738.980 → 738.984 → 750.280
agent_suse_arm64 +4.0 KiB (0.00% increase) 717.073 → 717.077 → 724.050
docker_agent_amd64 +4.0 KiB (0.00% increase) 799.455 → 799.459 → 805.870
docker_agent_arm64 +4.0 KiB (0.00% increase) 802.357 → 802.361 → 809.730
docker_agent_jmx_amd64 +4.0 KiB (0.00% increase) 990.375 → 990.378 → 996.590
docker_agent_jmx_arm64 +4.01 KiB (0.00% increase) 982.055 → 982.059 → 989.410
21 successful checks with minimal change (< 2 KiB)
Quality gate Current Size
agent_deb_amd64_fips 697.423 MiB
agent_heroku_amd64 309.103 MiB
agent_rpm_amd64_fips 697.407 MiB
agent_rpm_arm64_fips 678.532 MiB
agent_suse_amd64_fips 697.407 MiB
agent_suse_arm64_fips 678.532 MiB
docker_cluster_agent_amd64 206.269 MiB
docker_cluster_agent_arm64 220.383 MiB
docker_cws_instrumentation_amd64 7.142 MiB
docker_cws_instrumentation_arm64 6.689 MiB
docker_dogstatsd_amd64 39.347 MiB
docker_dogstatsd_arm64 37.565 MiB
dogstatsd_deb_amd64 30.001 MiB
dogstatsd_deb_arm64 28.142 MiB
dogstatsd_rpm_amd64 30.001 MiB
dogstatsd_suse_amd64 30.001 MiB
iot_agent_deb_amd64 44.372 MiB
iot_agent_deb_arm64 41.361 MiB
iot_agent_deb_armhf 42.097 MiB
iot_agent_rpm_amd64 44.373 MiB
iot_agent_suse_amd64 44.373 MiB
On-wire sizes (compressed)
Quality gate Change Size (prev → curr → max)
agent_deb_amd64 -19.82 KiB (0.01% reduction) 174.984 → 174.965 → 179.160
agent_deb_amd64_fips +23.39 KiB (0.01% increase) 166.645 → 166.668 → 174.440
agent_heroku_amd64 neutral 74.913 MiB → 80.310
agent_msi -8.0 KiB (0.01% reduction) 139.270 → 139.262 → 147.550
agent_rpm_amd64 +29.4 KiB (0.02% increase) 176.944 → 176.972 → 182.080
agent_rpm_amd64_fips +16.8 KiB (0.01% increase) 168.007 → 168.023 → 174.140
agent_rpm_arm64 -3.43 KiB (0.00% reduction) 159.252 → 159.248 → 163.610
agent_rpm_arm64_fips +8.65 KiB (0.01% increase) 151.449 → 151.457 → 156.850
agent_suse_amd64 +29.4 KiB (0.02% increase) 176.944 → 176.972 → 182.080
agent_suse_amd64_fips +16.8 KiB (0.01% increase) 168.007 → 168.023 → 174.140
agent_suse_arm64 -3.43 KiB (0.00% reduction) 159.252 → 159.248 → 163.610
agent_suse_arm64_fips +8.65 KiB (0.01% increase) 151.449 → 151.457 → 156.850
docker_agent_amd64 +21.37 KiB (0.01% increase) 267.115 → 267.136 → 272.990
docker_agent_arm64 +2.45 KiB (0.00% increase) 254.142 → 254.145 → 261.470
docker_agent_jmx_amd64 +16.99 KiB (0.00% increase) 335.778 → 335.795 → 341.610
docker_agent_jmx_arm64 +12.39 KiB (0.00% increase) 318.782 → 318.794 → 326.050
docker_cluster_agent_amd64 +2.97 KiB (0.00% increase) 72.297 → 72.300 → 73.460
docker_cluster_agent_arm64 -2.13 KiB (0.00% reduction) 67.762 → 67.760 → 68.680
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.229 MiB → 15.870
docker_dogstatsd_arm64 neutral 14.549 MiB → 14.890
dogstatsd_deb_amd64 neutral 7.936 MiB → 8.830
dogstatsd_deb_arm64 +2.43 KiB (0.03% increase) 6.818 → 6.820 → 7.750
dogstatsd_rpm_amd64 neutral 7.946 MiB → 8.840
dogstatsd_suse_amd64 neutral 7.946 MiB → 8.840
iot_agent_deb_amd64 -2.2 KiB (0.02% reduction) 11.678 → 11.676 → 13.210
iot_agent_deb_arm64 +2.2 KiB (0.02% increase) 9.981 → 9.983 → 11.620
iot_agent_deb_armhf neutral 10.186 MiB → 11.780
iot_agent_rpm_amd64 neutral 11.695 MiB → 13.230
iot_agent_suse_amd64 neutral 11.695 MiB → 13.230

@cit-pr-commenter-54b7da
Copy link
Copy Markdown

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Run ID: af292094-2fda-4328-8911-d1c32e4f3be5

Baseline: b15fe93
Comparison: da001c9
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 +4.57 [+1.55, +7.58] 1 Logs

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
docker_containers_cpu % cpu utilization +4.57 [+1.55, +7.58] 1 Logs
quality_gate_metrics_logs memory utilization +1.65 [+1.39, +1.90] 1 Logs bounds checks dashboard
ddot_metrics_sum_cumulative memory utilization +0.80 [+0.64, +0.96] 1 Logs
ddot_metrics_sum_delta memory utilization +0.69 [+0.50, +0.87] 1 Logs
quality_gate_idle memory utilization +0.24 [+0.19, +0.29] 1 Logs bounds checks dashboard
uds_dogstatsd_20mb_12k_contexts_20_senders memory utilization +0.18 [+0.13, +0.23] 1 Logs
quality_gate_idle_all_features memory utilization +0.13 [+0.10, +0.17] 1 Logs bounds checks dashboard
docker_containers_memory memory utilization +0.11 [+0.01, +0.21] 1 Logs
file_to_blackhole_500ms_latency egress throughput +0.10 [-0.29, +0.49] 1 Logs
ddot_metrics_sum_cumulativetodelta_exporter memory utilization +0.08 [-0.16, +0.32] 1 Logs
file_to_blackhole_1000ms_latency egress throughput +0.07 [-0.37, +0.50] 1 Logs
file_to_blackhole_0ms_latency egress throughput +0.06 [-0.45, +0.57] 1 Logs
file_to_blackhole_100ms_latency egress throughput +0.04 [-0.06, +0.14] 1 Logs
otlp_ingest_metrics memory utilization +0.03 [-0.13, +0.19] 1 Logs
uds_dogstatsd_to_api ingress throughput +0.02 [-0.19, +0.24] 1 Logs
file_tree memory utilization +0.02 [-0.03, +0.06] 1 Logs
tcp_dd_logs_filter_exclude ingress throughput -0.00 [-0.11, +0.11] 1 Logs
uds_dogstatsd_to_api_v3 ingress throughput -0.01 [-0.21, +0.19] 1 Logs
quality_gate_logs % cpu utilization -0.12 [-1.09, +0.85] 1 Logs bounds checks dashboard
otlp_ingest_logs memory utilization -0.43 [-0.54, -0.32] 1 Logs
ddot_logs memory utilization -0.76 [-0.83, -0.69] 1 Logs
ddot_metrics memory utilization -0.79 [-0.97, -0.61] 1 Logs
tcp_syslog_to_blackhole ingress throughput -1.30 [-1.48, -1.12] 1 Logs

Bounds Checks: ✅ Passed

perf experiment bounds_check_name replicates_passed observed_value links
docker_containers_cpu simple_check_run 10/10 691 ≥ 26
docker_containers_memory memory_usage 10/10 244.80MiB ≤ 370MiB
docker_containers_memory simple_check_run 10/10 681 ≥ 26
file_to_blackhole_0ms_latency memory_usage 10/10 0.16GiB ≤ 1.20GiB
file_to_blackhole_0ms_latency missed_bytes 10/10 0B = 0B
file_to_blackhole_1000ms_latency memory_usage 10/10 0.21GiB ≤ 1.20GiB
file_to_blackhole_1000ms_latency missed_bytes 10/10 0B = 0B
file_to_blackhole_100ms_latency memory_usage 10/10 0.17GiB ≤ 1.20GiB
file_to_blackhole_100ms_latency missed_bytes 10/10 0B = 0B
file_to_blackhole_500ms_latency memory_usage 10/10 0.18GiB ≤ 1.20GiB
file_to_blackhole_500ms_latency missed_bytes 10/10 0B = 0B
quality_gate_idle intake_connections 10/10 3 ≤ 4 bounds checks dashboard
quality_gate_idle memory_usage 10/10 141.00MiB ≤ 147MiB bounds checks dashboard
quality_gate_idle_all_features intake_connections 10/10 3 ≤ 4 bounds checks dashboard
quality_gate_idle_all_features memory_usage 10/10 465.97MiB ≤ 495MiB bounds checks dashboard
quality_gate_logs intake_connections 10/10 4 ≤ 6 bounds checks dashboard
quality_gate_logs memory_usage 10/10 172.55MiB ≤ 195MiB bounds checks dashboard
quality_gate_logs missed_bytes 10/10 0B = 0B bounds checks dashboard
quality_gate_metrics_logs cpu_usage 10/10 344.83 ≤ 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 376.01MiB ≤ 430MiB 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 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.
  • quality_gate_metrics_logs, bounds check memory_usage: 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_logs, 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_idle_all_features, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/7.79.x Automatically create a backport PR to the 7.79.x branch once the PR is merged changelog/no-changelog No changelog entry needed qa/rc-required Only for a PR that requires validation on the Release Candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant