datadog-agent icon indicating copy to clipboard operation
datadog-agent copied to clipboard

[CWS-3907] Enable security profiles for systemd cgroups

Open mftoure opened this issue 5 months ago • 5 comments

What does this PR do?

This PR enabled security profiles for systemd cgroups, thus, enabling anomaly detection events for these cgroups.

Motivation

Describe how you validated your changes

Possible Drawbacks / Trade-offs

Additional Notes

mftoure avatar Jun 02 '25 13:06 mftoure

Uncompressed package size comparison

Comparison with ancestor 4807f2b13a71535baf4df0d073f455627082a46a

Diff per package
package diff status size ancestor threshold
datadog-agent-arm64-deb 0.01MB ⚠️ 765.12MB 765.12MB 0.50MB
datadog-agent-aarch64-rpm 0.01MB ⚠️ 774.05MB 774.05MB 0.50MB
datadog-agent-x86_64-rpm 0.00MB 784.79MB 784.78MB 0.50MB
datadog-agent-x86_64-suse 0.00MB 784.79MB 784.78MB 0.50MB
datadog-agent-amd64-deb 0.00MB 775.83MB 775.83MB 0.50MB
datadog-dogstatsd-amd64-deb 0.00MB 31.23MB 31.23MB 0.50MB
datadog-dogstatsd-x86_64-rpm 0.00MB 31.31MB 31.31MB 0.50MB
datadog-dogstatsd-x86_64-suse 0.00MB 31.31MB 31.31MB 0.50MB
datadog-dogstatsd-arm64-deb 0.00MB 30.05MB 30.05MB 0.50MB
datadog-heroku-agent-amd64-deb 0.00MB 379.44MB 379.44MB 0.50MB
datadog-iot-agent-amd64-deb 0.00MB 61.78MB 61.78MB 0.50MB
datadog-iot-agent-x86_64-rpm 0.00MB 61.86MB 61.86MB 0.50MB
datadog-iot-agent-x86_64-suse 0.00MB 61.86MB 61.86MB 0.50MB
datadog-iot-agent-arm64-deb 0.00MB 59.01MB 59.01MB 0.50MB
datadog-iot-agent-aarch64-rpm 0.00MB 59.09MB 59.09MB 0.50MB

Decision

⚠️ Warning

Static quality checks

✅ Please find below the results from static quality gates Comparison made with ancestor d4c2b194a81f7d8e6458c6c45488185fd425b695

Successful checks

Info

