Skip to content
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

Introduce scoping for pipeline rules and mark internally generated rules as immutable. #21577

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

patrickmann
Copy link
Contributor

@patrickmann patrickmann commented Feb 10, 2025

/nocl part of ISW
/prd Graylog2/graylog-plugin-enterprise#9749

Resolves #Graylog2/graylog-plugin-enterprise/issues/9590

Introduce scoping for pipeline rules and mark internally generated routing rules as immutable. Also ensure that they cannot be added to other pipelines.
Note that these system rules are deleteable, in spite of being immutable. Until now, scoped entities needed to be mutable to be deleteable.

Motivation and Context

See linked issue

How Has This Been Tested?

Ad hoc testing and unit tests.

@patrickmann
Copy link
Contributor Author

patrickmann commented Feb 11, 2025

Frontend can distinguish internal rules returned from e.g. /api/system/pipelines/rule/paginated by evaluating the _scope field. Internal rules have the scope value of GRAYLOG_SYSTEM_PIPELINE_RULE_SCOPE e.g.:

{
"_id" : ObjectId("67ab0a63e2980a1009965461"),
"title" : "route_67ab094de2980a1009964a0a_to_Default Stream",
"description" : "Input setup wizard routing rule",
"source" : "rule "route_67ab094de2980a1009964a0a_to_Default Stream"\nwhen has_field("gl2_source_input") AND to_string($message.gl2_source_input)=="67ab094de2980a1009964a0a"\nthen\nroute_to_stream(id:"000000000000000000000001", remove_from_default: false);\nend\n",
"created_at" : ISODate("2025-02-11T08:29:23.680Z"),
"_scope" : "GRAYLOG_SYSTEM_PIPELINE_RULE_SCOPE"
}

@patrickmann patrickmann marked this pull request as ready for review February 12, 2025 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant