Skip to content
Draft
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
bfd68f8
Initial plan
Copilot Nov 6, 2025
8815af2
Add exception_list and exception_item resources with CRUD operations
Copilot Nov 6, 2025
2d7850b
Add examples, documentation templates, and acceptance tests for excep…
Copilot Nov 6, 2025
2aa87db
Remove version field from exception_list as it's not in API response
Copilot Nov 6, 2025
c84195f
Remove duplicate examples from resource descriptions to fix doc dupli…
Copilot Nov 6, 2025
70ca678
Merge branch 'main' of github.com:elastic/terraform-provider-elastics…
nick-benoit Nov 19, 2025
216089e
Fix acceptance test failures: add Type field to update and use jsonty…
Copilot Nov 19, 2025
06bcdaf
Address code review feedback
Copilot Nov 19, 2025
12e5203
Merge branch 'copilot/add-elastic-security-exceptions' of github.com:…
nick-benoit Nov 20, 2025
21e6522
Add specification to get state from read requests to coding standareds
nick-benoit Nov 20, 2025
8d1a2b8
Follow CODING_STANDARDS: read resource state after create/update oper…
Copilot Nov 20, 2025
87c0676
Refactor acceptance tests to use testdata directory structure
Copilot Nov 20, 2025
ad4d39e
Support spaces
nick-benoit Nov 20, 2025
d0d929c
Add tests for exception item types
nick-benoit Nov 24, 2025
b1f6bb1
Add typed schema for exception item types
nick-benoit Nov 24, 2025
7e61490
Update docs
nick-benoit Nov 24, 2025
51eca7f
Add security value list resource
nick-benoit Nov 24, 2025
2d6c2ef
Add resource template
nick-benoit Nov 24, 2025
084d79f
Add kibana security list
nick-benoit Nov 24, 2025
a3c2efd
Add validations for security exceptions
nick-benoit Nov 25, 2025
8770ac1
Add tests for schema validations
nick-benoit Nov 25, 2025
c1bfe07
Refactor to use separate directories instead of security/
nick-benoit Nov 25, 2025
9918740
Update provider
nick-benoit Nov 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 131 additions & 0 deletions docs/resources/kibana_security_exception_item.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "elasticstack_kibana_security_exception_item Resource - terraform-provider-elasticstack"
subcategory: "Kibana"
description: |-
Manages a Kibana Exception Item. Exception items define the specific query conditions used to prevent rules from generating alerts.
See the Kibana Exceptions API documentation https://www.elastic.co/docs/api/doc/kibana/group/endpoint-security-exceptions-api for more details.
---

# elasticstack_kibana_security_exception_item (Resource)

Manages a Kibana Exception Item. Exception items define the specific query conditions used to prevent rules from generating alerts.