Quality gate Delta On disk size (MiB) Delta On wire size (MiB)
agent_deb_amd64 $${+0.05}$$ $${702.27}$$ < $${702.41}$$ $${-0.01}$$ $${177.24}$$ < $${178.15}$$
agent_deb_amd64_fips $${+0.05}$$ $${696.75}$$ < $${696.89}$$ $${-0.05}$$ $${175.93}$$ < $${177.15}$$
agent_heroku_amd64 $${0}$$ $${340.16}$$ < $${340.9}$$ $${+0.01}$$ $${90.41}$$ < $${91.41}$$
agent_msi $${+0}$$ $${985.64}$$ < $${986.58}$$ $${-0.01}$$ $${151.14}$$ < $${152.13}$$
agent_rpm_amd64 $${+0.05}$$ $${702.26}$$ < $${702.4}$$ $${-0.05}$$ $${179.48}$$ < $${180.32}$$
agent_rpm_amd64_fips $${+0.05}$$ $${696.74}$$ < $${696.88}$$ $${+0.03}$$ $${177.92}$$ < $${178.79}$$
agent_rpm_arm64 $${+0.05}$$ $${689.01}$$ < $${689.18}$$ $${-0.02}$$ $${161.1}$$ < $${162.11}$$
agent_rpm_arm64_fips $${+0.04}$$ $${684.27}$$ < $${684.44}$$ $${+0.06}$$ $${160.02}$$ < $${161.0}$$
agent_suse_amd64 $${+0.05}$$ $${702.26}$$ < $${702.4}$$ $${-0.05}$$ $${179.48}$$ < $${180.32}$$
agent_suse_amd64_fips $${+0.05}$$ $${696.74}$$ < $${696.88}$$ $${+0.03}$$ $${177.92}$$ < $${178.79}$$
agent_suse_arm64 $${+0.05}$$ $${689.01}$$ < $${689.18}$$ $${-0.02}$$ $${161.1}$$ < $${162.11}$$
agent_suse_arm64_fips $${+0.04}$$ $${684.27}$$ < $${684.44}$$ $${+0.06}$$ $${160.02}$$ < $${161.0}$$
docker_agent_amd64 $${+0.05}$$ $${773.65}$$ < $${773.82}$$ $${-0}$$ $${265.43}$$ < $${266.25}$$
docker_agent_arm64 $${+0.05}$$ $${784.33}$$ < $${784.56}$$ $${+0.03}$$ $${251.87}$$ < $${252.72}$$
docker_agent_jmx_amd64 $${+0.05}$$ $${964.51}$$ < $${964.69}$$ $${+0.01}$$ $${334.06}$$ < $${334.88}$$
docker_agent_jmx_arm64 $${+0.05}$$ $${963.79}$$ < $${964.02}$$ $${+0}$$ $${316.48}$$ < $${317.33}$$
docker_cluster_agent_amd64 $${+0}$$ $${213.08}$$ < $${213.74}$$ $${-0}$$ $${72.33}$$ < $${73.2}$$
docker_cluster_agent_arm64 $${-0}$$ $${228.97}$$ < $${229.68}$$ $${-0.01}$$ $${68.59}$$ < $${69.48}$$
docker_cws_instrumentation_amd64 $${0}$$ $${7.06}$$ < $${7.12}$$ $${+0}$$ $${2.95}$$ < $${3.29}$$
docker_cws_instrumentation_arm64 $${0}$$ $${6.69}$$ < $${6.92}$$ $${+0}$$ $${2.7}$$ < $${3.07}$$
docker_dogstatsd_amd64 $${-0}$$ $${38.41}$$ < $${39.3}$$ $${-0}$$ $${14.83}$$ < $${15.76}$$
docker_dogstatsd_arm64 $${0}$$ $${37.05}$$ < $${37.94}$$ $${-0.01}$$ $${14.28}$$ < $${14.83}$$
dogstatsd_deb_amd64 $${0}$$ $${29.64}$$ < $${30.53}$$ $${-0}$$ $${7.82}$$ < $${8.75}$$
dogstatsd_deb_arm64 $${0}$$ $${28.22}$$ < $${29.12}$$ $${+0}$$ $${6.77}$$ < $${7.71}$$
dogstatsd_rpm_amd64 $${0}$$ $${29.64}$$ < $${30.53}$$ $${-0}$$ $${7.83}$$ < $${8.77}$$
dogstatsd_suse_amd64 $${0}$$ $${29.64}$$ < $${30.53}$$ $${-0}$$ $${7.83}$$ < $${8.77}$$
iot_agent_deb_amd64 $${0}$$ $${54.37}$$ < $${54.97}$$ $${-0}$$ $${13.58}$$ < $${14.45}$$
iot_agent_deb_arm64 $${0}$$ $${51.66}$$ < $${51.9}$$ $${+0}$$ $${11.71}$$ < $${12.63}$$
iot_agent_deb_armhf $${0}$$ $${51.22}$$ < $${51.84}$$ $${-0}$$ $${11.79}$$ < $${12.74}$$
iot_agent_rpm_amd64 $${0}$$ $${54.37}$$ < $${54.97}$$ $${+0}$$ $${13.6}$$ < $${14.47}$$
iot_agent_suse_amd64 $${0}$$ $${54.37}$$ < $${54.97}$$ $${+0}$$ $${13.6}$$ < $${14.47}$$

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Run ID: 0b011f45-7d5f-42a1-a004-482b3e980928

