Skip to content

Commit 0a2a221

Browse files
[cisco_duo] Fix bad value in ip and date fields (#3700)
* Handle bad values in IP and Date fields * Updated the changelog file * Updated set to append processor in on_failure
1 parent efc513f commit 0a2a221

File tree

14 files changed

+125
-80
lines changed

14 files changed

+125
-80
lines changed

packages/cisco_duo/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.4.0"
3+
changes:
4+
- description: Added support to handle bad values in ip and date fields.
5+
type: enhancement
6+
link: https://github.com/elastic/integrations/pull/3700
27
- version: "1.3.0"
38
changes:
49
- description: Update package to ECS 8.3.0.

packages/cisco_duo/data_stream/admin/elasticsearch/ingest_pipeline/default.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ processors:
2424
- date:
2525
field: json.timestamp
2626
target_field: "@timestamp"
27-
ignore_failure: true
27+
if: ctx.json?.timestamp != null
2828
formats:
2929
- UNIX
30+
on_failure:
31+
- append:
32+
field: error.message
33+
value: "{{{_ingest.on_failure_message}}}"
3034
- set:
3135
field: event.category
3236
value: iam
@@ -150,6 +154,6 @@ processors:
150154
ignore_failure: true
151155
ignore_missing: true
152156
on_failure:
153-
- set:
157+
- append:
154158
field: error.message
155159
value: "{{{_ingest.on_failure_message}}}"

packages/cisco_duo/data_stream/admin/sample_event.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"@timestamp": "2021-07-20T11:41:31.000Z",
33
"agent": {
4-
"ephemeral_id": "d5c469ec-2802-48c4-9828-95a1a38a3d57",
5-
"id": "7cefd7f8-53e3-4884-ab65-da99d71b166f",
4+
"ephemeral_id": "7c7523b2-666f-4792-812c-a5697a8929b9",
5+
"id": "c934978b-c8c9-4484-8fbe-007cc0ace376",
66
"name": "docker-fleet-agent",
77
"type": "filebeat",
8-
"version": "8.0.0-beta1"
8+
"version": "8.2.0"
99
},
1010
"cisco_duo": {
1111
"admin": {
@@ -24,16 +24,16 @@
2424
"version": "8.3.0"
2525
},
2626
"elastic_agent": {
27-
"id": "7cefd7f8-53e3-4884-ab65-da99d71b166f",
27+
"id": "c934978b-c8c9-4484-8fbe-007cc0ace376",
2828
"snapshot": false,
29-
"version": "8.0.0-beta1"
29+
"version": "8.2.0"
3030
},
3131
"event": {
3232
"action": "activation_begin",
3333
"agent_id_status": "verified",
34-
"created": "2021-12-29T09:39:10.869Z",
34+
"created": "2022-07-14T12:20:01.540Z",
3535
"dataset": "cisco_duo.admin",
36-
"ingested": "2021-12-29T09:39:11Z",
36+
"ingested": "2022-07-14T12:20:02Z",
3737
"kind": "event",
3838
"original": "{\"action\":\"activation_begin\",\"description\":\"Starting activation process\",\"isotimestamp\":\"2021-07-20T11: 41: 31+00: 00\",\"object\":null,\"timestamp\":1626781291,\"username\":\"narroway\"}",
3939
"outcome": "success",

packages/cisco_duo/data_stream/auth/elasticsearch/ingest_pipeline/default.yml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ processors:
2121
- date:
2222
field: json.timestamp
2323
target_field: "@timestamp"
24-
ignore_failure: true
24+
if: ctx.json?.timestamp != null
2525
formats:
2626
- UNIX
27+
on_failure:
28+
- append:
29+
field: error.message
30+
value: "{{{_ingest.on_failure_message}}}"
2731
- set:
2832
field: event.category
2933
value: authentication
@@ -64,10 +68,22 @@ processors:
6468
field: json.access_device.ip
6569
type: ip
6670
ignore_missing: true
71+
on_failure:
72+
- remove:
73+
field: json.access_device.ip
74+
- append:
75+
field: error.message
76+
value: "{{{_ingest.on_failure_message}}}"
6777
- convert:
6878
field: json.access_device.port
6979
type: long
7080
ignore_missing: true
81+
on_failure:
82+
- remove:
83+
field: json.access_device.port
84+
- append:
85+
field: error.message
86+
value: "{{{_ingest.on_failure_message}}}"
7187
- set:
7288
field: source.ip
7389
copy_from: json.access_device.ip
@@ -93,10 +109,22 @@ processors:
93109
field: json.auth_device.ip
94110
type: ip
95111
ignore_missing: true
112+
on_failure:
113+
- remove:
114+
field: json.auth_device.ip
115+
- append:
116+
field: error.message
117+
value: "{{{_ingest.on_failure_message}}}"
96118
- convert:
97119
field: json.auth_device.port
98120
type: long
99121
ignore_missing: true
122+
on_failure:
123+
- remove:
124+
field: json.auth_device.port
125+
- append:
126+
field: error.message
127+
value: "{{{_ingest.on_failure_message}}}"
100128
- set:
101129
field: source.address
102130
copy_from: json.access_device.hostname
@@ -359,6 +387,6 @@ processors:
359387
ignore_failure: true
360388
ignore_missing: true
361389
on_failure:
362-
- set:
390+
- append:
363391
field: error.message
364392
value: "{{{_ingest.on_failure_message}}}"

packages/cisco_duo/data_stream/auth/sample_event.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"@timestamp": "2020-02-13T18:56:20.000Z",
33
"agent": {
4-
"ephemeral_id": "0abea523-d85f-42ed-b1a3-8a4c84fa68e1",
5-
"id": "9c2175d9-ba8c-4169-b98d-dfcbc2a7bda3",
4+
"ephemeral_id": "ba2543c1-a84f-4f56-ae2f-cfecef7ef0e4",
5+
"id": "c934978b-c8c9-4484-8fbe-007cc0ace376",
66
"name": "docker-fleet-agent",
77
"type": "filebeat",
88
"version": "8.2.0"
@@ -53,16 +53,16 @@
5353
"version": "8.3.0"
5454
},
5555
"elastic_agent": {
56-
"id": "9c2175d9-ba8c-4169-b98d-dfcbc2a7bda3",
56+
"id": "c934978b-c8c9-4484-8fbe-007cc0ace376",
5757
"snapshot": false,
5858
"version": "8.2.0"
5959
},
6060
"event": {
6161
"agent_id_status": "verified",
6262
"category": "authentication",
63-
"created": "2022-05-31T11:02:38.919Z",
63+
"created": "2022-07-14T12:20:57.028Z",
6464
"dataset": "cisco_duo.auth",
65-
"ingested": "2022-05-31T11:02:40Z",
65+
"ingested": "2022-07-14T12:20:58Z",
6666
"kind": "event",
6767
"original": "{\"access_device\":{\"browser\":\"Chrome\",\"browser_version\":\"67.0.3396.99\",\"flash_version\":\"uninstalled\",\"hostname\":null,\"ip\":\"89.160.20.156\",\"is_encryption_enabled\":true,\"is_firewall_enabled\":true,\"is_password_set\":true,\"java_version\":\"uninstalled\",\"location\":{\"city\":\"Ann Arbor\",\"country\":\"United States\",\"state\":\"Michigan\"},\"os\":\"Mac OS X\",\"os_version\":\"10.14.1\",\"security_agents\":null},\"alias\":\"\",\"application\":{\"key\":\"DIY231J8BR23QK4UKBY8\",\"name\":\"Microsoft Azure Active Directory\"},\"auth_device\":{\"ip\":\"192.168.225.254\",\"location\":{\"city\":\"Ann Arbor\",\"country\":\"United States\",\"state\":\"Michigan\"},\"name\":\"My iPhone X (734-555-2342)\"},\"email\":\"[email protected]\",\"event_type\":\"authentication\",\"factor\":\"duo_push\",\"isotimestamp\":\"2020-02-13T18:56:20.351346+00:00\",\"ood_software\":null,\"reason\":\"user_approved\",\"result\":\"success\",\"timestamp\":1581620180,\"trusted_endpoint_status\":\"not trusted\",\"txid\":\"340a23e3-23f3-23c1-87dc-1491a23dfdbb\",\"user\":{\"groups\":[\"Duo Users\",\"CorpHQ Users\"],\"key\":\"DU3KC77WJ06Y5HIV7XKQ\",\"name\":\"[email protected]\"}}",
6868
"outcome": "success",

packages/cisco_duo/data_stream/offline_enrollment/elasticsearch/ingest_pipeline/default.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ processors:
2424
- date:
2525
field: json.timestamp
2626
target_field: "@timestamp"
27-
ignore_failure: true
27+
if: ctx.json?.timestamp != null
2828
formats:
2929
- UNIX
30+
on_failure:
31+
- append:
32+
field: error.message
33+
value: "{{{_ingest.on_failure_message}}}"
3034
- json:
3135
field: json.description
3236
target_field: json_description
@@ -70,6 +74,6 @@ processors:
7074
ignore_failure: true
7175
ignore_missing: true
7276
on_failure:
73-
- set:
77+
- append:
7478
field: error.message
7579
value: "{{{_ingest.on_failure_message}}}"

packages/cisco_duo/data_stream/offline_enrollment/sample_event.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"@timestamp": "2019-08-30T16:10:05.000Z",
33
"agent": {
4-
"ephemeral_id": "3470fbe5-8d73-49db-8555-7e5f4cfd8504",
5-
"id": "7cefd7f8-53e3-4884-ab65-da99d71b166f",
4+
"ephemeral_id": "0d45b27c-6405-44fa-beda-22c49ad27853",
5+
"id": "c934978b-c8c9-4484-8fbe-007cc0ace376",
66
"name": "docker-fleet-agent",
77
"type": "filebeat",
8-
"version": "8.0.0-beta1"
8+
"version": "8.2.0"
99
},
1010
"cisco_duo": {
1111
"offline_enrollment": {
@@ -30,15 +30,15 @@
3030
"version": "8.3.0"
3131
},
3232
"elastic_agent": {
33-
"id": "7cefd7f8-53e3-4884-ab65-da99d71b166f",
33+
"id": "c934978b-c8c9-4484-8fbe-007cc0ace376",
3434
"snapshot": false,
35-
"version": "8.0.0-beta1"
35+
"version": "8.2.0"
3636
},
3737
"event": {
3838
"agent_id_status": "verified",
39-
"created": "2021-12-29T09:40:24.650Z",
39+
"created": "2022-07-14T12:21:49.801Z",
4040
"dataset": "cisco_duo.offline_enrollment",
41-
"ingested": "2021-12-29T09:40:25Z",
41+
"ingested": "2022-07-14T12:21:53Z",
4242
"original": "{\"action\":\"o2fa_user_provisioned\",\"description\":\"{\\\"user_agent\\\": \\\"DuoCredProv/4.0.6.413 (Windows NT 6.3.9600; x64; Server)\\\", \\\"hostname\\\": \\\"WKSW10x64\\\", \\\"factor\\\": \\\"duo_otp\\\"}\",\"isotimestamp\":\"2019-08-30T16:10:05+00:00\",\"object\":\"Acme Laptop Windows Logon\",\"timestamp\":1567181405,\"username\":\"narroway\"}"
4343
},
4444
"input": {

packages/cisco_duo/data_stream/summary/_dev/test/pipeline/test-summary.log-expected.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"expected": [
33
{
4-
"@timestamp": "2022-06-28T17:52:12.776176085Z",
4+
"@timestamp": "2022-07-14T12:19:12.108699204Z",
55
"cisco_duo": {
66
"summary": {
77
"admin_count": 6,
@@ -21,7 +21,7 @@
2121
]
2222
},
2323
{
24-
"@timestamp": "2022-06-28T17:52:12.776179085Z",
24+
"@timestamp": "2022-07-14T12:19:12.108704244Z",
2525
"cisco_duo": {
2626
"summary": {
2727
"admin_count": 3,

packages/cisco_duo/data_stream/summary/elasticsearch/ingest_pipeline/default.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ processors:
3535
ignore_failure: true
3636
ignore_missing: true
3737
on_failure:
38-
- set:
38+
- append:
3939
field: error.message
4040
value: "{{{_ingest.on_failure_message}}}"

packages/cisco_duo/data_stream/summary/sample_event.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"@timestamp": "2021-12-29T09:41:01.807330132Z",
2+
"@timestamp": "2022-07-14T12:22:46.223536172Z",
33
"agent": {
4-
"ephemeral_id": "88177cd0-9798-45a3-86b1-48ab8de2fe35",
5-
"id": "7cefd7f8-53e3-4884-ab65-da99d71b166f",
4+
"ephemeral_id": "3cdfc076-fea6-4cfc-af6d-57f48e0517be",
5+
"id": "c934978b-c8c9-4484-8fbe-007cc0ace376",
66
"name": "docker-fleet-agent",
77
"type": "filebeat",
8-
"version": "8.0.0-beta1"
8+
"version": "8.2.0"
99
},
1010
"cisco_duo": {
1111
"summary": {
@@ -24,15 +24,15 @@
2424
"version": "8.3.0"
2525
},
2626
"elastic_agent": {
27-
"id": "7cefd7f8-53e3-4884-ab65-da99d71b166f",
27+
"id": "c934978b-c8c9-4484-8fbe-007cc0ace376",
2828
"snapshot": false,
29-
"version": "8.0.0-beta1"
29+
"version": "8.2.0"
3030
},
3131
"event": {
3232
"agent_id_status": "verified",
33-
"created": "2021-12-29T09:41:00.695Z",
33+
"created": "2022-07-14T12:22:42.739Z",
3434
"dataset": "cisco_duo.summary",
35-
"ingested": "2021-12-29T09:41:01Z",
35+
"ingested": "2022-07-14T12:22:46Z",
3636
"original": "{\"response\":{\"admin_count\":3,\"integration_count\":9,\"telephony_credits_remaining\":960,\"user_count\":8},\"stat\":\"OK\"}"
3737
},
3838
"input": {

0 commit comments

Comments
 (0)