Skip to content

Conversation

@nick-benoit
Copy link
Contributor

@nick-benoit nick-benoit commented Dec 8, 2025

Changes inspired by using all security exception adjacent resources together

  • Adds simple resource (elasticstack_kibana_security_list_data_streams) to manage lifecycle of create list data streams
  • Adds more extensive test coverage for different list types within list type security exception item entries
    • Add tests for all types of security value list exception items including value list updates
    • Add tests for multiple exception items
    • Add tests for multiple entries in exception items of each type
    • Add tests for managing inner nested item entries
  • Improve exception item schema validations

Rel: #1332

@nick-benoit nick-benoit requested a review from Copilot December 8, 2025 22:44
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 adds a new resource elasticstack_kibana_security_list_data_streams to manage the lifecycle of .lists and .items data streams in Kibana, which are required before using security lists and exceptions that reference value lists. The implementation includes comprehensive test coverage for different list types (ip, keyword, ip_range) within security exception item entries.

Key Changes

  • Added new security_list_data_streams resource for managing list data streams lifecycle
  • Enhanced test coverage for security exception items with list entry types
  • Refactored acceptance tests to use the new resource instead of manual setup functions

Reviewed changes

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

Show a summary per file
File Description
provider/plugin_framework.go Registered the new security_list_data_streams resource
internal/kibana/security_list_data_streams/*.go Implemented CRUD operations for the new resource
internal/kibana/security_list_data_streams/testdata/**/*.tf Added test configurations for the new resource
internal/kibana/security_list_item/acc_test.go Removed manual setup function in favor of resource-based approach
internal/kibana/security_list_item/testdata/**/*.tf Updated test configs to use new data streams resource
internal/kibana/security_list/acc_test.go Removed manual setup function in favor of resource-based approach
internal/kibana/security_list/testdata/**/*.tf Updated test configs to use new data streams resource
internal/kibana/security_exception_item/acc_test.go Enhanced test coverage for list entry types
internal/kibana/security_exception_item/testdata/**/*.tf Added test configs for ip, keyword, and ip_range list types
internal/kibana/security_exception_item/schema.go Added validation for list entries and list types
internal/clients/kibana_oapi/security_lists.go Enhanced API functions with proper return values
examples/resources/elasticstack_kibana_security_list_data_streams/resource.tf Added example usage
docs/resources/elasticsearch_security_user.md Updated documentation formatting

@nick-benoit nick-benoit requested a review from Copilot December 9, 2025 19:52
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

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

@nick-benoit nick-benoit force-pushed the security_exection_comprehensive_testing branch from dcd89e2 to a13f1fe Compare December 9, 2025 20:19
@nick-benoit nick-benoit requested review from dimuon and tobio December 9, 2025 21:39
@nick-benoit nick-benoit marked this pull request as ready for review December 9, 2025 21:40
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.

Couple of small comments

return
}

if !listIndex || !listItemIndex {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if !listIndex || !listItemIndex {
if !listIndex && !listItemIndex {

Should we only completely remove it if they're both missing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we may want OR. If only one of them is false I don't think we would ever call the create API which I think is how we would get back to the desired end state.

Copy link
Member

Choose a reason for hiding this comment

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

So another approach would be to have list_index and list_item_index set to true during planning (IIRC a default would work, otherwise via a plan modifier), which would then trigger an update if either of them were false in state. Which might be more informative for users, or give us more flexibility in the future.

I'm not fussed though, this approach works and we can adjust it if required.

@nick-benoit nick-benoit merged commit 6591ad4 into main Dec 10, 2025
54 checks passed
@nick-benoit nick-benoit deleted the security_exection_comprehensive_testing branch December 10, 2025 01:23
tobio added a commit that referenced this pull request Dec 10, 2025
* origin/main:
  Fixup changelog
  Bump release disk size
  Prepare 0.13.0 release (#1532)
  Fix null value handling in Kibana connector config causing inconsistent apply state (#1524)
  Add Security List Data Stream Resource (#1525)
  chore(deps): update golang:1.25.5 docker digest to 0ece421 (#1531)
  Fleet agent policy host name format field (#1521)
  chore(deps): update kibana-openapi-spec digest to 6647f81 (#1528)
  chore(deps): update kibana-openapi-spec digest to bd3d07c (#1519)
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.

3 participants