-
Notifications
You must be signed in to change notification settings - Fork 427
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Zeek NTP and Signature data streams
- Loading branch information
1 parent
3d0f9e2
commit 20b4357
Showing
40 changed files
with
2,396 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{"ts":1602116947.977,"uid":"CqlPpF1AQVLMPgGiL5","id.orig_h":"130.118.205.62","id.orig_p":38461,"id.resp_h":"208.79.89.249","id.resp_p":123,"version":4,"mode":3,"stratum":0,"poll":1,"precision":1,"root_delay":0,"root_disp":0,"ref_id":"\\x00\\x00\\x00\\x00","ref_time":0,"org_time":0,"rec_time":0,"xmt_time":1602116947.215,"num_exts":0} | ||
{"ts":1602116948.081,"uid":"CqlPpF1AQVLMPgGiL5","id.orig_h":"130.118.205.62","id.orig_p":38461,"id.resp_h":"208.79.89.249","id.resp_p":123,"version":4,"mode":4,"stratum":2,"poll":8,"precision":5.960464477539063e-8,"root_delay":0.00921630859375,"root_disp":0.0212249755859375,"ref_id":"127.67.113.92","ref_time":1602116655.942,"org_time":1602116947.215,"rec_time":1602116947.964,"xmt_time":1602116947.964,"num_exts":0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"ts": 1611852809.869245,"uid": "CbjAXE4CBxJ8W7VoJg","src_addr": "124.51.137.154","src_port": 51617,"dst_addr": "160.218.27.63","dst_port": 445,"note": "Signatures::Sensitive_Signature","sig_id": "my-second-sig","event_msg": "124.51.137.154: TCP traffic","sub_msg": ""} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
126 changes: 54 additions & 72 deletions
126
packages/zeek/data_stream/connection/_dev/test/pipeline/test-conn.log-expected.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
packages/zeek/data_stream/ntp/_dev/test/pipeline/test-ntp.log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{"ts":1602116947.977,"uid":"CqlPpF1AQVLMPgGiL5","id.orig_h":"130.118.205.62","id.orig_p":38461,"id.resp_h":"208.79.89.249","id.resp_p":123,"version":4,"mode":3,"stratum":0,"poll":1,"precision":1,"root_delay":0,"root_disp":0,"ref_id":"\\x00\\x00\\x00\\x00","ref_time":0,"org_time":0,"rec_time":0,"xmt_time":1602116947.215,"num_exts":0} | ||
{"ts":1602116948.081,"uid":"CqlPpF1AQVLMPgGiL5","id.orig_h":"130.118.205.62","id.orig_p":38461,"id.resp_h":"208.79.89.249","id.resp_p":123,"version":4,"mode":4,"stratum":2,"poll":8,"precision":5.960464477539063e-8,"root_delay":0.00921630859375,"root_disp":0.0212249755859375,"ref_id":"127.67.113.92","ref_time":1602116655.942,"org_time":1602116947.215,"rec_time":1602116947.964,"xmt_time":1602116947.964,"num_exts":0} |
6 changes: 6 additions & 0 deletions
6
packages/zeek/data_stream/ntp/_dev/test/pipeline/test-ntp.log-config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
dynamic_fields: | ||
event.ingested: ".*" | ||
fields: | ||
"@timestamp": "2020-04-28T11:07:58.223Z" | ||
tags: | ||
- preserve_original_event |
176 changes: 176 additions & 0 deletions
176
packages/zeek/data_stream/ntp/_dev/test/pipeline/test-ntp.log-expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,176 @@ | ||
{ | ||
"expected": [ | ||
{ | ||
"@timestamp": "2020-10-08T00:29:07.977Z", | ||
"ecs": { | ||
"version": "1.10.0" | ||
}, | ||
"related": { | ||
"ip": [ | ||
"130.118.205.62", | ||
"208.79.89.249" | ||
] | ||
}, | ||
"destination": { | ||
"geo": { | ||
"continent_name": "North America", | ||
"country_name": "United States", | ||
"location": { | ||
"lon": -97.822, | ||
"lat": 37.751 | ||
}, | ||
"country_iso_code": "US" | ||
}, | ||
"as": { | ||
"number": 25795, | ||
"organization": { | ||
"name": "ARP NETWORKS, INC." | ||
} | ||
}, | ||
"address": "208.79.89.249", | ||
"port": 123, | ||
"ip": "208.79.89.249" | ||
}, | ||
"zeek": { | ||
"session_id": "CqlPpF1AQVLMPgGiL5", | ||
"ntp": { | ||
"ref_id": "\\x00\\x00\\x00\\x00", | ||
"rec_time": "1970-01-01T00:00:00.000Z", | ||
"ref_time": "1970-01-01T00:00:00.000Z", | ||
"root_delay": 0, | ||
"precision": 1, | ||
"poll": 1, | ||
"version": 4, | ||
"num_exts": 0, | ||
"stratum": 0, | ||
"mode": 3, | ||
"root_disp": 0, | ||
"org_time": "1970-01-01T00:00:00.000Z", | ||
"xmt_time": "2020-10-08T00:29:07.215Z" | ||
} | ||
}, | ||
"source": { | ||
"geo": { | ||
"continent_name": "North America", | ||
"country_name": "United States", | ||
"location": { | ||
"lon": -97.822, | ||
"lat": 37.751 | ||
}, | ||
"country_iso_code": "US" | ||
}, | ||
"address": "130.118.205.62", | ||
"port": 38461, | ||
"ip": "130.118.205.62" | ||
}, | ||
"event": { | ||
"ingested": "2021-08-10T12:16:45.963639174Z", | ||
"original": "{\"ts\":1602116947.977,\"uid\":\"CqlPpF1AQVLMPgGiL5\",\"id.orig_h\":\"130.118.205.62\",\"id.orig_p\":38461,\"id.resp_h\":\"208.79.89.249\",\"id.resp_p\":123,\"version\":4,\"mode\":3,\"stratum\":0,\"poll\":1,\"precision\":1,\"root_delay\":0,\"root_disp\":0,\"ref_id\":\"\\\\x00\\\\x00\\\\x00\\\\x00\",\"ref_time\":0,\"org_time\":0,\"rec_time\":0,\"xmt_time\":1602116947.215,\"num_exts\":0}", | ||
"created": "2020-04-28T11:07:58.223Z", | ||
"kind": "event", | ||
"id": "CqlPpF1AQVLMPgGiL5", | ||
"category": "network", | ||
"type": [ | ||
"connection", | ||
"protocol", | ||
"info" | ||
] | ||
}, | ||
"tags": [ | ||
"preserve_original_event" | ||
], | ||
"network": { | ||
"protocol": "ntp", | ||
"community_id": "1:IDiKR+C1G8mk7LQhFpp+4p1tHrk=", | ||
"transport": "udp", | ||
"type": "ipv4" | ||
} | ||
}, | ||
{ | ||
"@timestamp": "2020-10-08T00:29:08.081Z", | ||
"ecs": { | ||
"version": "1.10.0" | ||
}, | ||
"related": { | ||
"ip": [ | ||
"130.118.205.62", | ||
"208.79.89.249" | ||
] | ||
}, | ||
"destination": { | ||
"geo": { | ||
"continent_name": "North America", | ||
"country_name": "United States", | ||
"location": { | ||
"lon": -97.822, | ||
"lat": 37.751 | ||
}, | ||
"country_iso_code": "US" | ||
}, | ||
"as": { | ||
"number": 25795, | ||
"organization": { | ||
"name": "ARP NETWORKS, INC." | ||
} | ||
}, | ||
"address": "208.79.89.249", | ||
"port": 123, | ||
"ip": "208.79.89.249" | ||
}, | ||
"zeek": { | ||
"session_id": "CqlPpF1AQVLMPgGiL5", | ||
"ntp": { | ||
"ref_id": "127.67.113.92", | ||
"rec_time": "2020-10-08T00:29:07.964Z", | ||
"ref_time": "2020-10-08T00:24:15.942Z", | ||
"root_delay": 0.00921630859375, | ||
"precision": 5.9604644775390625E-8, | ||
"poll": 8, | ||
"version": 4, | ||
"num_exts": 0, | ||
"stratum": 2, | ||
"mode": 4, | ||
"root_disp": 0.0212249755859375, | ||
"org_time": "2020-10-08T00:29:07.215Z", | ||
"xmt_time": "2020-10-08T00:29:07.964Z" | ||
} | ||
}, | ||
"source": { | ||
"geo": { | ||
"continent_name": "North America", | ||
"country_name": "United States", | ||
"location": { | ||
"lon": -97.822, | ||
"lat": 37.751 | ||
}, | ||
"country_iso_code": "US" | ||
}, | ||
"address": "130.118.205.62", | ||
"port": 38461, | ||
"ip": "130.118.205.62" | ||
}, | ||
"event": { | ||
"ingested": "2021-08-10T12:16:45.963645447Z", | ||
"original": "{\"ts\":1602116948.081,\"uid\":\"CqlPpF1AQVLMPgGiL5\",\"id.orig_h\":\"130.118.205.62\",\"id.orig_p\":38461,\"id.resp_h\":\"208.79.89.249\",\"id.resp_p\":123,\"version\":4,\"mode\":4,\"stratum\":2,\"poll\":8,\"precision\":5.960464477539063e-8,\"root_delay\":0.00921630859375,\"root_disp\":0.0212249755859375,\"ref_id\":\"127.67.113.92\",\"ref_time\":1602116655.942,\"org_time\":1602116947.215,\"rec_time\":1602116947.964,\"xmt_time\":1602116947.964,\"num_exts\":0}", | ||
"created": "2020-04-28T11:07:58.223Z", | ||
"kind": "event", | ||
"id": "CqlPpF1AQVLMPgGiL5", | ||
"category": "network", | ||
"type": [ | ||
"connection", | ||
"protocol", | ||
"info" | ||
] | ||
}, | ||
"tags": [ | ||
"preserve_original_event" | ||
], | ||
"network": { | ||
"protocol": "ntp", | ||
"community_id": "1:IDiKR+C1G8mk7LQhFpp+4p1tHrk=", | ||
"transport": "udp", | ||
"type": "ipv4" | ||
} | ||
} | ||
] | ||
} |
6 changes: 6 additions & 0 deletions
6
packages/zeek/data_stream/ntp/_dev/test/system/test-logs-config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
vars: | ||
base_paths: | ||
- "{{SERVICE_LOGS_DIR}}" | ||
input: logfile | ||
data_stream: | ||
vars: ~ |
9 changes: 9 additions & 0 deletions
9
packages/zeek/data_stream/ntp/_dev/test/system/test-splunk-config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
input: httpjson | ||
service: splunk-mock | ||
vars: | ||
url: http://{{Hostname}}:{{Port}} | ||
username: test | ||
password: test | ||
data_stream: | ||
vars: | ||
preserve_original_event: true |
63 changes: 63 additions & 0 deletions
63
packages/zeek/data_stream/ntp/agent/stream/httpjson.yml.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
config_version: 2 | ||
interval: {{interval}} | ||
{{#unless token}} | ||
{{#if username}} | ||
{{#if password}} | ||
auth.basic.user: {{username}} | ||
auth.basic.password: {{password}} | ||
{{/if}} | ||
{{/if}} | ||
{{/unless}} | ||
cursor: | ||
index_earliest: | ||
value: '[[.last_event.result.max_indextime]]' | ||
request.url: {{url}}/services/search/jobs/export | ||
{{#if ssl}} | ||
request.ssl: {{ssl}} | ||
{{/if}} | ||
request.method: POST | ||
request.transforms: | ||
- set: | ||
target: url.params.search | ||
value: {{search}} | streamstats max(_indextime) AS max_indextime | ||
- set: | ||
target: url.params.output_mode | ||
value: "json" | ||
- set: | ||
target: url.params.index_earliest | ||
value: '[[ .cursor.index_earliest ]]' | ||
default: '[[(now (parseDuration "-{{interval}}")).Unix]]' | ||
- set: | ||
target: url.params.index_latest | ||
value: '[[(now).Unix]]' | ||
- set: | ||
target: header.Content-Type | ||
value: application/x-www-form-urlencoded | ||
{{#unless username}} | ||
{{#unless password}} | ||
{{#if token}} | ||
- set: | ||
target: header.Authorization | ||
value: {{token}} | ||
{{/if}} | ||
{{/unless}} | ||
{{/unless}} | ||
response.decode_as: application/x-ndjson | ||
response.split: | ||
target: body.result._raw | ||
type: string | ||
delimiter: "\n" | ||
tags: | ||
{{#if preserve_original_event}} | ||
- preserve_original_event | ||
{{/if}} | ||
{{#each tags as |tag i|}} | ||
- {{tag}} | ||
{{/each}} | ||
{{#contains tags "forwarded"}} | ||
publisher_pipeline.disable_host: true | ||
{{/contains}} | ||
{{#if processors}} | ||
processors: | ||
{{processors}} | ||
{{/if}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
paths: | ||
{{#each base_paths}} | ||
{{#each ../filenames}} | ||
- {{../this}}/{{this}} | ||
{{/each}} | ||
{{/each}} | ||
exclude_files: [".gz$"] | ||
tags: | ||
{{#if preserve_original_event}} | ||
- preserve_original_event | ||
{{/if}} | ||
{{#each tags as |tag i|}} | ||
- {{tag}} | ||
{{/each}} | ||
{{#contains tags "forwarded"}} | ||
publisher_pipeline.disable_host: true | ||
{{/contains}} | ||
{{#if processors}} | ||
processors: | ||
{{processors}} | ||
{{/if}} |
Oops, something went wrong.