Skip to content

Add tactics_techniques to event definitions#25977

Draft
danotorrey wants to merge 12 commits into
masterfrom
feature/event-definition-mitre-tactics-techniques
Draft

Add tactics_techniques to event definitions#25977
danotorrey wants to merge 12 commits into
masterfrom
feature/event-definition-mitre-tactics-techniques

Conversation

@danotorrey
Copy link
Copy Markdown
Contributor

@danotorrey danotorrey commented May 11, 2026

Summary

  • Adds tactics_techniques on event definitions — a keyword array of MITRE IDs (TA0002, T1059, T1059.001).
  • Values stamp onto produced events and map as a top-level keyword array on the events index.
  • Canonicalized on save via TacticsTechniquesNormalizer (mirrors TagNormalizer).
  • New TacticsTechniquesValidator extension point — OSS no-op; enterprise rejects IDs missing from the Illuminate LUTs.

Notes

  • Edit-form section and list-column chip are both pluggable (eventDefinitions.tacticsTechniquesEditor, eventDefinitions.tacticsTechniquesChip). OSS users see the column populated with bare IDs; the edit-form section is hidden until enterprise contributes.
  • TagsCell renamed to ChipsCell with generic prop names. Tags and Tactics/Techniques share the collapse/+N overflow UX.
  • Adds MitreBackwardsCompatibilityFilter so the three storage adapters can OR the legacy event.fields.sigma_rule_tag_* shape with the new tactics_techniques shape during the migration window. Removable with the legacy path.

/nocl

Test plan

  • Create an event def with tactics_techniques: ["ta0002","T1059","T1059.001"] — stored values canonicalize to upper-case; round-trips via GET.
  • Reject malformed IDs (bogus, T999) and >64-entry arrays.
  • Search event defs via ?query=tactics_techniques:T1059.
  • Trigger the def; produced events carry tactics_techniques on _source.
  • OSS list column header reads "Tactics/Techniques"; chips collapse to 3 + +N.
  • Without the enterprise plugin loaded: no edit-form section appears for tactics/techniques.

Adds a single `mitre_categories` keyword array on event definitions and stamps
it onto every produced event (mapped at the top level of the events index).
Validation accepts tactic, technique, and sub-technique IDs through one
combined regex; the 64-value cap is enforced. Frontend types, fixtures, and
event-def save telemetry track the new field.

Includes a `MitreBackwardsCompatibilityFilter` helper used by the three
storage-adapter `MoreSearchAdapter` implementations to OR the legacy
`event.fields.sigma_rule_tag_*` filter shape with the new `mitre_categories`
shape during the migration window. Scoped for removal alongside the legacy
path.

Co-Authored-By: Claude Opus 4.7 (1M context) <[EMAIL_ADDRESS_REDACTED]>
CI yarn tsc surfaced a typed `EventDefinition` literal that hadn't been updated
when the field was added.

Co-Authored-By: Claude Opus 4.7 (1M context) <[EMAIL_ADDRESS_REDACTED]>
…ition-mitre-tactics-techniques

# Conflicts:
#	graylog2-server/src/main/java/org/graylog/events/contentpack/entities/EventDefinitionEntity.java
#	graylog2-server/src/main/java/org/graylog/events/event/Event.java
#	graylog2-server/src/main/java/org/graylog/events/event/EventDto.java
#	graylog2-server/src/main/java/org/graylog/events/event/EventProcessorEventFactory.java
#	graylog2-server/src/main/java/org/graylog/events/processor/EventDefinitionDto.java
#	graylog2-server/src/main/java/org/graylog/events/rest/EventDefinitionsResource.java
#	graylog2-server/src/main/java/org/graylog2/indexer/template/EventsIndexMapping.java
#	graylog2-web-interface/src/components/events/events/types.ts
- Rename `mitre_categories` to `tactics_techniques` across DTO, JSON, ES
  mapping, content-pack entity, FE types, fixtures.
- `TacticsTechniquesNormalizer` (mirrors `TagNormalizer`): trim, upper-case,
  drop empties. Applied in `EventDefinitionDto.Builder.build()`.
- `TacticsTechniquesValidator` Guice extension point with OSS no-op default;
  wired into create/update/validate endpoints. Enterprise overrides to
  reject IDs not in the Illuminate LUTs.
- New "Tactics/Techniques" column on the Event Definitions list.
- Editor on the event-def edit form and chip on the list column are pluggable
  (`eventDefinitions.tacticsTechniquesEditor`, `eventDefinitions.tacticsTechniquesChip`).
  OSS leaves both empty.
- Rename `TagsCell` → `ChipsCell` with generic prop names. Tags and
  Tactics/Techniques share the collapse / +N overflow UX.
- `EventImpl.equals/hashCode/toString` now include the new field.
- New TacticsTechniquesNormalizerTest; expanded EventDefinitionDtoTest,
  EventProcessorEventFactoryTest, EventDefinitionsResourceTest.
@danotorrey danotorrey changed the title Add mitre_categories field to event definitions Add tactics_techniques to event definitions May 22, 2026
…ition-mitre-tactics-techniques

# Conflicts:
#	graylog2-server/src/main/java/org/graylog/events/rest/EventDefinitionsResource.java
Remove the events list column, event-defs list column, summary view
row, and expanded details row. Schema and plugin slot wiring remain.

Assisted with Claude Code
…ithub.com:Graylog2/graylog2-server into feature/event-definition-mitre-tactics-techniques
- Make `tactics_techniques` optional on the FE EventDefinition type so
  consumers that don't set it (older fixtures, ad-hoc instances) still
  type-check. Mutation hook fills `[]` when sending to the API.
- Drop tactics_techniques from the Event Definitions EntityAttribute
  list; keep it as an extraSearchField so API search still works.
- Fix TableElement.getColumnRenderer typing to return the
  ColumnRenderersByAttribute map instead of a single ColumnRenderer.
  Make expandedSection / tableCellComponent optional and have the
  consumer handle their absence.

Assisted with Claude Code
Roll back the getColumnRenderer signature fix and the optional
expandedSection/tableCellComponent change. They're a worthwhile
cleanup but they create cross-repo coupling — anywhere a downstream
plugin had `@ts-expect-error` working around the old signature, the
directive becomes unused once the type is corrected. That tripped CI
on this PR. Will revisit in a standalone follow-up that touches both
repos together.

Assisted with Claude Code
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