Skip to content

Commit b9e4108

Browse files
[hashicorp_vault] Generate processor tags and normalize error handler
- Generate tags for processors missing tags - Normalize the pipeline error handler
1 parent dbf1e3e commit b9e4108

File tree

6 files changed

+75
-5
lines changed

6 files changed

+75
-5
lines changed

packages/hashicorp_vault/changelog.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# newer versions go on top
2+
- version: "1.28.2"
3+
changes:
4+
- description: Generate processor tags and normalize error handler.
5+
type: enhancement
6+
link: https://github.com/elastic/integrations/pull/15544
27
- version: "1.28.1"
38
changes:
49
- description: Changed owners.

packages/hashicorp_vault/data_stream/audit/elasticsearch/ingest_pipeline/default.yml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,18 @@
22
description: Pipeline for processing Hashicorp Vault audit logs.
33
processors:
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 }}}'

packages/hashicorp_vault/data_stream/log/elasticsearch/ingest_pipeline/default.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22
description: Pipeline for processing Hashicorp Vault operational logs.
33
processors:
44
- set:
5+
tag: set_ecs_version_f5923549
56
field: ecs.version
67
value: '8.17.0'
78
- set:
9+
tag: set_event_kind_de80643c
810
field: event.kind
911
value: event
1012
- rename:
13+
tag: rename_message_to_event_original_86cdcc50
1114
field: message
1215
target_field: event.original
1316
ignore_failure: true
@@ -17,12 +20,14 @@ processors:
1720
# JSON logs
1821
#
1922
- pipeline:
23+
tag: pipeline_e73534a9
2024
if: ctx?.event?.original != null && ctx.event.original.startsWith("{")
2125
name: '{{ IngestPipeline "json" }}'
2226
#
2327
# Non-JSON logs
2428
#
2529
- set:
30+
tag: set_message_e46300a8
2631
if: ctx?.event?.original != null && !ctx.event.original.startsWith("{")
2732
field: message
2833
copy_from: event.original
@@ -33,4 +38,8 @@ on_failure:
3338
value: pipeline_error
3439
- append:
3540
field: error.message
36-
value: '{{{ _ingest.on_failure_message }}}'
41+
value: >-
42+
Processor '{{{ _ingest.on_failure_processor_type }}}'
43+
{{#_ingest.on_failure_processor_tag}}with tag '{{{ _ingest.on_failure_processor_tag }}}'
44+
{{/_ingest.on_failure_processor_tag}}in pipeline '{{{ _ingest.pipeline }}}'
45+
failed with message '{{{ _ingest.on_failure_message }}}'

packages/hashicorp_vault/data_stream/log/elasticsearch/ingest_pipeline/json.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,20 @@
22
description: Pipeline for processing Hashicorp Vault operational logs in JSON format.
33
processors:
44
- json:
5+
tag: json_event_original_to_hashicorp_vault_log_5f9af198
56
field: event.original
67
target_field: hashicorp_vault.log
78

89
#
910
# @timestamp
1011
#
1112
- date:
13+
tag: date_hashicorp_vault_log_@timestamp_23c74f3b
1214
field: hashicorp_vault.log.@timestamp
1315
formats:
1416
- ISO8601
1517
- remove:
18+
tag: remove_77ba3bd8
1619
field:
1720
- hashicorp_vault.log.@timestamp
1821
ignore_missing: true
@@ -21,14 +24,17 @@ processors:
2124
# Rename standard fields to ECS.
2225
#
2326
- rename:
27+
tag: rename_hashicorp_vault_log_@level_to_log_level_db9c59ae
2428
field: hashicorp_vault.log.@level
2529
target_field: log.level
2630
ignore_missing: true
2731
- rename:
32+
tag: rename_hashicorp_vault_log_@message_to_message_15c25a34
2833
field: hashicorp_vault.log.@message
2934
target_field: message
3035
ignore_missing: true
3136
- rename:
37+
tag: rename_hashicorp_vault_log_@module_to_log_logger_2657cf6c
3238
field: hashicorp_vault.log.@module
3339
target_field: log.logger
3440
ignore_missing: true
@@ -47,6 +53,7 @@ processors:
4753
# Copy structured fields to ECS fields. Retain the originals for easy reference.
4854
#
4955
- set:
56+
tag: set_file_path_e43bb141
5057
field: file.path
5158
copy_from: hashicorp_vault.log.file_path
5259
ignore_failure: true
@@ -56,4 +63,8 @@ on_failure:
5663
value: pipeline_error
5764
- append:
5865
field: error.message
59-
value: '{{{ _ingest.on_failure_message }}}'
66+
value: >-
67+
Processor '{{{ _ingest.on_failure_processor_type }}}'
68+
{{#_ingest.on_failure_processor_tag}}with tag '{{{ _ingest.on_failure_processor_tag }}}'
69+
{{/_ingest.on_failure_processor_tag}}in pipeline '{{{ _ingest.pipeline }}}'
70+
failed with message '{{{ _ingest.on_failure_message }}}'

packages/hashicorp_vault/data_stream/metrics/elasticsearch/ingest_pipeline/default.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
description: Pipeline for processing Hashicorp Vault metrics.
33
processors:
44
- remove:
5+
tag: remove_0f1df825
56
field:
67
- event.dataset
78
- event.module
@@ -10,23 +11,29 @@ processors:
1011
- service.type
1112
ignore_missing: true
1213
- set:
14+
tag: set_ecs_version_f5923549
1315
field: ecs.version
1416
value: '8.17.0'
1517
- set:
18+
tag: set_service_type_6ed233ed
1619
field: service.type
1720
value: hashicorp_vault
1821
- set:
22+
tag: set_event_kind_495d69f0
1923
field: event.kind
2024
value: metric
2125
- rename:
26+
tag: rename_prometheus_labels_to_labels_01ec3db0
2227
field: prometheus.labels
2328
target_field: labels
2429
ignore_missing: true
2530
- set:
31+
tag: set_labels_job_8e615894
2632
field: labels.job
2733
value: hashicorp_vault
2834
override: true
2935
- rename:
36+
tag: rename_prometheus_to_hashicorp_vault_metrics_6ac57ed1
3037
field: prometheus
3138
target_field: hashicorp_vault.metrics
3239
ignore_missing: true
@@ -36,4 +43,8 @@ on_failure:
3643
value: pipeline_error
3744
- append:
3845
field: error.message
39-
value: '{{{ _ingest.on_failure_message }}}'
46+
value: >-
47+
Processor '{{{ _ingest.on_failure_processor_type }}}'
48+
{{#_ingest.on_failure_processor_tag}}with tag '{{{ _ingest.on_failure_processor_tag }}}'
49+
{{/_ingest.on_failure_processor_tag}}in pipeline '{{{ _ingest.pipeline }}}'
50+
failed with message '{{{ _ingest.on_failure_message }}}'

packages/hashicorp_vault/manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
format_version: "3.0.3"
22
name: hashicorp_vault
33
title: Hashicorp Vault
4-
version: "1.28.1"
4+
version: "1.28.2"
55
description: Collect logs and metrics from Hashicorp Vault with Elastic Agent.
66
type: integration
77
categories:

0 commit comments

Comments
 (0)