Skip to content

ROX-28590: [POC] (06) boolean policy infra and default policy - #22116

Draft
robbycochran wants to merge 1 commit into
rc-security-event-05-protofrom
rc-security-event-06-policy-detect
Draft

ROX-28590: [POC] (06) boolean policy infra and default policy#22116
robbycochran wants to merge 1 commit into
rc-security-event-05-protofrom
rc-security-event-06-policy-detect

Conversation

@robbycochran

Copy link
Copy Markdown
Contributor

Description

POC branch 6/9. Registers Security Event Source field in the boolean policy engine with SECURITY_EVENT event-source requirement. Adds DetectSecurityEvent to the unified detector. Ships default "Reported Policy Violation" catch-all policy.

AI-assisted development.

User-facing documentation

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

How I validated my change

Cluster-validated: deployed, created PolicyReport, confirmed alerts-generated metric incrementing.

…icy for SECURITY_EVENT

Register SecurityEventSource field in boolean policy metadata behind
ROX_POLICY_REPORTS feature flag. Add SecurityEventMatcher, compiled
policy predicate, and runtime detector method. Include default catch-all
"Reported Policy Violation" policy gated by feature flag.

Wire detectFunc into the PolicyReport dispatcher (passed as nil — dry-run
mode; detection infrastructure exists but does not execute). Add
policyreport_alerts_generated_total metric.

Cluster-validated: all canonicalize/resolve/detect metrics confirmed on
rc-testing cluster with custom image.

AI-assisted.
@openshift-ci

openshift-ci Bot commented Aug 5, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🚀 Build Images Ready

Images are ready for commit 1645151. To use with deploy scripts:

export MAIN_IMAGE_TAG=4.12.x-520-g1645151895

@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 8.69565% with 84 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.29%. Comparing base (4da53c9) to head (1645151).

Files with missing lines Patch % Lines
pkg/detection/compiled_policy.go 7.40% 24 Missing and 1 partial ⚠️
pkg/detection/runtime/detector.go 0.00% 21 Missing ⚠️
pkg/booleanpolicy/matcher.go 0.00% 9 Missing ⚠️
pkg/booleanpolicy/matcher_impl.go 0.00% 7 Missing ⚠️
pkg/detection/runtime/utils.go 0.00% 7 Missing ⚠️
pkg/booleanpolicy/field_metadata.go 37.50% 4 Missing and 1 partial ⚠️
sensor/common/detector/detector.go 0.00% 4 Missing ⚠️
...etes/listener/resources/policyreport/dispatcher.go 40.00% 2 Missing and 1 partial ⚠️
pkg/booleanpolicy/augmentedobjs/construct.go 0.00% 2 Missing ⚠️
sensor/kubernetes/listener/resources/dispatcher.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                       Coverage Diff                       @@
##           rc-security-event-05-proto   #22116       +/-   ##
===============================================================
+ Coverage                       49.93%   51.29%    +1.35%     
===============================================================
  Files                             787     2853     +2066     
  Lines                           62122   178256   +116134     
===============================================================
+ Hits                            31022    91437    +60415     
- Misses                          27814    78805    +50991     
- Partials                         3286     8014     +4728     
Flag Coverage Δ
go-unit-tests 51.29% <8.69%> (+1.35%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant