Repository navigation
ROX-37161: Strip exclude-by-kind rules for sensors without capability - #22963
Merged
Merged
Conversation
|
Skipping CI for Draft Pull Request. |
Contributor
Author
|
This change is part of the following stack: Change managed by git-spice. |
This was referenced Sep 22, 2026
Contributor
🚀 Build Images ReadyImages are ready for commit e831e09. To use with deploy scripts: export MAIN_IMAGE_TAG=5.1.x-294-ge831e09165 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #22963 +/- ##
==========================================
- Coverage 52.00% 51.98% -0.03%
==========================================
Files 2913 2913
Lines 183624 183638 +14
==========================================
- Hits 95500 95456 -44
- Misses 79776 79815 +39
- Partials 8348 8367 +19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
clickboo
force-pushed
the
boo-policy-excl-type-validate
branch
from
September 23, 2026 00:27
f034de2 to
d06e574
Compare
clickboo
force-pushed
the
boo-policy-excl-type-sync
branch
from
September 23, 2026 00:27
834cc7f to
a61fbb5
Compare
clickboo
force-pushed
the
boo-policy-excl-type-validate
branch
from
September 23, 2026 00:50
d06e574 to
848c2be
Compare
clickboo
force-pushed
the
boo-policy-excl-type-sync
branch
from
September 23, 2026 00:50
a61fbb5 to
1299bba
Compare
clickboo
force-pushed
the
boo-policy-excl-type-validate
branch
from
September 23, 2026 02:56
848c2be to
2ae48bf
Compare
clickboo
force-pushed
the
boo-policy-excl-type-sync
branch
from
September 23, 2026 02:56
1299bba to
c100bea
Compare
clickboo
force-pushed
the
boo-policy-excl-type-validate
branch
from
September 24, 2026 16:07
2ae48bf to
4c9e9a0
Compare
clickboo
force-pushed
the
boo-policy-excl-type-sync
branch
from
September 24, 2026 16:07
c100bea to
ce9c1bb
Compare
clickboo
force-pushed
the
boo-policy-excl-type-validate
branch
from
September 24, 2026 16:10
4c9e9a0 to
9d641f1
Compare
clickboo
force-pushed
the
boo-policy-excl-type-sync
branch
from
September 24, 2026 16:10
ce9c1bb to
849578a
Compare
clickboo
force-pushed
the
boo-policy-excl-type-validate
branch
from
September 25, 2026 01:25
9d641f1 to
124313b
Compare
clickboo
force-pushed
the
boo-policy-excl-type-sync
branch
from
September 25, 2026 01:26
849578a to
c3b6821
Compare
clickboo
force-pushed
the
boo-policy-excl-type-validate
branch
from
September 25, 2026 02:53
124313b to
9c3f628
Compare
clickboo
force-pushed
the
boo-policy-excl-type-sync
branch
from
September 25, 2026 02:53
c3b6821 to
c058d8e
Compare
clickboo
force-pushed
the
boo-policy-excl-type-validate
branch
from
September 25, 2026 03:01
9c3f628 to
05ae9c3
Compare
clickboo
force-pushed
the
boo-policy-excl-type-sync
branch
from
September 25, 2026 03:02
c058d8e to
f6954f4
Compare
clickboo
force-pushed
the
boo-policy-excl-type-validate
branch
from
September 25, 2026 05:27
05ae9c3 to
d538db1
Compare
clickboo
force-pushed
the
boo-policy-excl-type-sync
branch
from
October 10, 2026 04:09
ee53ccb to
468df04
Compare
clickboo
force-pushed
the
boo-policy-excl-type-validate
branch
from
October 10, 2026 04:56
cccf4ce to
59f2472
Compare
clickboo
force-pushed
the
boo-policy-excl-type-sync
branch
from
October 10, 2026 04:56
468df04 to
ddb6193
Compare
clickboo
force-pushed
the
boo-policy-excl-type-validate
branch
from
October 10, 2026 05:46
59f2472 to
3a7c7da
Compare
clickboo
force-pushed
the
boo-policy-excl-type-sync
branch
from
October 10, 2026 05:46
ddb6193 to
ac58ab3
Compare
clickboo
force-pushed
the
boo-policy-excl-type-sync
branch
2 times, most recently
from
October 11, 2026 05:09
dba66f8 to
52a4fd0
Compare
clickboo
force-pushed
the
boo-policy-excl-type-validate
branch
from
October 13, 2026 20:29
3a7c7da to
3893396
Compare
clickboo
force-pushed
the
boo-policy-excl-type-sync
branch
from
October 13, 2026 20:29
52a4fd0 to
8623e87
Compare
Contributor
clickboo
force-pushed
the
boo-policy-excl-type-sync
branch
from
October 15, 2026 17:27
8623e87 to
65f9e84
Compare
Contributor
Author
|
/test all |
clickboo
marked this pull request as ready for review
October 15, 2026 18:26
clickboo
enabled auto-merge (squash)
October 16, 2026 20:46
clickboo
disabled auto-merge
October 16, 2026 20:47
Co-authored-by: Cursor <cursoragent@cursor.com>
clickboo
force-pushed
the
boo-policy-excl-type-sync
branch
from
October 16, 2026 20:48
65f9e84 to
0fa3b64
Compare
clickboo
enabled auto-merge (squash)
October 16, 2026 20:48
Contributor
Author
|
/test gke-ui-e2e-tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When broadcasting policies, Central strips
exclude_by_kinditems if the Sensor lacksWorkloadKindExclusionCap. Policies are cloned first so a mixed-sensor fanout does not mutate a shared slice. Admission controller gets the same policy copies as Sensor.This is PR 4 of 6 (flag → proto → validate → sync → UI → e2e). Stacked on #22962.
Without stripping, a 4.11 Sensor drops the unknown
exclude_by_kindfield, so GetDeployment() is nil. A nil scope matches every deployment, and the exclusion turns the policy off for every workload. Put differently, the policy then excludes every workload, including ones the kind rule was never meant to cover.Stripping removes that exclusion before sync. A 4.11 Sensor never evaluates it, and the remaining scope exclusions still apply.
User-facing documentation
Testing and quality
Automated testing
How I validated my change
Unit tests on the Sensor connection path: type exclusions stripped without the capability, preserved with it, and cloned so one Sensor cannot mutate another Sensors list.
Old sensor manual test
Central 5.1.x with
ROX_POLICY_WORKLOAD_KIND_EXCLUSIONenabled, Sensor 4.11.4. Sensor 4.11.4 does not advertiseWorkloadKindExclusion, so Central strips kind exclusions before policy sync and leaves scope exclusions in place.Policy: image tag
latest, plus a namespace scope exclusion and a Job/CronJob kind exclusion.{ "name": "Latest tag old-sensor strip", "description": "Latest tag policy with a namespace scope exclusion and a Job and CronJob kind exclusion.", "categories": ["DevOps Best Practices"], "lifecycleStages": ["DEPLOY"], "severity": "LOW_SEVERITY", "policyVersion": "1.1", "exclusions": [ { "name": "skip namespace policy-exclusion-skip", "deployment": { "scope": { "namespace": "policy-exclusion-skip" } } }, { "name": "skip jobs and cronjobs", "excludeByKind": { "kinds": ["JOB", "CRON_JOB"] } } ], "policySections": [ { "policyGroups": [ { "fieldName": "Image Tag", "values": [{ "value": "latest" }] } ] } ] }Workloads are a Job, a CronJob, and a Deployment, each using
nginx:latest, indefaultand again inpolicy-exclusion-skip. Alerts below are for this policy only. The built-in Latest tag policy also alerts on all six.latest-tag-job, CronJoblatest-tag-cronjob, Deploymentlatest-tag-deploydefaultWorkloadKindExclusion, so the Job and CronJob exclusion is removed before sync• The image tag is
latest, so the policy matches• The namespace is not
policy-exclusion-skip, so the scope exclusion does not match• The Deployment violation shows the policy was not turned off for every workload
latest-tag-job, CronJoblatest-tag-cronjob, Deploymentlatest-tag-deploypolicy-exclusion-skip• That exclusion matches
policy-exclusion-skip• Exclusions are OR'd, so the scope rule alone excludes these workloads