-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CWS] add security profile sliding window #20506
Conversation
Go Package Import DifferencesBaseline: 8ac53d3
|
b1d3006
to
bdfe288
Compare
Bloop Bleep... Dogbot HereRegression Detector ResultsRun ID: 64464f39-e758-4179-8758-c68149388ade Performance changes are noted in the perf column of each table:
Experiments with missing or malformed data
Usually, this warning means that there is no usable optimization goal data for that experiment, which could be a result of misconfiguration. No significant changes in experiment optimization goalsConfidence level: 90.00% There were no significant changes in experiment optimization goals at this confidence level and effect size tolerance.
|
perf | experiment | goal | Δ mean % | Δ mean % CI |
---|---|---|---|---|
➖ | file_to_blackhole | % cpu utilization | -0.71 | [-7.25, +5.83] |
Fine details of change detection per experiment
perf | experiment | goal | Δ mean % | Δ mean % CI |
---|---|---|---|---|
➖ | process_agent_standard_check_with_stats | memory utilization | +0.13 | [+0.10, +0.17] |
➖ | trace_agent_msgpack | ingress throughput | +0.00 | [-0.01, +0.01] |
➖ | uds_dogstatsd_to_api | ingress throughput | +0.00 | [-0.00, +0.00] |
➖ | tcp_dd_logs_filter_exclude | ingress throughput | +0.00 | [-0.00, +0.00] |
➖ | trace_agent_json | ingress throughput | -0.03 | [-0.06, +0.00] |
➖ | process_agent_standard_check | memory utilization | -0.03 | [-0.08, +0.01] |
➖ | process_agent_real_time_mode | memory utilization | -0.21 | [-0.24, -0.18] |
➖ | tcp_syslog_to_blackhole | ingress throughput | -0.49 | [-0.55, -0.43] |
➖ | otel_to_otel_logs | ingress throughput | -0.49 | [-1.08, +0.09] |
➖ | idle | memory utilization | -0.61 | [-0.64, -0.57] |
➖ | file_tree | memory utilization | -0.64 | [-0.72, -0.55] |
➖ | file_to_blackhole | % cpu utilization | -0.71 | [-7.25, +5.83] |
➖ | uds_dogstatsd_to_api_cpu | % cpu utilization | -1.36 | [-2.76, +0.05] |
Explanation
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".
47376b8
to
b4e75e7
Compare
3f62ad0
to
149792b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the manager.OnCGroupDeletedEvent
function should use the profile selector ("*"
) instead of the one from the cgroup model parameter. Otherwise the manager fails to lookup the corresponding profile.
Thanks, good catch! Fixed in the last commit :) |
34345c7
to
8e628c6
Compare
0ba3ec4
to
00d5ff9
Compare
Test changes on VMUse this command from test-infra-definitions to manually test this PR changes on a VM: inv create-vm --pipeline-id=30615551 --os-family=ubuntu |
Regression DetectorRegression Detector ResultsRun ID: 0976b26-6bbd-4e0b-bb34-8a8b9b6f15d1 Performance changes are noted in the perf column of each table:
No significant changes in experiment optimization goalsConfidence level: 90.00% There were no significant changes in experiment optimization goals at this confidence level and effect size tolerance.
|
perf | experiment | goal | Δ mean % | Δ mean % CI |
---|---|---|---|---|
➖ | file_to_blackhole | % cpu utilization | +0.58 | [-5.76, +6.93] |
Fine details of change detection per experiment
perf | experiment | goal | Δ mean % | Δ mean % CI |
---|---|---|---|---|
➖ | pycheck_1000_100byte_tags | % cpu utilization | +1.24 | [-3.68, +6.15] |
➖ | file_to_blackhole | % cpu utilization | +0.58 | [-5.76, +6.93] |
➖ | uds_dogstatsd_to_api_cpu | % cpu utilization | +0.44 | [-2.27, +3.15] |
➖ | process_agent_standard_check_with_stats | memory utilization | +0.19 | [+0.15, +0.22] |
➖ | tcp_dd_logs_filter_exclude | ingress throughput | +0.05 | [+0.02, +0.08] |
➖ | trace_agent_json | ingress throughput | +0.00 | [-0.04, +0.04] |
➖ | uds_dogstatsd_to_api | ingress throughput | +0.00 | [-0.20, +0.20] |
➖ | process_agent_standard_check | memory utilization | -0.03 | [-0.06, +0.00] |
➖ | trace_agent_msgpack | ingress throughput | -0.03 | [-0.05, -0.02] |
➖ | idle | memory utilization | -0.22 | [-0.25, -0.18] |
➖ | basic_py_check | % cpu utilization | -0.26 | [-2.78, +2.26] |
➖ | otel_to_otel_logs | ingress throughput | -0.26 | [-0.69, +0.16] |
➖ | tcp_syslog_to_blackhole | ingress throughput | -0.41 | [-0.50, -0.33] |
➖ | process_agent_real_time_mode | memory utilization | -0.45 | [-0.48, -0.41] |
➖ | file_tree | memory utilization | -1.03 | [-1.11, -0.94] |
Explanation
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".
77aac6e
to
ca413c2
Compare
f0faff6
to
6273b21
Compare
c73100c
to
d222567
Compare
…ed or excluded workloads)
6e1c4f2
to
c560a92
Compare
/merge |
🚂 MergeQueue 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. Use |
🚂 MergeQueue Added to the queue. This build is next! (estimated merge in less than 28m) Use |
* First iteration of sliding window with functional tests and new metrics * fix OnCGroupDeletedEvent selector * switch metric from cout to gauge and fix first lastano timestamp * Manage errors coming from profile encoding func * remove status from proto * Add secagent cmd to dump secprofile details * Add a fast exit when lookup unloaded profile * Apply review suggestions * Apply another review suggestion * apply review suggestion by simplifying a slice contains/append pattern * avoid logging error when dump have unresolved tags (could be for paused or excluded workloads) * simplify AppendIfNotPresent to a single func * add two new tests to validate a corner case * update go.mod to target new agent payload release * Add the missing encoding/decoding of activity-tree node image tags
What does this PR do?
This PR adds a life-cycle for security profiles. The selector is no longer focused on image_name + image_tag: now the selector is only image_name and each profiles could now contains several image_tag versions.
The maximum number of versions for a profile can be configured via
runtime_security_config.security_profile.max_image_tags
(10 by default).Once the limit is reached, the last seen version is evicted.
The first version would come from a security dump, then further versions will be directly added by the profile manager.
New set of tests has been added to validate the changes:
There is also new metrics to follow the new sec profile behaviors:
.security_profile.evicted_versions
will be send each time a profile version has been evicted (when reaching the max number of concurrent versions)..security_profile.versions
will reflect the number of version for each profileMotivation
This will allow to raise coverage on short lived containers, allowing to learn from a previous version instead of starting from blank each time.
Additional Notes
We'll have to pay attention on how it behaves on some workloads where the image_tag is not used to version the image (we know that some uses the same image with multiple purposes, specifying it through image_tag).
Possible Drawbacks / Trade-offs
Describe how to test/QA your changes
Run the tests is a first way. Play with images and change image tag each time, have a look on profile states, try to generate anomalies.
Reviewer's Checklist
Triage
milestone is set.major_change
label if your change either has a major impact on the code base, is impacting multiple teams or is changing important well-established internals of the Agent. This label will be use during QA to make sure each team pay extra attention to the changed behavior. For any customer facing change use a releasenote.changelog/no-changelog
label has been applied.qa/skip-qa
label is not applied.team/..
label has been applied, indicating the team(s) that should QA this change.need-change/operator
andneed-change/helm
labels have been applied.k8s/<min-version>
label, indicating the lowest Kubernetes version compatible with this feature.