Skip to content

[Security Solution] Fix rule snooze/unsnooze change history logging#271908

Merged
maximpn merged 3 commits into
elastic:mainfrom
maximpn:changes-history/fix-rule-snooze-unsnooze-change-tracking
May 29, 2026
Merged

[Security Solution] Fix rule snooze/unsnooze change history logging#271908
maximpn merged 3 commits into
elastic:mainfrom
maximpn:changes-history/fix-rule-snooze-unsnooze-change-tracking

Conversation

@maximpn
Copy link
Copy Markdown
Contributor

@maximpn maximpn commented May 29, 2026

Epic: https://github.com/elastic/security-team/issues/12367 (internal)
Follow-up to: #267350
Related to: #269617

Summary

Fixed rule change tracking instrumentation for RulesClient snooze and unsnooze methods.

Details

snoozeRule and unsnoozeRule in RulesClient perform an OCC (optimistic concurrency control) update that only modifies snooze-related attributes. The saved object returned by that update contains only the updated partial attributes, not the complete rule document. Passing that partial object to logRuleChanges caused the change history record to be missing required rule fields, breaking change tracking for snooze and unsnooze actions.

The fix merges the original pre-update attributes with updatedRuleRaw.attributes so that logRuleChanges always receives a complete rule document.

Issues were discovered during e2e testing of the UI in #269617.

  • snooze_rule.ts: Merge original attributes with updatedRuleRaw.attributes before passing the saved object to logRuleChanges.
  • unsnooze_rule.ts: Same fix.
  • snooze_rule.test.ts, unsnooze_rule.test.ts: Add test cases that verify logRuleChanges is called with the fully merged attributes.

@maximpn maximpn added bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Feature:Rule Management Security Solution Detection Rule Management area Team:Detection Rule Management Security Detection Rule Management Team v9.5.0 labels May 29, 2026
@maximpn maximpn self-assigned this May 29, 2026
@maximpn maximpn marked this pull request as ready for review May 29, 2026 12:34
@maximpn maximpn requested a review from a team as a code owner May 29, 2026 12:34
@infra-vault-gh-plugin-prod
Copy link
Copy Markdown

Pinging @elastic/security-detections-response (Team:Detections and Resp)

@infra-vault-gh-plugin-prod
Copy link
Copy Markdown

Pinging @elastic/security-solution (Team: SecuritySolution)

@infra-vault-gh-plugin-prod
Copy link
Copy Markdown

Pinging @elastic/security-detection-rule-management (Team:Detection Rule Management)

Copy link
Copy Markdown
Contributor

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

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

LGTM

@kibanamachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

History

cc @maximpn

@maximpn maximpn merged commit cbdf086 into elastic:main May 29, 2026
32 checks passed
@maximpn maximpn deleted the changes-history/fix-rule-snooze-unsnooze-change-tracking branch May 29, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting bug Fixes for quality problems that affect the customer experience Feature:Rule Management Security Solution Detection Rule Management area release_note:skip Skip the PR/issue when compiling release notes Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants