ROX-33000: Support for process details in detection node#19586
Merged
JoukoVirtanen merged 5 commits intomasterfrom Mar 26, 2026
Merged
Conversation
|
Skipping CI for Draft Pull Request. |
Contributor
|
Images are ready for the commit at 148d3ba. To use with deploy scripts, first |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19586 +/- ##
==========================================
+ Coverage 49.26% 49.28% +0.01%
==========================================
Files 2735 2735
Lines 206138 206220 +82
==========================================
+ Hits 101550 101631 +81
- Misses 97041 97046 +5
+ Partials 7547 7543 -4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Stringy
approved these changes
Mar 25, 2026
Contributor
Stringy
left a comment
There was a problem hiding this comment.
One minor non-blocking comment but overall LGTM
Contributor
Author
|
/test gke-upgrade-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
A previous PR made it possible to create deployment policies with Process fields and FileAccess fields. This PR makes it possible to create node policies with a combination and Process and FileAccess fields. Node policies with Process only fields are still disallowed.
User-facing documentation
Testing and quality
Automated testing
A test was modified.
How I validated my change
Summary
A script was used to create various policies and tested in master and this branch.
Process and FileAccess fields
This branch: Success
Master: Failure
Process only
This branch: Failure, but incorrect error message
Master: Failure
FileAccess only
This branch: Success
Master: Success
The first type of policy was also tested by triggering it in this branch.
Details
The following script was used to test the changes here.
The following policy was used as an input. This is a valid node policy with Process and FileAccess fields. The policy is successfully created in this branch.
{ "id": "", "name": "Node with process", "description": "", "severity": "LOW_SEVERITY", "disabled": false, "lifecycleStages": [ "RUNTIME" ], "notifiers": [], "lastUpdated": null, "eventSource": "NODE_EVENT", "isDefault": false, "rationale": "", "remediation": "", "categories": [ "Anomalous Activity" ], "exclusions": [], "scope": [], "enforcementActions": [], "SORTName": "", "SORTLifecycleStage": "", "SORTEnforcement": false, "policyVersion": "", "policySections": [ { "sectionName": "Rule 1", "policyGroups": [ { "fieldName": "Process Name", "booleanOperator": "OR", "values": [ { "value": "bash" } ], "negate": false, "fieldKey": { "name": "Process Name", "shortName": "Process name", "longName": "Process name is", "negatedName": "Process name doesn’t match", "category": "Process activity", "type": "text", "placeholder": "apt-get", "canBooleanLogic": true, "lifecycleStages": [ "RUNTIME" ] } }, { "fieldName": "File Path", "booleanOperator": "OR", "values": [ { "value": "/etc/sudoers" } ], "negate": false, "fieldKey": { "label": "File path", "name": "File Path", "shortName": "File path", "category": "File activity", "type": "text", "placeholder": "/home/**/.ssh/id_*", "helperText": "Enter an absolute file path. Supports glob patterns.", "canBooleanLogic": false, "lifecycleStages": [ "RUNTIME" ] } } ] } ], "mitreAttackVectors": [], "criteriaLocked": false, "mitreVectorsLocked": false, "source": "IMPERATIVE" }In master it results in an error.
{ "code": 3, "message": "policy invalid errors: [error validating lifecycle stage error: Node event policies must contain only node fields, Node event policies must contain only node fields]: invalid arguments", "details": [], "error": "policy invalid errors: [error validating lifecycle stage error: Node event policies must contain only node fields, Node event policies must contain only node fields]: invalid arguments" }The policy was triggered by doing the following actions.
Alerts were checked with the following script
{ "alerts": [ { "id": "0b087242-b3a6-45e7-a1e6-e6313a9e0b62", "lifecycleStage": "RUNTIME", "time": "2026-03-25T21:09:59.119409214Z", "policy": { "id": "6af33bed-624f-45ad-b1aa-0209f662486a", "name": "Node with process", "severity": "LOW_SEVERITY", "description": "", "categories": [ "Anomalous Activity" ], "developerInternalFields": null }, "state": "ACTIVE", "enforcementCount": 0, "enforcementAction": "UNSET_ENFORCEMENT", "commonEntityInfo": { "clusterName": "remote", "namespace": "", "clusterId": "6ae794a4-aa60-44f5-958c-2802793afbd3", "namespaceId": "", "resourceType": "DEPLOYMENT" }, "node": { "name": "gke-jv-0317-default-pool-76ef2ea2-3x9w" } }, ] }The violation had been triggered.
An invalid policy with only a Process field was tested.
{ "id": "", "name": "Node with process only", "description": "", "severity": "LOW_SEVERITY", "disabled": false, "lifecycleStages": [ "RUNTIME" ], "notifiers": [], "lastUpdated": null, "eventSource": "NODE_EVENT", "isDefault": false, "rationale": "", "remediation": "", "categories": [ "Anomalous Activity" ], "exclusions": [], "scope": [], "enforcementActions": [], "SORTName": "", "SORTLifecycleStage": "", "SORTEnforcement": false, "policyVersion": "", "policySections": [ { "sectionName": "Rule 1", "policyGroups": [ { "fieldName": "Process Name", "booleanOperator": "OR", "values": [ { "value": "bash" } ], "negate": false, "fieldKey": { "name": "Process Name", "shortName": "Process name", "longName": "Process name is", "negatedName": "Process name doesn’t match", "category": "Process activity", "type": "text", "placeholder": "apt-get", "canBooleanLogic": true, "lifecycleStages": [ "RUNTIME" ] } } ] } ], "mitreAttackVectors": [], "criteriaLocked": false, "mitreVectorsLocked": false, "source": "IMPERATIVE" }This resulted in the following error
It failed in master with the following error:
{ "code": 3, "message": "policy invalid errors: [error validating lifecycle stage error: Node event policies must contain only node fields, Node event policies must contain only node fields]: invalid arguments", "details": [], "error": "policy invalid errors: [error validating lifecycle stage error: Node event policies must contain only node fields, Node event policies must contain only node fields]: invalid arguments" }A policy with only a FileAccess field was tested and worked in this branch and in master.
{ "id": "", "name": "Node with file access only", "description": "", "severity": "LOW_SEVERITY", "disabled": false, "lifecycleStages": [ "RUNTIME" ], "notifiers": [], "lastUpdated": null, "eventSource": "NODE_EVENT", "isDefault": false, "rationale": "", "remediation": "", "categories": [ "Anomalous Activity" ], "exclusions": [], "scope": [], "enforcementActions": [], "SORTName": "", "SORTLifecycleStage": "", "SORTEnforcement": false, "policyVersion": "", "policySections": [ { "sectionName": "Rule 1", "policyGroups": [ { "fieldName": "File Path", "booleanOperator": "OR", "values": [ { "value": "/etc/sudoers" } ], "negate": false, "fieldKey": { "label": "File path", "name": "File Path", "shortName": "File path", "category": "File activity", "type": "text", "placeholder": "/home/**/.ssh/id_*", "helperText": "Enter an absolute file path. Supports glob patterns.", "canBooleanLogic": false, "lifecycleStages": [ "RUNTIME" ] } } ] } ], "mitreAttackVectors": [], "criteriaLocked": false, "mitreVectorsLocked": false, "source": "IMPERATIVE" }