22description : Pipeline for processing Hashicorp Vault audit logs.
33processors :
44 - set :
5+ tag : set_ecs_version_f5923549
56 field : ecs.version
67 value : ' 8.17.0'
78 - rename :
9+ tag : rename_message_to_event_original_86cdcc50
810 field : message
911 target_field : event.original
1012 ignore_missing : true
1113 ignore_failure : true
1214 if : ctx.event?.original == null
1315 - json :
16+ tag : json_event_original_to_hashicorp_vault_audit_6c38e128
1417 field : event.original
1518 target_field : hashicorp_vault.audit
1619 ignore_failure : true
@@ -19,10 +22,12 @@ processors:
1922 # @timestamp
2023 #
2124 - date :
25+ tag : date_hashicorp_vault_audit_time_f9f1cd6d
2226 field : hashicorp_vault.audit.time
2327 formats :
2428 - ISO8601
2529 - remove :
30+ tag : remove_c4735a36
2631 field :
2732 - hashicorp_vault.audit.time
2833 ignore_missing : true
@@ -31,85 +36,102 @@ processors:
3136 # event categorization.
3237 #
3338 - set :
39+ tag : set_event_kind_de80643c
3440 field : event.kind
3541 value : event
3642 - append :
43+ tag : append_event_category_109b4d72
3744 field : event.category
3845 value : authentication
3946 # Request operation can be: create, delete, list, read, update.
4047 - append :
48+ tag : append_event_type_c9285984
4149 if : ctx?.hashicorp_vault?.audit?.request?.operation == 'delete'
4250 field : event.type
4351 value : [info, end]
4452 allow_duplicates : false
4553 - append :
54+ tag : append_event_type_ed937003
4655 if : ctx?.hashicorp_vault?.audit?.request?.operation == 'update'
4756 field : event.type
4857 value : info
4958 allow_duplicates : false
5059 - append :
60+ tag : append_event_type_d608774b
5161 if : >
5262 ['read', 'list', 'create'].contains(ctx.hashicorp_vault?.audit?.request?.operation)
5363 field : event.type
5464 value : [info, start]
5565 allow_duplicates : false
5666 - append :
67+ tag : append_event_type_ba367678
5768 if : ctx?.hashicorp_vault?.audit?.error != null
5869 field : event.type
5970 value : info
6071 allow_duplicates : false
6172 - append :
73+ tag : append_event_type_edf811d3
6274 if : ctx?.hashicorp_vault?.audit?.error != null && ctx.hashicorp_vault.audit.error.contains("denied")
6375 field : event.type
6476 value : info
6577 allow_duplicates : false
6678 - set :
79+ tag : set_event_action_aa76e088
6780 field : event.action
6881 copy_from : hashicorp_vault.audit.request.operation
6982
7083 #
7184 # event.outcome
7285 #
7386 - set :
87+ tag : set_event_outcome_18a79512
7488 if : ctx?.hashicorp_vault?.audit?.error == null
7589 field : event.outcome
7690 value : success
7791 - set :
92+ tag : set_event_outcome_eaa01289
7893 if : ctx?.hashicorp_vault?.audit?.error != null
7994 field : event.outcome
8095 value : failure
8196
8297 - set :
98+ tag : set_event_id_5845187a
8399 field : event.id
84100 copy_from : hashicorp_vault.audit.request.id
85101 ignore_failure : true
86102 - set :
103+ tag : set_message_933e1844
87104 field : message
88105 copy_from : hashicorp_vault.audit.error
89106 ignore_failure : true
90107 - convert :
108+ tag : convert_hashicorp_vault_audit_request_remote_address_to_source_ip_98cf868d
91109 field : hashicorp_vault.audit.request.remote_address
92110 target_field : source.ip
93111 type : ip
94112 ignore_missing : true
95113 - convert :
114+ tag : convert_hashicorp_vault_audit_request_remote_port_to_source_port_1efe5263
96115 field : hashicorp_vault.audit.request.remote_port
97116 target_field : source.port
98117 type : long
99118 ignore_missing : true
100119
101120 # OIDC auth metadata.
102121 - set :
122+ tag : set_user_email_44dc7cff
103123 field : user.email
104124 copy_from : hashicorp_vault.audit.auth.metadata.email
105125 ignore_failure : true
106126 - set :
127+ tag : set_user_id_11ea468d
107128 field : user.id
108129 copy_from : hashicorp_vault.audit.auth.metadata.account_id
109130 ignore_failure : true
110131
111132 # Nomad auth metadata. (Recognize it by the presence of all four fields.)
112133 - set :
134+ tag : set_nomad_allocation_id_7d186f74
113135 if : >
114136 ctx?.hashicorp_vault?.audit?.auth?.metadata?.AllocationID != null &&
115137 ctx?.hashicorp_vault?.audit?.auth?.metadata?.NodeID != null &&
@@ -119,6 +141,7 @@ processors:
119141 copy_from : hashicorp_vault.audit.auth.metadata.AllocationID
120142 ignore_failure : true
121143 - set :
144+ tag : set_nomad_namespace_e9a67c6c
122145 if : >
123146 ctx?.hashicorp_vault?.audit?.auth?.metadata?.AllocationID != null &&
124147 ctx?.hashicorp_vault?.audit?.auth?.metadata?.NodeID != null &&
@@ -128,6 +151,7 @@ processors:
128151 copy_from : hashicorp_vault.audit.auth.metadata.Namespace
129152 ignore_failure : true
130153 - set :
154+ tag : set_nomad_node_id_dd6c1680
131155 if : >
132156 ctx?.hashicorp_vault?.audit?.auth?.metadata?.AllocationID != null &&
133157 ctx?.hashicorp_vault?.audit?.auth?.metadata?.NodeID != null &&
@@ -137,6 +161,7 @@ processors:
137161 copy_from : hashicorp_vault.audit.auth.metadata.NodeID
138162 ignore_failure : true
139163 - set :
164+ tag : set_nomad_task_name_d3c4aba5
140165 if : >
141166 ctx?.hashicorp_vault?.audit?.auth?.metadata?.AllocationID != null &&
142167 ctx?.hashicorp_vault?.audit?.auth?.metadata?.NodeID != null &&
@@ -148,11 +173,13 @@ processors:
148173
149174 # IP Geolocation Lookup
150175 - geoip :
176+ tag : geoip_source_ip_to_source_geo_da2e41b2
151177 field : source.ip
152178 target_field : source.geo
153179 ignore_missing : true
154180 # IP Autonomous System (AS) Lookup
155181 - geoip :
182+ tag : geoip_source_ip_to_source_as_28d69883
156183 database_file : GeoLite2-ASN.mmdb
157184 field : source.ip
158185 target_field : source.as
@@ -161,15 +188,18 @@ processors:
161188 - organization_name
162189 ignore_missing : true
163190 - rename :
191+ tag : rename_source_as_asn_to_source_as_number_a917047d
164192 field : source.as.asn
165193 target_field : source.as.number
166194 ignore_missing : true
167195 - rename :
196+ tag : rename_source_as_organization_name_to_source_as_organization_name_f1362d0b
168197 field : source.as.organization_name
169198 target_field : source.as.organization.name
170199 ignore_missing : true
171200
172201 - append :
202+ tag : append_related_ip_549fa858
173203 field : related.ip
174204 value : ' {{{source.ip}}}'
175205 allow_duplicates : false
@@ -180,4 +210,8 @@ on_failure:
180210 value : pipeline_error
181211 - append :
182212 field : error.message
183- value : ' {{{ _ingest.on_failure_message }}}'
213+ value : >-
214+ Processor '{{{ _ingest.on_failure_processor_type }}}'
215+ {{#_ingest.on_failure_processor_tag}}with tag '{{{ _ingest.on_failure_processor_tag }}}'
216+ {{/_ingest.on_failure_processor_tag}}in pipeline '{{{ _ingest.pipeline }}}'
217+ failed with message '{{{ _ingest.on_failure_message }}}'
0 commit comments