Skip to content

feat(14351): New sigma summary and condition form#26210

Merged
kingzacko1 merged 5 commits into
masterfrom
feat/14351-sigma-event-definitions-add-summary-component
Jun 7, 2026
Merged

feat(14351): New sigma summary and condition form#26210
kingzacko1 merged 5 commits into
masterfrom
feat/14351-sigma-event-definitions-add-summary-component

Conversation

@zeeklop

@zeeklop zeeklop commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Add summary and condition form components for Sigma-based event definitions, enabling view, edit, and delete directly from the Event Definitions page.

closes: Graylog2/graylog-plugin-enterprise#14351

/prd https://github.com/Graylog2/graylog-plugin-enterprise/pull/14143

/nocl

Description

  • Added SigmaConditionForm and SigmaEventConditionForm plugin components to support editing Sigma event definition scheduling, streams, filters, and cron configuration
  • Added SigmaEventSummaryContainer to plug the existing Sigma summary into the event definition summary view
  • Registered the sigma-v1 event definition type in the enterprise plugin bindings with formComponent and summaryComponent
  • Extended the SigmaEventSummary component to display cron scheduling details (expression, human-readable description, and timezone)
  • Fixed _is_schedule typo to _is_scheduled and added cron-related fields to SigmaConfigType
  • Updated EventConditionForm to always include the current condition plugin type in the dropdown even when it is excluded from the filtered list (e.g. Sigma), and fixed layout so the help panel renders independently of the form component
  • Updated EventDefinitionActions to allow editing and deleting Sigma event definitions from the Event Definitions page; removed the restriction that forced deletion via the Sigma Rules page
  • Refactored ViewEventDefinitionPage to use the useGetEventDefinition React Query hook and useGetPermissionsByScope instead of manual store calls with useState/useEffect; conditionally shows Edit/Duplicate actions based on scope permissions

Motivation and Context

Sigma-based event definitions lacked the form and summary plugin bindings needed to view, edit, or delete them from the Event Definitions page. Users were forced to manage Sigma rules exclusively through the Sigma Rules page, which created a fragmented experience.

How Has This Been Tested?

Unit tests

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have requested a documentation update.
  • I have added tests to cover my changes.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds UI support for Sigma-based event definitions so they can be viewed/managed from the standard Event Definitions pages, aligning Sigma event definitions with existing event definition UX patterns.

Changes:

  • Refactors ViewEventDefinitionPage to load event definitions via a React Query hook and to gate Sigma edit actions by scope permissions.
  • Updates EventConditionForm to keep the current condition type selectable even if excluded from the normal condition-type list, and adjusts help panel layout behavior.
  • Enables editing/deleting Sigma event definitions from the Event Definitions list actions and updates the page tests accordingly.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
graylog2-web-interface/src/pages/ViewEventDefinitionPage.tsx Switches event definition loading to React Query hook and updates action visibility logic (notably for Sigma).
graylog2-web-interface/src/pages/ViewEventDefinitionPage.test.tsx Updates mocks/assertions to match the new React Query + scope-permissions based implementation.
graylog2-web-interface/src/components/event-definitions/event-definitions/EventDefinitionActions.tsx Removes Sigma-specific delete restriction and gates Sigma edit action visibility via scope permissions.
graylog2-web-interface/src/components/event-definitions/event-definition-form/EventConditionForm.tsx Ensures current condition type remains present in the dropdown and decouples help panel rendering from the form component.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 46 to +65
@@ -60,35 +60,32 @@ const ViewEventDefinitionPage = () => {
? (pluggableSigmaModal.component as React.FC<{ ruleId: string; onCancel: () => void; onConfirm: () => void }>)
: null;

useEffect(() => {
if (
currentUser &&
isPermitted(currentUser.permissions, `eventdefinitions:read:${params.definitionId}`) &&
refetch
) {
EventDefinitionsActions.get(params.definitionId).then(
(response: any) => {
const eventDefinitionResp = response.event_definition;

// Inject an internal "_is_scheduled" field to indicate if the event definition should be scheduled in the
// backend. This field will be removed in the event definitions store before sending an event definition
// back to the server.
eventDefinitionResp.config._is_scheduled = response.context.scheduler.is_scheduled;
setEventDefinition(eventDefinitionResp);
},
(error) => {
if (error.status === 404) {
history.push(Routes.ALERTS.DEFINITIONS.LIST);
}
},
);
const queryClient = useQueryClient();
const { data, isFetching } = useGetEventDefinition(params.definitionId);

Comment on lines +78 to +88
const { scopePermissions } = useGetPermissionsByScope(eventDefinition);

useEffect(() => {
EventNotificationsActions.listAll();
}, []);

useEffect(() => {
if (!isFetching && !eventDefinition) {
history.push(Routes.ALERTS.DEFINITIONS.LIST);
}
}, [currentUser, history, params, refetch]);
}, [eventDefinition, history, isFetching]);
</HelpPanel>
</Col>
)}
<Clearfix />
@kingzacko1 kingzacko1 merged commit a263f71 into master Jun 7, 2026
27 checks passed
@kingzacko1 kingzacko1 deleted the feat/14351-sigma-event-definitions-add-summary-component branch June 7, 2026 01:48
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.

4 participants