forked from elastic/integrations
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.yml
189 lines (180 loc) · 5.47 KB
/
default.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
---
description: Pipeline for processing Hashicorp Vault audit logs.
processors:
- set:
field: ecs.version
value: '8.8.0'
- rename:
field: message
target_field: event.original
ignore_missing: true
ignore_failure: true
- json:
field: event.original
target_field: hashicorp_vault.audit
ignore_failure: true
#
# @timestamp
#
- date:
field: hashicorp_vault.audit.time
formats:
- ISO8601
- remove:
field:
- hashicorp_vault.audit.time
ignore_missing: true
#
# event categorization.
#
- set:
field: event.kind
value: event
- append:
field: event.category
value: authentication
# Request operation can be: create, delete, list, read, update.
- append:
if: ctx?.hashicorp_vault?.audit?.request?.operation == 'create'
field: event.type
value: creation
- append:
if: ctx?.hashicorp_vault?.audit?.request?.operation == 'delete'
field: event.type
value: deletion
- append:
if: ctx?.hashicorp_vault?.audit?.request?.operation == 'update'
field: event.type
value: change
- append:
if: ctx?.hashicorp_vault?.audit?.request?.operation == 'read' || ctx?.hashicorp_vault?.audit?.request?.operation == 'list'
field: event.type
value: access
- append:
if: ctx?.hashicorp_vault?.audit?.error != null
field: event.type
value: error
- append:
if: ctx?.hashicorp_vault?.audit?.error != null && ctx.hashicorp_vault.audit.error.contains("denied")
field: event.type
value: denied
- set:
field: event.action
copy_from: hashicorp_vault.audit.request.operation
#
# event.outcome
#
- set:
if: ctx?.hashicorp_vault?.audit?.error == null
field: event.outcome
value: success
- set:
if: ctx?.hashicorp_vault?.audit?.error != null
field: event.outcome
value: failure
- set:
field: event.id
copy_from: hashicorp_vault.audit.request.id
ignore_failure: true
- set:
field: message
copy_from: hashicorp_vault.audit.error
ignore_failure: true
- convert:
field: hashicorp_vault.audit.request.remote_address
target_field: source.ip
type: ip
ignore_missing: true
- convert:
field: hashicorp_vault.audit.request.remote_port
target_field: source.port
type: long
ignore_missing: true
# OIDC auth metadata.
- set:
field: user.email
copy_from: hashicorp_vault.audit.auth.metadata.email
ignore_failure: true
- set:
field: user.id
copy_from: hashicorp_vault.audit.auth.metadata.account_id
ignore_failure: true
# Nomad auth metadata. (Recognize it by the presence of all four fields.)
- set:
if: >
ctx?.hashicorp_vault?.audit?.auth?.metadata?.AllocationID != null &&
ctx?.hashicorp_vault?.audit?.auth?.metadata?.NodeID != null &&
ctx?.hashicorp_vault?.audit?.auth?.metadata?.Namespace != null &&
ctx?.hashicorp_vault?.audit?.auth?.metadata?.Task != null
field: nomad.allocation.id
copy_from: hashicorp_vault.audit.auth.metadata.AllocationID
ignore_failure: true
- set:
if: >
ctx?.hashicorp_vault?.audit?.auth?.metadata?.AllocationID != null &&
ctx?.hashicorp_vault?.audit?.auth?.metadata?.NodeID != null &&
ctx?.hashicorp_vault?.audit?.auth?.metadata?.Namespace != null &&
ctx?.hashicorp_vault?.audit?.auth?.metadata?.Task != null
field: nomad.namespace
copy_from: hashicorp_vault.audit.auth.metadata.Namespace
ignore_failure: true
- set:
if: >
ctx?.hashicorp_vault?.audit?.auth?.metadata?.AllocationID != null &&
ctx?.hashicorp_vault?.audit?.auth?.metadata?.NodeID != null &&
ctx?.hashicorp_vault?.audit?.auth?.metadata?.Namespace != null &&
ctx?.hashicorp_vault?.audit?.auth?.metadata?.Task != null
field: nomad.node.id
copy_from: hashicorp_vault.audit.auth.metadata.NodeID
ignore_failure: true
- set:
if: >
ctx?.hashicorp_vault?.audit?.auth?.metadata?.AllocationID != null &&
ctx?.hashicorp_vault?.audit?.auth?.metadata?.NodeID != null &&
ctx?.hashicorp_vault?.audit?.auth?.metadata?.Namespace != null &&
ctx?.hashicorp_vault?.audit?.auth?.metadata?.Task != null
field: nomad.task.name
copy_from: hashicorp_vault.audit.auth.metadata.Task
ignore_failure: true
# IP Geolocation Lookup
- geoip:
field: source.ip
target_field: source.geo
ignore_missing: true
# IP Autonomous System (AS) Lookup
- geoip:
database_file: GeoLite2-ASN.mmdb
field: source.ip
target_field: source.as
properties:
- asn
- organization_name
ignore_missing: true
- rename:
field: source.as.asn
target_field: source.as.number
ignore_missing: true
- rename:
field: source.as.organization_name
target_field: source.as.organization.name
ignore_missing: true
- append:
field: related.ip
value: '{{{source.ip}}}'
allow_duplicates: false
if: ctx?.source?.ip != null
#
# event.original - keep or drop
#
- remove:
field: event.original
if: "ctx?.tags == null || !(ctx.tags.contains('preserve_original_event'))"
ignore_failure: true
ignore_missing: true
on_failure:
- set:
field: event.kind
value: pipeline_error
- append:
field: error.message
value: '{{{ _ingest.on_failure_message }}}'