Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cylance] updating cylance package to ECS 1.10.0 and add event.origina options #1040

Merged
merged 4 commits into from
Jun 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/cylance/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# newer versions go on top
- version: "0.2.0"
changes:
- description: update to ECS 1.10.0 and add event.original options
type: enhancement
link: https://github.com/elastic/integrations/pull/1040
- version: "0.1.4"
changes:
- description: update to ECS 1.9.0
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dynamic_fields:
event.ingested: ".*"
fields:
tags:
- preserve_original_event

Large diffs are not rendered by default.

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions packages/cylance/data_stream/protect/agent/stream/stream.yml.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ paths:
{{/each}}
exclude_files: [".gz$"]
tags:
{{#if preserve_original_event}}
- preserve_original_event
{{/if}}
{{#each tags as |tag i|}}
- {{tag}}
- {{tag}}
{{/each}}
fields_under_root: true
fields:
Expand All @@ -18,6 +21,9 @@ publisher_pipeline.disable_host: true
{{/contains}}

processors:
{{#if processors}}
{{processors}}
{{/if}}
- script:
lang: javascript
params:
Expand Down Expand Up @@ -3585,7 +3591,3 @@ processors:
target_subdomain_field: url.subdomain
target_etld_field: url.top_level_domain
- add_locale: ~
- add_fields:
target: ''
fields:
ecs.version: 1.9.0
12 changes: 7 additions & 5 deletions packages/cylance/data_stream/protect/agent/stream/tcp.yml.hbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
tcp:
host: "{{tcp_host}}:{{tcp_port}}"
tags:
{{#if preserve_original_event}}
- preserve_original_event
{{/if}}
{{#each tags as |tag i|}}
- {{tag}}
- {{tag}}
{{/each}}
fields_under_root: true
fields:
Expand All @@ -15,6 +18,9 @@ publisher_pipeline.disable_host: true
{{/contains}}

processors:
{{#if processors}}
{{processors}}
{{/if}}
- script:
lang: javascript
params:
Expand Down Expand Up @@ -3582,7 +3588,3 @@ processors:
target_subdomain_field: url.subdomain
target_etld_field: url.top_level_domain
- add_locale: ~
- add_fields:
target: ''
fields:
ecs.version: 1.9.0
12 changes: 7 additions & 5 deletions packages/cylance/data_stream/protect/agent/stream/udp.yml.hbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
udp:
host: "{{udp_host}}:{{udp_port}}"
tags:
{{#if preserve_original_event}}
- preserve_original_event
{{/if}}
{{#each tags as |tag i|}}
- {{tag}}
- {{tag}}
{{/each}}
fields_under_root: true
fields:
Expand All @@ -15,6 +18,9 @@ publisher_pipeline.disable_host: true
{{/contains}}

processors:
{{#if processors}}
{{processors}}
{{/if}}
- script:
lang: javascript
params:
Expand Down Expand Up @@ -3582,7 +3588,3 @@ processors:
target_subdomain_field: url.subdomain
target_etld_field: url.top_level_domain
- add_locale: ~
- add_fields:
target: ''
fields:
ecs.version: 1.9.0
Original file line number Diff line number Diff line change
Expand Up @@ -4,61 +4,69 @@ description: Pipeline for CylanceProtect
processors:
# ECS event.ingested
- set:
field: event.ingested
value: '{{_ingest.timestamp}}'
field: event.ingested
value: '{{_ingest.timestamp}}'
- set:
field: ecs.version
value: "1.10.0"
# User agent
- user_agent:
field: user_agent.original
ignore_missing: true
field: user_agent.original
ignore_missing: true
# IP Geolocation Lookup
- geoip:
field: source.ip
target_field: source.geo
ignore_missing: true
field: source.ip
target_field: source.geo
ignore_missing: true
- geoip:
field: destination.ip
target_field: destination.geo
ignore_missing: true
field: destination.ip
target_field: destination.geo
ignore_missing: true

# IP Autonomous System (AS) Lookup
- geoip:
database_file: GeoLite2-ASN.mmdb
field: source.ip
target_field: source.as
properties:
- asn
- organization_name
ignore_missing: true
database_file: GeoLite2-ASN.mmdb
field: source.ip
target_field: source.as
properties:
- asn
- organization_name
ignore_missing: true
- geoip:
database_file: GeoLite2-ASN.mmdb
field: destination.ip
target_field: destination.as
properties:
- asn
- organization_name
ignore_missing: true
database_file: GeoLite2-ASN.mmdb
field: destination.ip
target_field: destination.as
properties:
- asn
- organization_name
ignore_missing: true
- rename:
field: source.as.asn
target_field: source.as.number
ignore_missing: true
field: source.as.asn
target_field: source.as.number
ignore_missing: true
- rename:
field: source.as.organization_name
target_field: source.as.organization.name
ignore_missing: true
field: source.as.organization_name
target_field: source.as.organization.name
ignore_missing: true
- rename:
field: destination.as.asn
target_field: destination.as.number
ignore_missing: true
field: destination.as.asn
target_field: destination.as.number
ignore_missing: true
- rename:
field: destination.as.organization_name
target_field: destination.as.organization.name
ignore_missing: true
field: destination.as.organization_name
target_field: destination.as.organization.name
ignore_missing: true
- append:
field: related.hosts
value: '{{host.name}}'
allow_duplicates: false
if: ctx.host?.name != null && ctx.host?.name != ''
field: related.hosts
value: '{{host.name}}'
allow_duplicates: false
if: ctx.host?.name != null && ctx.host?.name != ''
- remove:
field: event.original
if: "ctx?.tags == null || !(ctx.tags.contains('preserve_original_event'))"
ignore_failure: true
ignore_missing: true
on_failure:
- append:
field: error.message
value: "{{ _ingest.on_failure_message }}"
field: error.message
value: "{{ _ingest.on_failure_message }}"
50 changes: 50 additions & 0 deletions packages/cylance/data_stream/protect/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,23 @@ streams:
required: false
show_user: false
default: false
- name: preserve_original_event
required: true
show_user: true
title: Preserve original event
description: Preserves a raw copy of the original event, added to the field `event.original`
type: bool
multi: false
default: false
- name: processors
type: yaml
title: Processors
multi: false
required: false
show_user: false
description: >
Processors are used to reduce the number of fields in the exported event or to enhance the event with metadata. This executes in the agent before the logs are parsed. See [Processors](https://www.elastic.co/guide/en/beats/filebeat/current/filtering-and-enhancing-data.html) for details.

- input: tcp
title: CylanceProtect logs
description: Collect CylanceProtect logs
Expand Down Expand Up @@ -106,6 +123,23 @@ streams:
required: false
show_user: false
default: false
- name: preserve_original_event
required: true
show_user: true
title: Preserve original event
description: Preserves a raw copy of the original event, added to the field `event.original`
type: bool
multi: false
default: false
- name: processors
type: yaml
title: Processors
multi: false
required: false
show_user: false
description: >
Processors are used to reduce the number of fields in the exported event or to enhance the event with metadata. This executes in the agent before the logs are parsed. See [Processors](https://www.elastic.co/guide/en/beats/filebeat/current/filtering-and-enhancing-data.html) for details.

- input: logfile
enabled: false
title: CylanceProtect logs
Expand Down Expand Up @@ -152,3 +186,19 @@ streams:
required: false
show_user: false
default: false
- name: preserve_original_event
required: true
show_user: true
title: Preserve original event
description: Preserves a raw copy of the original event, added to the field `event.original`
type: bool
multi: false
default: false
- name: processors
type: yaml
title: Processors
multi: false
required: false
show_user: false
description: >-
Processors are used to reduce the number of fields in the exported event or to enhance the event with metadata. This executes in the agent before the logs are parsed. See [Processors](https://www.elastic.co/guide/en/beats/filebeat/current/filtering-and-enhancing-data.html) for details.
2 changes: 1 addition & 1 deletion packages/cylance/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
format_version: 1.0.0
name: cylance
title: CylanceProtect
version: 0.1.4
version: 0.2.0
description: CylanceProtect Integration
categories: ["security"]
release: experimental
Expand Down