Skip to content

Conversation

@nick-benoit
Copy link
Contributor

@nick-benoit nick-benoit commented Nov 18, 2025

Fixes defect for Security Detection Rules where rules were always created and read from the default space regardless of space_id

@nick-benoit nick-benoit requested review from Copilot and tobio November 18, 2025 23:29
@nick-benoit nick-benoit marked this pull request as ready for review November 18, 2025 23:30
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a defect where Kibana Security Detection Rules were always being created, read, updated, and deleted in the default space, ignoring the space_id parameter. The fix adds the space_id parameter to all API calls that interact with detection rules.

Key Changes:

  • Updated CRUD operations to pass space_id to the Kibana API
  • Added comprehensive acceptance tests to verify space-specific rule operations
  • Enhanced test coverage with import state verification

Reviewed Changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
internal/kibana/security_detection_rule/create.go Passes space_id to CreateRuleWithResponse API call
internal/kibana/security_detection_rule/read.go Passes space_id to ReadRuleWithResponse API call
internal/kibana/security_detection_rule/update.go Passes space_id to UpdateRuleWithResponse API call
internal/kibana/security_detection_rule/delete.go Passes space_id to DeleteRuleWithResponse API call
internal/kibana/security_detection_rule/acc_test.go Adds space-aware tests and fixes destroy check to use space_id

tobio
tobio previously approved these changes Nov 19, 2025
Copy link
Member

@tobio tobio left a comment

Choose a reason for hiding this comment

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

LGTM

…tack into support-spaces-for-detection-rules
@nick-benoit nick-benoit merged commit a8538d7 into main Nov 19, 2025
54 checks passed
@nick-benoit nick-benoit deleted the support-spaces-for-detection-rules branch November 19, 2025 12:35
tobio added a commit that referenced this pull request Nov 27, 2025
…ata-view-resource

* origin/main: (32 commits)
  chore(deps): update kibana-openapi-spec digest to c99d51c (#1487)
  [Feature] Introduce elasticsearch alias resource with atomic write index management and nested attributes (#1343)
  Support setting solution for 8.16+ on Cloud (#1486)
  Refactor all Kibana connector acceptance tests to use ConfigDirectory pattern (#1484)
  Support .bedrock and .gen-ai connectors (#1467)
  Bump golang.org/x/crypto from 0.41.0 to 0.45.0 in /libs/go-kibana-rest (#1481)
  Bump golang.org/x/crypto from 0.42.0 to 0.45.0 (#1480)
  fix(deps): update module github.com/go-resty/resty/v2 to v2.17.0 (#1478)
  chore(deps): update kibana-openapi-spec digest to f1d0789 (#1479)
  chore(deps): update kibana-openapi-spec digest to 5841714 (#1477)
  chore(deps): update golang:1.25.4 docker digest to 6981837 (#1476)
  chore(deps): update kibana-openapi-spec digest to 67de5ef (#1475)
  chore(deps): update golangci/golangci-lint-action digest to e7fa5ac (#1474)
  chore(deps): update kibana-openapi-spec digest to b4553b6 (#1472)
  chore(deps): update actions/checkout action to v6 (#1470)
  Support publishing experimental resources/datasources within the framework provider (#1464)
  chore(deps): update actions/setup-go digest to 4dc6199 (#1466)
  fix(deps): update module github.com/elastic/elastic-transport-go/v8 to v8.8.0 (#1459)
  Prepare 0.12.2 Release (#1458)
  Support spaces for detection rules (#1457)
  ...
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.

3 participants