Skip to content

ROX-33308: Add process criteria to node event policies#19252

Open
sachaudh wants to merge 2 commits intomasterfrom
ROX-33308-node-event-process-criteria
Open

ROX-33308: Add process criteria to node event policies#19252
sachaudh wants to merge 2 commits intomasterfrom
ROX-33308-node-event-process-criteria

Conversation

@sachaudh
Copy link
Contributor

@sachaudh sachaudh commented Mar 2, 2026

Description

Jira: ROX-33308

Add Process Name, Process Ancestor, Process Arguments, and Process UID
as available criteria when creating Node event policies in the policy wizard.
Also add a section validator enforcing that process criteria require File Path,
since detection is file-access-driven and process info is metadata on those events.

  • Add 4 process text descriptors to nodeEventDescriptor
  • Add "Process criteria require file path" section validator
  • Add test coverage for the new validator

Note: Backend support (ROX-30807, ROX-33000) must land before these
criteria function end-to-end.

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

  • All existing and new unit tests pass (npm run test -- 1343 passed, 2 skipped)
  • New validator tests cover: appliesTo gating, fail without File Path, pass with File Path, pass with file-only criteria

Screenshots

Screen.Recording.2026-03-02.at.8.51.24.AM.mov

@openshift-ci
Copy link

openshift-ci bot commented Mar 2, 2026

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

Process Name, Process Ancestor, Process Arguments, and Process UID
are now available as criteria when creating Node event policies.
A section validator enforces that process criteria cannot be used
without File Path, since detection is driven by file access events
and process info is metadata on those events.

Backend support (ROX-30807, ROX-33000) must register these process
fields for NODE_EVENT before the criteria will function end-to-end.

Partially generated by AI.

Signed-off-by: Saif Chaudhry <schaudhr@redhat.com>
@sachaudh sachaudh force-pushed the ROX-33308-node-event-process-criteria branch from 0d98d45 to 0a478bb Compare March 2, 2026 17:15
@rhacs-bot
Copy link
Contributor

rhacs-bot commented Mar 2, 2026

Images are ready for the commit at add617f.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-214-gadd617fbb9.

The 4 process criteria descriptors (Process Name, Process Ancestor,
Process Arguments, Process UID) were duplicated identically between
policyCriteriaDescriptors and nodeEventDescriptor arrays. Extract
into a shared processActivityDescriptors constant and spread into
both arrays to eliminate ~80 lines of duplication.

Partially generated by AI

Signed-off-by: Saif Chaudhry <schaudhr@redhat.com>
@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.63%. Comparing base (ab63eb1) to head (add617f).
⚠️ Report is 10 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #19252      +/-   ##
==========================================
- Coverage   49.64%   49.63%   -0.01%     
==========================================
  Files        2679     2679              
  Lines      202130   202130              
==========================================
- Hits       100338   100332       -6     
- Misses      94317    94321       +4     
- Partials     7475     7477       +2     
Flag Coverage Δ
go-unit-tests 49.63% <ø> (-0.01%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 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.

@sachaudh
Copy link
Contributor Author

sachaudh commented Mar 3, 2026

/test gke-ui-e2e-tests

@sachaudh sachaudh marked this pull request as ready for review March 3, 2026 14:39
@sachaudh sachaudh requested a review from a team as a code owner March 3, 2026 14:39
name: 'Process criteria require file path',
appliesTo: (context) =>
context.lifecycleStages.includes('RUNTIME') &&
(context.eventSource === 'NODE_EVENT' || context.eventSource === 'DEPLOYMENT_EVENT'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be missing context here, but is this a new requirement for DEPLOYMENT_EVENT policies? Are process criteria not relevant with the other deployment events that existed before the addition of file access criteria in 4.10?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the requirements in https://issues.redhat.com/browse/ROX-32633 the following was mentioned:

"ability to combine existing process criteria with file access criteria for deployment and node policies"

So from the product side, it seems like this was what they wanted. Whether this is a breaking change is something maybe @Stringy can answer. @Stringy is this something that we need to change in the requirements? Dave is right that we didn't have the file activity field requirements for the deployment event policies before.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JoukoVirtanen maybe your PR is relevant to the conversation #19200. You didn't add any field dependencies, but from the tests, it looks like the intent is "process criteria are only meaningful in combination with file access criteria". Is that right?

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.

3 participants