See the [Kibana Exceptions API documentation](https://www.elastic.co/docs/api/doc/kibana/group/endpoint-security-exceptions-api) for more details.

## Example Usage

### Basic exception item

```terraform
resource "elasticstack_kibana_security_exception_list" "example" {
list_id = "my-exception-list"
name = "My Exception List"
description = "List of exceptions for security rules"
type = "detection"
namespace_type = "single"

tags = ["security", "detections"]
}

resource "elasticstack_kibana_security_exception_item" "example" {
list_id = elasticstack_kibana_security_exception_list.example.list_id
item_id = "my-exception-item"
name = "My Exception Item"
description = "Exclude specific processes from alerts"
type = "simple"
namespace_type = "single"

entries = jsonencode([
{
field = "process.name"
operator = "included"
type = "match"
value = "trusted-process"
}
])

tags = ["trusted", "whitelisted"]
}
```

### Complex exception item with multiple entries

```terraform
resource "elasticstack_kibana_security_exception_list" "example" {
list_id = "my-exception-list"
name = "My Exception List"
description = "List of exceptions"
type = "detection"
namespace_type = "single"
}

resource "elasticstack_kibana_security_exception_item" "complex_entry" {
list_id = elasticstack_kibana_security_exception_list.example.list_id
item_id = "complex-exception"
name = "Complex Exception with Multiple Entries"
description = "Exception with multiple conditions"
type = "simple"
namespace_type = "single"

# Multiple entries with different operators
entries = jsonencode([
{
field = "host.name"
operator = "included"
type = "match"
value = "trusted-host"
},
{
field = "user.name"
operator = "excluded"
type = "match_any"
value = ["admin", "root"]
}
])

os_types = ["linux"]
tags = ["complex", "multi-condition"]
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `description` (String) Describes the exception item.
- `entries` (String) The exception item entries as JSON string. This defines the conditions under which the exception applies.
- `list_id` (String) The exception list's identifier that this item belongs to.
- `name` (String) The name of the exception item.
- `type` (String) The type of exception item. Must be `simple`.

### Optional

- `comments` (Attributes List) Array of comments about the exception item. (see [below for nested schema](#nestedatt--comments))
- `expire_time` (String) The exception item's expiration date in ISO format. This field is only available for regular exception items, not endpoint exceptions.
- `item_id` (String) The exception item's human readable string identifier.
- `meta` (String) Placeholder for metadata about the exception item as JSON string.
- `namespace_type` (String) Determines whether the exception item is available in all Kibana spaces or just the space in which it is created. Can be `single` (default) or `agnostic`.
- `os_types` (List of String) Array of OS types for which the exceptions apply. Valid values: `linux`, `macos`, `windows`.
- `tags` (List of String) String array containing words and phrases to help categorize exception items.

### Read-Only

- `created_at` (String) The timestamp of when the exception item was created.
- `created_by` (String) The user who created the exception item.
- `id` (String) The unique identifier of the exception item (auto-generated by Kibana).
- `tie_breaker_id` (String) Field used in search to ensure all items are sorted and returned correctly.
- `updated_at` (String) The timestamp of when the exception item was last updated.
- `updated_by` (String) The user who last updated the exception item.

<a id="nestedatt--comments"></a>
### Nested Schema for `comments`

Required:

- `comment` (String) The comment text.

Read-Only:

- `id` (String) The unique identifier of the comment (auto-generated by Kibana).
72 changes: 72 additions & 0 deletions docs/resources/kibana_security_exception_list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "elasticstack_kibana_security_exception_list Resource - terraform-provider-elasticstack"
subcategory: "Kibana"
description: |-
Manages a Kibana Exception List. Exception lists are containers for exception items used to prevent security rules from generating alerts.
See the Kibana Exceptions API documentation https://www.elastic.co/docs/api/doc/kibana/group/endpoint-security-exceptions-api for more details.
---

# elasticstack_kibana_security_exception_list (Resource)

Manages a Kibana Exception List. Exception lists are containers for exception items used to prevent security rules from generating alerts.

See the [Kibana Exceptions API documentation](https://www.elastic.co/docs/api/doc/kibana/group/endpoint-security-exceptions-api) for more details.

## Example Usage

### Basic exception list

```terraform
resource "elasticstack_kibana_security_exception_list" "example" {
list_id = "my-detection-exception-list"
name = "My Detection Exception List"
description = "List of exceptions for security detection rules"
type = "detection"
namespace_type = "single"

tags = ["security", "detections"]
}
```

### Endpoint exception list with OS types

```terraform
resource "elasticstack_kibana_security_exception_list" "endpoint" {
list_id = "my-endpoint-exception-list"
name = "My Endpoint Exception List"
description = "List of endpoint exceptions"
type = "endpoint"
namespace_type = "agnostic"

os_types = ["linux", "windows", "macos"]
tags = ["endpoint", "security"]
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `description` (String) Describes the exception list.
- `list_id` (String) The exception list's human readable string identifier.
- `name` (String) The name of the exception list.
- `type` (String) The type of exception list. Can be one of: `detection`, `endpoint`, `endpoint_trusted_apps`, `endpoint_events`, `endpoint_host_isolation_exceptions`, `endpoint_blocklists`.

### Optional

- `meta` (String) Placeholder for metadata about the list container as JSON string.
- `namespace_type` (String) Determines whether the exception list is available in all Kibana spaces or just the space in which it is created. Can be `single` (default) or `agnostic`.
- `os_types` (List of String) Array of OS types for which the exceptions apply. Valid values: `linux`, `macos`, `windows`.
- `tags` (List of String) String array containing words and phrases to help categorize exception containers.

### Read-Only

- `created_at` (String) The timestamp of when the exception list was created.
- `created_by` (String) The user who created the exception list.
- `id` (String) The unique identifier of the exception list (auto-generated by Kibana).
- `immutable` (Boolean) Whether the exception list is immutable.
- `tie_breaker_id` (String) Field used in search to ensure all containers are sorted and returned correctly.
- `updated_at` (String) The timestamp of when the exception list was last updated.
- `updated_by` (String) The user who last updated the exception list.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
resource "elasticstack_kibana_security_exception_list" "example" {
list_id = "my-exception-list"
name = "My Exception List"
description = "List of exceptions for security rules"
type = "detection"
namespace_type = "single"

tags = ["security", "detections"]
}

resource "elasticstack_kibana_security_exception_item" "example" {
list_id = elasticstack_kibana_security_exception_list.example.list_id
item_id = "my-exception-item"
name = "My Exception Item"
description = "Exclude specific processes from alerts"
type = "simple"
namespace_type = "single"

entries = jsonencode([
{
field = "process.name"
operator = "included"
type = "match"
value = "trusted-process"
}
])

tags = ["trusted", "whitelisted"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
resource "elasticstack_kibana_security_exception_list" "example" {
list_id = "my-exception-list"
name = "My Exception List"
description = "List of exceptions"
type = "detection"
namespace_type = "single"
}

resource "elasticstack_kibana_security_exception_item" "complex_entry" {
list_id = elasticstack_kibana_security_exception_list.example.list_id
item_id = "complex-exception"
name = "Complex Exception with Multiple Entries"
description = "Exception with multiple conditions"
type = "simple"
namespace_type = "single"

# Multiple entries with different operators
entries = jsonencode([
{
field = "host.name"
operator = "included"
type = "match"
value = "trusted-host"
},
{
field = "user.name"
operator = "excluded"
type = "match_any"
value = ["admin", "root"]
}
])

os_types = ["linux"]
tags = ["complex", "multi-condition"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resource "elasticstack_kibana_security_exception_list" "example" {
list_id = "my-detection-exception-list"
name = "My Detection Exception List"
description = "List of exceptions for security detection rules"
type = "detection"
namespace_type = "single"

tags = ["security", "detections"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
resource "elasticstack_kibana_security_exception_list" "endpoint" {
list_id = "my-endpoint-exception-list"
name = "My Endpoint Exception List"
description = "List of endpoint exceptions"
type = "endpoint"
namespace_type = "agnostic"

os_types = ["linux", "windows", "macos"]
tags = ["endpoint", "security"]
}
Loading
Loading