Skip to content

Commit 0c91e64

Browse files
authored
gcp: remove gcp.audit.* fields duplicated in ECS fields (#3609)
1 parent 26a3bd1 commit 0c91e64

File tree

13 files changed

+205
-363
lines changed

13 files changed

+205
-363
lines changed

packages/gcp/changelog.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
# newer versions go on top
2-
- version: 2.1.0
2+
- version: "2.2.0"
3+
changes:
4+
- description: Remove fields duplicated in ECS fields
5+
type: enhancement
6+
link: https://github.com/elastic/integrations/pull/3609
7+
- version: "2.1.0"
38
changes:
49
- description: restore compatibility with 7.17 release track
510
type: enhancement
611
link: foobar
7-
- version: 2.0.0
12+
- version: "2.0.0"
813
changes:
914
- description: |
1015
Move configurations to support metrics. This change is breaking, as it moves

packages/gcp/data_stream/audit/_dev/test/pipeline/test-audit.log-expected.json

Lines changed: 0 additions & 127 deletions
Large diffs are not rendered by default.

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

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,24 @@ processors:
127127
target_field: gcp.audit.authentication_info.authority_selector
128128
ignore_missing: true
129129

130-
# TODO remove - duplicated in client.user.email and client.user.id
131-
- set:
130+
- rename:
132131
field: gcp.audit.authentication_info.principal_email
133-
copy_from: client.user.email
134-
if: ctx.client?.user?.email != null
135-
- set:
132+
target_field: client.user.email
133+
if: ctx.client?.user?.email == null
134+
ignore_missing: true
135+
- remove:
136+
field: gcp.audit.authentication_info.principal_email
137+
if: ctx.client?.user?.email == ctx.gcp?.audit?.authentication_info?.principal_email
138+
ignore_missing: true
139+
- rename:
140+
field: gcp.audit.authentication_info.principal_subject
141+
target_field: client.user.id
142+
if: ctx.client?.user?.id == null
143+
ignore_missing: true
144+
- remove:
136145
field: gcp.audit.authentication_info.principal_subject
137-
copy_from: client.user.id
138-
if: ctx.client?.user?.id != null
146+
if: ctx.client?.user?.id == ctx.gcp?.audit?.authentication_info?.principal_subject
147+
ignore_missing: true
139148
##
140149
# AuthorizationInfo
141150
# .protoPayload.authorizationInfo
@@ -174,15 +183,10 @@ processors:
174183
field: json.protoPayload.requestMetadata.callerIp
175184
target_field: source.ip
176185
ignore_missing: true
177-
# TODO remove - duplicated in useragent
178186
- rename:
179187
field: json.protoPayload.requestMetadata.callerSuppliedUserAgent
180-
target_field: gcp.audit.request_metadata.caller_supplied_user_agent
188+
target_field: user_agent.original
181189
ignore_missing: true
182-
- set:
183-
field: user_agent.original
184-
value: "{{gcp.audit.request_metadata.caller_supplied_user_agent}}"
185-
if: ctx?.gcp?.audit?.request_metadata?.caller_supplied_user_agent != null
186190
- user_agent:
187191
field: user_agent.original
188192
ignore_missing: true
@@ -224,12 +228,8 @@ processors:
224228
# TODO remove duplicate protoPayload.methodName
225229
- rename:
226230
field: json.protoPayload.methodName
227-
target_field: gcp.audit.method_name
231+
target_field: event.action
228232
ignore_missing: true
229-
- set:
230-
field: event.action
231-
value: "{{gcp.audit.method_name}}"
232-
if: ctx?.gcp?.audit?.method_name != null
233233
- convert:
234234
field: json.protoPayload.numResponseItems
235235
target_field: gcp.audit.num_response_items
@@ -261,15 +261,15 @@ processors:
261261
field: json.protoPayload.resourceLocation.currentLocations
262262
target_field: gcp.audit.resource_location.current_locations
263263
ignore_missing: true
264-
# TODO remove duplicate json.protoPayload.serviceName
265264
- rename:
266265
field: json.protoPayload.serviceName
267266
target_field: gcp.audit.service_name
268267
ignore_missing: true
269-
- set:
270-
field: service.name
271-
value: "{{gcp.audit.service_name}}"
272-
if: ctx?.gcp?.audit?.service_name != null
268+
- rename:
269+
field: gcp.audit.service_name
270+
target_field: service.name
271+
if: ctx.service?.name == null
272+
ignore_missing: true
273273
##
274274
# .protoPayload.Status
275275
# https://cloud.google.com/logging/docs/reference/audit/auditlog/rest/Shared.Types/AuditLog#Status

packages/gcp/data_stream/audit/sample_event.json

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
{
22
"@timestamp": "2019-12-19T00:44:25.051Z",
33
"agent": {
4-
"ephemeral_id": "15ffa48e-049a-4ead-9716-cea0236748c4",
5-
"hostname": "docker-fleet-agent",
6-
"id": "df142714-8028-4ef0-a80c-4eb03051c084",
4+
"ephemeral_id": "9edf0b6c-05b7-451e-83ad-13b2a23bf4e5",
5+
"id": "08bce509-f1bf-4b71-8b6b-b8965e7a733b",
76
"name": "docker-fleet-agent",
87
"type": "filebeat",
9-
"version": "7.17.0"
8+
"version": "8.2.3"
109
},
1110
"client": {
1211
"user": {
@@ -28,9 +27,9 @@
2827
"version": "8.3.0"
2928
},
3029
"elastic_agent": {
31-
"id": "df142714-8028-4ef0-a80c-4eb03051c084",
30+
"id": "08bce509-f1bf-4b71-8b6b-b8965e7a733b",
3231
"snapshot": false,
33-
"version": "7.17.0"
32+
"version": "8.2.3"
3433
},
3534
"event": {
3635
"action": "beta.compute.instances.aggregatedList",
@@ -39,10 +38,10 @@
3938
"network",
4039
"configuration"
4140
],
42-
"created": "2022-05-20T07:25:00.534Z",
41+
"created": "2022-06-28T02:45:52.230Z",
4342
"dataset": "gcp.audit",
4443
"id": "yonau2dg2zi",
45-
"ingested": "2022-05-20T07:25:01Z",
44+
"ingested": "2022-06-28T02:45:53Z",
4645
"kind": "event",
4746
"outcome": "success",
4847
"provider": "data_access",
@@ -53,9 +52,6 @@
5352
},
5453
"gcp": {
5554
"audit": {
56-
"authentication_info": {
57-
"principal_email": "xxx@xxx.xxx"
58-
},
5955
"authorization_info": [
6056
{
6157
"granted": true,
@@ -67,14 +63,10 @@
6763
}
6864
}
6965
],
70-
"method_name": "beta.compute.instances.aggregatedList",
7166
"num_response_items": 61,
7267
"request": {
7368
"@type": "type.googleapis.com/compute.instances.aggregatedList"
7469
},
75-
"request_metadata": {
76-
"caller_supplied_user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:71.0) Gecko/20100101 Firefox/71.0,gzip(gfe),gzip(gfe)"
77-
},
7870
"resource_location": {
7971
"current_locations": [
8072
"global"
@@ -91,9 +83,8 @@
9183
"uid": "2beff34a-945f-11ea-bacf-42010a80007f"
9284
},
9385
"kind": "Status",
94-
"status": "Success"
86+
"status_value": "Success"
9587
},
96-
"service_name": "compute.googleapis.com",
9788
"type": "type.googleapis.com/google.cloud.audit.AuditLog"
9889
}
9990
},

packages/gcp/data_stream/dns/sample_event.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
{
22
"@timestamp": "2022-01-23T09:16:05.341Z",
33
"agent": {
4-
"ephemeral_id": "0d2f83ac-67e6-454f-84eb-859aa503167a",
5-
"hostname": "docker-fleet-agent",
6-
"id": "df142714-8028-4ef0-a80c-4eb03051c084",
4+
"ephemeral_id": "0b86920e-9dac-4b22-91c8-e594b22a00b4",
5+
"id": "08bce509-f1bf-4b71-8b6b-b8965e7a733b",
76
"name": "docker-fleet-agent",
87
"type": "filebeat",
9-
"version": "7.17.0"
8+
"version": "8.2.3"
109
},
1110
"cloud": {
1211
"availability_zone": "europe-west2-a",
@@ -50,16 +49,16 @@
5049
"version": "8.3.0"
5150
},
5251
"elastic_agent": {
53-
"id": "df142714-8028-4ef0-a80c-4eb03051c084",
52+
"id": "08bce509-f1bf-4b71-8b6b-b8965e7a733b",
5453
"snapshot": false,
55-
"version": "7.17.0"
54+
"version": "8.2.3"
5655
},
5756
"event": {
5857
"agent_id_status": "verified",
59-
"created": "2022-05-20T07:25:43.755Z",
58+
"created": "2022-06-28T02:46:41.230Z",
6059
"dataset": "gcp.dns",
6160
"id": "vwroyze8pg7y",
62-
"ingested": "2022-05-20T07:25:44Z",
61+
"ingested": "2022-06-28T02:46:42Z",
6362
"kind": "event",
6463
"outcome": "success"
6564
},

packages/gcp/data_stream/firewall/sample_event.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
{
22
"@timestamp": "2019-10-30T13:52:42.191Z",
33
"agent": {
4-
"ephemeral_id": "1f7633a7-3410-4684-bb55-14b0bd0e2bd4",
5-
"hostname": "docker-fleet-agent",
6-
"id": "df142714-8028-4ef0-a80c-4eb03051c084",
4+
"ephemeral_id": "da5a2e43-d26c-4ee3-bbf3-ad9d9ab853ec",
5+
"id": "08bce509-f1bf-4b71-8b6b-b8965e7a733b",
76
"name": "docker-fleet-agent",
87
"type": "filebeat",
9-
"version": "7.17.0"
8+
"version": "8.2.3"
109
},
1110
"cloud": {
1211
"availability_zone": "us-east1-b",
@@ -31,18 +30,18 @@
3130
"version": "8.3.0"
3231
},
3332
"elastic_agent": {
34-
"id": "df142714-8028-4ef0-a80c-4eb03051c084",
33+
"id": "08bce509-f1bf-4b71-8b6b-b8965e7a733b",
3534
"snapshot": false,
36-
"version": "7.17.0"
35+
"version": "8.2.3"
3736
},
3837
"event": {
3938
"action": "firewall-rule",
4039
"agent_id_status": "verified",
4140
"category": "network",
42-
"created": "2022-05-20T07:26:27.445Z",
41+
"created": "2022-06-28T02:47:26.097Z",
4342
"dataset": "gcp.firewall",
4443
"id": "1f21ciqfpfssuo",
45-
"ingested": "2022-05-20T07:26:28Z",
44+
"ingested": "2022-06-28T02:47:27Z",
4645
"kind": "event",
4746
"type": "connection"
4847
},

packages/gcp/data_stream/vpcflow/sample_event.json

Lines changed: 36 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
{
22
"@timestamp": "2019-06-14T03:50:10.845Z",
33
"agent": {
4-
"ephemeral_id": "10bb82a5-c0e6-4aed-8589-003f734a7183",
5-
"hostname": "docker-fleet-agent",
6-
"id": "df142714-8028-4ef0-a80c-4eb03051c084",
4+
"ephemeral_id": "cb760ad9-6bf9-465b-9022-e5de8df2ba82",
5+
"id": "08bce509-f1bf-4b71-8b6b-b8965e7a733b",
76
"name": "docker-fleet-agent",
87
"type": "filebeat",
9-
"version": "7.17.0"
8+
"version": "8.2.3"
109
},
1110
"cloud": {
1211
"availability_zone": "us-east1-b",
@@ -22,41 +21,29 @@
2221
"type": "logs"
2322
},
2423
"destination": {
25-
"address": "67.43.156.14",
26-
"as": {
27-
"number": 35908
28-
},
24+
"address": "10.139.99.242",
2925
"domain": "elasticsearch",
30-
"geo": {
31-
"continent_name": "Asia",
32-
"country_iso_code": "BT",
33-
"country_name": "Bhutan",
34-
"location": {
35-
"lat": 27.5,
36-
"lon": 90.5
37-
}
38-
},
39-
"ip": "67.43.156.14",
26+
"ip": "10.139.99.242",
4027
"port": 9200
4128
},
4229
"ecs": {
4330
"version": "8.3.0"
4431
},
4532
"elastic_agent": {
46-
"id": "df142714-8028-4ef0-a80c-4eb03051c084",
33+
"id": "08bce509-f1bf-4b71-8b6b-b8965e7a733b",
4734
"snapshot": false,
48-
"version": "7.17.0"
35+
"version": "8.2.3"
4936
},
5037
"event": {
5138
"agent_id_status": "verified",
5239
"category": "network",
53-
"created": "2022-05-20T07:27:09.739Z",
40+
"created": "2022-06-28T02:48:14.443Z",
5441
"dataset": "gcp.vpcflow",
55-
"end": "2019-06-14T03:49:51.821308944Z",
56-
"id": "ut8lbrffooxyp",
57-
"ingested": "2022-05-20T07:27:10Z",
42+
"end": "2019-06-14T03:49:51.821056075Z",
43+
"id": "ut8lbrffooxz5",
44+
"ingested": "2022-06-28T02:48:15Z",
5845
"kind": "event",
59-
"start": "2019-06-14T03:40:08.469099728Z",
46+
"start": "2019-06-14T03:40:20.510622432Z",
6047
"type": "connection"
6148
},
6249
"gcp": {
@@ -85,9 +72,9 @@
8572
}
8673
},
8774
"vpcflow": {
88-
"reporter": "SRC",
75+
"reporter": "DEST",
8976
"rtt": {
90-
"ms": 3
77+
"ms": 201
9178
}
9279
}
9380
},
@@ -98,28 +85,40 @@
9885
"logger": "projects/my-sample-project/logs/compute.googleapis.com%2Fvpc_flows"
9986
},
10087
"network": {
101-
"bytes": 15169,
102-
"community_id": "1:NAY9D1IuyJAG+Hm34t3LIlP6/4c=",
88+
"bytes": 11773,
89+
"community_id": "1:FYaJFSEAKLcBCMFoT6sR5TMHf/s=",
10390
"direction": "internal",
10491
"iana_number": "6",
10592
"name": "default",
106-
"packets": 92,
93+
"packets": 94,
10794
"transport": "tcp",
10895
"type": "ipv4"
10996
},
11097
"related": {
11198
"ip": [
112-
"10.87.40.76",
113-
"67.43.156.14"
99+
"67.43.156.13",
100+
"10.139.99.242"
114101
]
115102
},
116103
"source": {
117-
"address": "10.87.40.76",
118-
"bytes": 15169,
104+
"address": "67.43.156.13",
105+
"as": {
106+
"number": 35908
107+
},
108+
"bytes": 11773,
119109
"domain": "kibana",
120-
"ip": "10.87.40.76",
121-
"packets": 92,
122-
"port": 33880
110+
"geo": {
111+
"continent_name": "Asia",
112+
"country_iso_code": "BT",
113+
"country_name": "Bhutan",
114+
"location": {
115+
"lat": 27.5,
116+
"lon": 90.5
117+
}
118+
},
119+
"ip": "67.43.156.13",
120+
"packets": 94,
121+
"port": 33576
123122
},
124123
"tags": [
125124
"forwarded",

0 commit comments

Comments
 (0)