Skip to content

Commit 51eca7f

Browse files
committed
Add security value list resource
1 parent 7e61490 commit 51eca7f

File tree

24 files changed

+2572
-1555
lines changed

24 files changed

+2572
-1555
lines changed
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "elasticstack_kibana_security_list Resource - terraform-provider-elasticstack"
4+
subcategory: "Kibana"
5+
description: |-
6+
Manages Kibana security lists (also known as value lists). Security lists are used by exception items to define sets of values for matching or excluding in security rules.
7+
Example Usage
8+
9+
resource "elasticstack_kibana_security_list" "ip_list" {
10+
space_id = "default"
11+
name = "Trusted IP Addresses"
12+
description = "List of trusted IP addresses for security rules"
13+
type = "ip"
14+
}
15+
16+
resource "elasticstack_kibana_security_list" "keyword_list" {
17+
space_id = "security"
18+
list_id = "custom-keywords"
19+
name = "Custom Keywords"
20+
description = "Custom keyword list for detection rules"
21+
type = "keyword"
22+
}
23+
24+
Notes
25+
Security lists define the type of data they can contain via the type attributeOnce created, the type of a list cannot be changedLists can be referenced by exception items to create more sophisticated matching rulesThe list_id is auto-generated if not provided
26+
---
27+
28+
# elasticstack_kibana_security_list (Resource)
29+
30+
Manages Kibana security lists (also known as value lists). Security lists are used by exception items to define sets of values for matching or excluding in security rules.
31+
32+
## Example Usage
33+
34+
```terraform
35+
resource "elasticstack_kibana_security_list" "ip_list" {
36+
space_id = "default"
37+
name = "Trusted IP Addresses"
38+
description = "List of trusted IP addresses for security rules"
39+
type = "ip"
40+
}
41+
42+
resource "elasticstack_kibana_security_list" "keyword_list" {
43+
space_id = "security"
44+
list_id = "custom-keywords"
45+
name = "Custom Keywords"
46+
description = "Custom keyword list for detection rules"
47+
type = "keyword"
48+
}
49+
```
50+
51+
## Notes
52+
53+
- Security lists define the type of data they can contain via the `type` attribute
54+
- Once created, the `type` of a list cannot be changed
55+
- Lists can be referenced by exception items to create more sophisticated matching rules
56+
- The `list_id` is auto-generated if not provided
57+
58+
## Example Usage
59+
60+
### IP address list
61+
62+
```terraform
63+
resource "elasticstack_kibana_security_list" "ip_list" {
64+
space_id = "default"
65+
name = "Trusted IP Addresses"
66+
description = "List of trusted IP addresses for security rules"
67+
type = "ip"
68+
}
69+
```
70+
71+
### Keyword list with custom list_id
72+
73+
```terraform
74+
resource "elasticstack_kibana_security_list" "keyword_list" {
75+
space_id = "security"
76+
list_id = "custom-keywords"
77+
name = "Custom Keywords"
78+
description = "Custom keyword list for detection rules"
79+
type = "keyword"
80+
}
81+
```
82+
83+
<!-- schema generated by tfplugindocs -->
84+
## Schema
85+
86+
### Required
87+
88+
- `description` (String) Describes the security list.
89+
- `name` (String) The name of the security list.
90+
- `type` (String) Specifies the Elasticsearch data type of values the list contains. Valid values include: `binary`, `boolean`, `byte`, `date`, `date_nanos`, `date_range`, `double`, `double_range`, `float`, `float_range`, `geo_point`, `geo_shape`, `half_float`, `integer`, `integer_range`, `ip`, `ip_range`, `keyword`, `long`, `long_range`, `shape`, `short`, `text`.
91+
92+
### Optional
93+
94+
- `deserializer` (String) Determines how retrieved list item values are presented. By default, list items are presented using Handlebars expressions based on the type.
95+
- `id` (String) The unique identifier of the security list (auto-generated by Kibana if not specified).
96+
- `list_id` (String) The value list's human-readable identifier.
97+
- `meta` (String) Placeholder for metadata about the value list as JSON string.
98+
- `serializer` (String) Determines how uploaded list item values are parsed. By default, list items are parsed using named regex groups based on the type.
99+
- `space_id` (String) An identifier for the space. If space_id is not provided, the default space is used.
100+
- `version` (Number) The document version number.
101+
102+
### Read-Only
103+
104+
- `created_at` (String) The timestamp of when the list was created.
105+
- `created_by` (String) The user who created the list.
106+
- `immutable` (Boolean) Whether the list is immutable.
107+
- `tie_breaker_id` (String) Field used in search to ensure all containers are sorted and returned correctly.
108+
- `updated_at` (String) The timestamp of when the list was last updated.
109+
- `updated_by` (String) The user who last updated the list.
110+
- `version_id` (String) The version id, normally returned by the API when the document is retrieved.

examples/resources/elasticstack_kibana_security_exception_item/resource.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ resource "elasticstack_kibana_security_exception_item" "example" {
1616
type = "simple"
1717
namespace_type = "single"
1818

19-
entries = jsonencode([
19+
entries = [
2020
{
21+
type = "match"
2122
field = "process.name"
2223
operator = "included"
23-
type = "match"
2424
value = "trusted-process"
2525
}
26-
])
26+
]
2727

2828
tags = ["trusted", "whitelisted"]
2929
}

examples/resources/elasticstack_kibana_security_exception_item/resource_complex.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@ resource "elasticstack_kibana_security_exception_item" "complex_entry" {
1515
namespace_type = "single"
1616

1717
# Multiple entries with different operators
18-
entries = jsonencode([
18+
entries = [
1919
{
20+
type = "match"
2021
field = "host.name"
2122
operator = "included"
22-
type = "match"
2323
value = "trusted-host"
2424
},
2525
{
26+
type = "match_any"
2627
field = "user.name"
2728
operator = "excluded"
28-
type = "match_any"
29-
value = ["admin", "root"]
29+
values = ["admin", "root"]
3030
}
31-
])
31+
]
3232

3333
os_types = ["linux"]
3434
tags = ["complex", "multi-condition"]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
resource "elasticstack_kibana_security_list" "ip_list" {
2+
space_id = "default"
3+
name = "Trusted IP Addresses"
4+
description = "List of trusted IP addresses for security rules"
5+
type = "ip"
6+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
resource "elasticstack_kibana_security_list" "keyword_list" {
2+
space_id = "security"
3+
list_id = "custom-keywords"
4+
name = "Custom Keywords"
5+
description = "Custom keyword list for detection rules"
6+
type = "keyword"
7+
}

0 commit comments

Comments
 (0)