Baseline: b8a1cdff7940155ccccd7024cf845531ce4b6d93 Comparison: b31e0c3bf5ddae0f4cff70d4335ce0f2885afae5 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 -19.75 [-22.66, -16.84] 1 Logs

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
quality_gate_logs % cpu utilization +2.06 [-0.73, +4.85] 1 Logs bounds checks dashboard
quality_gate_metrics_logs memory utilization +1.22 [+1.01, +1.42] 1 Logs bounds checks dashboard
ddot_metrics_sum_cumulative memory utilization +0.85 [+0.69, +1.02] 1 Logs
uds_dogstatsd_20mb_12k_contexts_20_senders memory utilization +0.70 [+0.66, +0.75] 1 Logs
ddot_metrics_sum_delta memory utilization +0.27 [+0.13, +0.42] 1 Logs
file_tree memory utilization +0.27 [+0.24, +0.31] 1 Logs
otlp_ingest_metrics memory utilization +0.17 [+0.05, +0.29] 1 Logs
quality_gate_idle_all_features memory utilization +0.16 [+0.12, +0.19] 1 Logs bounds checks dashboard
ddot_metrics memory utilization +0.11 [-0.06, +0.27] 1 Logs
file_to_blackhole_1000ms_latency egress throughput +0.08 [-0.48, +0.64] 1 Logs
quality_gate_idle memory utilization +0.05 [-0.02, +0.12] 1 Logs bounds checks dashboard
file_to_blackhole_0ms_latency egress throughput +0.04 [-0.55, +0.63] 1 Logs
tcp_syslog_to_blackhole ingress throughput +0.03 [-0.07, +0.13] 1 Logs
tcp_dd_logs_filter_exclude ingress throughput -0.00 [-0.01, +0.01] 1 Logs
file_to_blackhole_100ms_latency egress throughput -0.01 [-0.63, +0.61] 1 Logs
file_to_blackhole_500ms_latency egress throughput -0.02 [-0.67, +0.63] 1 Logs
uds_dogstatsd_to_api ingress throughput -0.03 [-0.27, +0.21] 1 Logs
otlp_ingest_logs memory utilization -0.11 [-0.22, +0.00] 1 Logs
ddot_metrics_sum_cumulativetodelta_exporter memory utilization -0.17 [-0.36, +0.03] 1 Logs
ddot_logs memory utilization -0.47 [-0.53, -0.42] 1 Logs
docker_containers_memory memory utilization -2.26 [-2.37, -2.14] 1 Logs
docker_containers_cpu % cpu utilization -19.75 [-22.66, -16.84] 1 Logs

Bounds Checks: ✅ Passed

perf experiment bounds_check_name replicates_passed links
docker_containers_cpu simple_check_run 10/10
docker_containers_memory memory_usage 10/10
docker_containers_memory simple_check_run 10/10
file_to_blackhole_0ms_latency lost_bytes 10/10
file_to_blackhole_0ms_latency memory_usage 10/10
file_to_blackhole_1000ms_latency memory_usage 10/10
file_to_blackhole_100ms_latency lost_bytes 10/10
file_to_blackhole_100ms_latency memory_usage 10/10
file_to_blackhole_500ms_latency lost_bytes 10/10
file_to_blackhole_500ms_latency memory_usage 10/10
quality_gate_idle intake_connections 10/10 bounds checks dashboard
quality_gate_idle memory_usage 10/10 bounds checks dashboard
quality_gate_idle_all_features intake_connections 10/10 bounds checks dashboard
quality_gate_idle_all_features memory_usage 10/10 bounds checks dashboard
quality_gate_logs intake_connections 10/10 bounds checks dashboard
quality_gate_logs lost_bytes 10/10 bounds checks dashboard
quality_gate_logs memory_usage 10/10 bounds checks dashboard
quality_gate_metrics_logs cpu_usage 10/10 bounds checks dashboard
quality_gate_metrics_logs intake_connections 10/10 bounds checks dashboard
quality_gate_metrics_logs lost_bytes 10/10 bounds checks dashboard
quality_gate_metrics_logs memory_usage 10/10 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_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check lost_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 intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, 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_all_features, 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 memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check lost_bytes: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.

cit-pr-commenter[bot] avatar Jun 03 '25 16:06 cit-pr-commenter[bot]

In addition to my first comments, this should unlock profile based feature like anomalies and auto-suppression right? It would be great if you could add functional tests for all the "basic" profile features here (yeah I know .. just thinking about it's already too tedious xD)

spikat avatar Jun 05 '25 16:06 spikat

Another question: I didn't yet took a deep dive into it but: how are we handling "warm-up period" for cgroup profiles? The same way as we are for container's ones?

spikat avatar Jun 05 '25 16:06 spikat

/merge

mftoure avatar Sep 16 '25 11:09 mftoure

View all feedbacks in Devflow UI.

2025-09-16 11:53:05 UTC :information_source: Start processing command /merge


2025-09-16 11:53:13 UTC :information_source: MergeQueue: waiting for PR to be ready

This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals. Note: if you pushed new commits since the last approval, you may need additional approval. You can remove it from the waiting list with /remove command.


2025-09-16 15:54:06 UTC :warning: MergeQueue: This merge request was unqueued

devflow unqueued this merge request: It did not become mergeable within the expected time

/merge

mftoure avatar Sep 17 '25 08:09 mftoure

View all feedbacks in Devflow UI.

2025-09-17 08:49:52 UTC :information_source: Start processing command /merge


2025-09-17 08:49:56 UTC :information_source: MergeQueue: pull request added to the queue

The expected merge time in main is approximately 32m (p90).


2025-09-17 09:05:35 UTC :information_source: MergeQueue: This merge request was merged