Skip to content

[CWS] Introduce scope_field for process scope #37709

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

Open
wants to merge 2 commits into
base: will/export-cgroup-write-event
Choose a base branch
from

Conversation

Gui774ume
Copy link
Contributor

What does this PR do?

This PR introduces scope_field for scoped variable in set actions.

Motivation

The goal of this field is to provide which field should be used to query the scope of the variable modified in this action. The goal of this field is to allow updating the value of a variable for a different process than the one that triggered the rule.

Example use case: setting the execution context of the target process of a cgroup_write event.

- id: cgroup_write_execution_context
  expression: cgroup_write.pid > 0
  actions:
    - set:
        name: correlation_key
        expression: '"first_${builtins.uuid4}"'
        scope: process
        scope_field: cgroup_write.pid
        inherited: true

Describe how you validated your changes

Tests were added.

Possible Drawbacks / Trade-offs

Additional Notes

@Gui774ume Gui774ume added this to the 7.68.0 milestone Jun 5, 2025
@Gui774ume Gui774ume requested a review from a team as a code owner June 5, 2025 20:55
@Gui774ume Gui774ume added component/system-probe team/agent-security qa/done QA done before merge and regressions are covered by tests labels Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/no-changelog component/system-probe qa/done QA done before merge and regressions are covered by tests team/agent-security
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant