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

[cisco_asa] Add TCP input with TLS support #3312

Merged
merged 6 commits into from
May 12, 2022
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
10 changes: 10 additions & 0 deletions packages/cisco_asa/_dev/deploy/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ services:
- ./sample_logs:/sample_logs:ro
- ${SERVICE_LOGS_DIR}:/var/log
command: /bin/sh -c "cp /sample_logs/* /var/log/"
cisco-asa-tls:
image: docker.elastic.co/observability/stream:v0.6.2
volumes:
- ./sample_logs:/sample_logs:ro
command: log --start-signal=SIGHUP --delay=5s --addr elastic-agent:9515 -p=tls --insecure /sample_logs/cisco-asa.log
cisco-asa-tcp:
image: docker.elastic.co/observability/stream:v0.6.2
volumes:
- ./sample_logs:/sample_logs:ro
command: log --start-signal=SIGHUP --delay=5s --addr elastic-agent:9514 -p=tcp /sample_logs/cisco-asa.log
cisco-asa-udp:
image: docker.elastic.co/observability/stream:v0.6.2
volumes:
Expand Down
5 changes: 5 additions & 0 deletions packages/cisco_asa/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# newer versions go on top
- version: "2.4.0"
changes:
- description: Add TCP input with TLS support
type: enhancement
link: https://github.com/elastic/integrations/pull/3312
- version: "2.3.0"
changes:
- description: Update to ECS 8.2
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
service: cisco-asa-tcp
service_notify_signal: SIGHUP
input: tcp
data_stream:
vars:
tcp_host: 0.0.0.0
tcp_port: 9514
preserve_original_event: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
service: cisco-asa-tls
service_notify_signal: SIGHUP
input: tcp
data_stream:
vars:
tcp_host: 0.0.0.0
tcp_port: 9515
preserve_original_event: true
ssl: |
key: |
-----BEGIN PRIVATE KEY-----
MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDhCLvLsQAHufsN
U+u1x/CequAUphfXZqLhDo2Eo/holfBS0+ey4bnzPL6lS9NFL5JkLQA2gYESqsXU
/Ru8E76Az1egzMwT3TVAPLVU8NbrxBqeNiQa2m9wC37HQy4qC9OxL28LUoKtFjxS
cD1sa0oikXCJN1a3BSoAf9iiZ/dxz4WVfrNhrzq2JFXjravY84n5ujkZOg45Pg70
4vHOeg0rBbIoSNfjDUVZWjwC95K1BMN3msOTL9juv/EDa6BujqCxl+G1nY7JPFDL
SHWis65p+1AAa5xieYDb47vyJ0SSR7lEURTXZOkkM6k5JWfgkATEmGzRxPkOloIT
Xg9ag1OlAgMBAAECggEAEHfPJmzhj68wjB0kFr13AmWG2Hv/Kqg8KzQhbx+AwkaW
u7j+L70NGpvLZ9VQtLNyhxoz9cksZO1SZO/Q48aeHlcOFppmJN3/U6AdtQWa9M35
FLLpmX16wjxVHsfvzOvopgLOoYl8PqZt66qDFDgVyMnT7na6RdJ+7GJuvBPXq+Bc
vgThvAZitHSAOhnBFYmTMlBi6AzOMMsaFlgE3Xf9v3M0pAKItPRKMhXlC3MyvA/v
jgbra4Ib+0ryohggHheHB3bn3Jgv7iFKoW9OQSePVxacJ+kfr9H+No5g495URzqR
mx/96WCiv3rAh3ct8Sk/C4/3zMC8fUueDJIVjhgw0QKBgQD8NufLINNkIpBrLoCS
972oFEjZB2u6EusQ7X9raROqpaw26ZSu+zSHeIKCGQ93M3aRb3FpdGeOxgZ095MV
8a+nlh4stOvHj2Mm5YhTBDUavTC7o9aVR3Od5eTXUpHnaJpNI/uyIcKupeK1UJnV
UlBLeIwo/vJ1gsVrKMMAJkuKbwKBgQDkaWRRd0w2gUIbCTGf203BqXft0VdIiOW7
+gnkeaNHA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CLvLsQAHufsNU+u1x/CequAUphfXZqLhDo2Eo/ho
lfBS0+ey4bnzPL6lS9NFL5JkLQA2gYESqsXU/Ru8E76Az1egzMwT3TVAPLVU8Nbr
xBqeNiQa2m9wC37HQy4qC9OxL28LUoKtFjxScD1sa0oikXCJN1a3BSoAf9iiZ/dx
z4WVfrNhrzq2JFXjravY84n5ujkZOg45Pg704vHOeg0rBbIoSNfjDUVZWjwC95K1
BMN3msOTL9juv/EDa6BujqCxl+G1nY7JPFDLSHWis65p+1AAa5xieYDb47vyJ0SS
R7lEURTXZOkkM6k5JWfgkATEmGzRxPkOloITXg9ag1OlAgMBAAGjUzBRMB0GA1Ud
DgQWBBRYUSKDHBBE9Q6fTeTqogicCxcXwDAfBgNVHSMEGDAWgBRYUSKDHBBE9Q6f
TeTqogicCxcXwDAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQBc
T8B+GpvPy9NQ700LsywRPY0L9IJCKiu6j3TP1tqqSPjAC/cg9ac+bFXuWOu7V+KJ
s09Q/pItq9SLX6UvnfRzTxu5lCBwwGX9cL131mTIu5SmFo7Eks+sorbiIarWDMoC
e+9An3GFpagW+YhOt4BdIM5lTqoeodzganDBsOUZI9aDAj2Yo5h2O7r6Wd12cb6T
mz8vMfB2eG8BxU20ZMfkdERWjiyXHOSBQqeqfkV8d9370gMu5RcJNcIgnbmTRdho
X3HJFiimZVaNjXATqmC/y2A1KXvJdamPLy3mGXkW2cFLoPCdK2OZFUHqiuc1bigA
qEf55SihFqErRMeURPPF
-----END CERTIFICATE-----
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ processors:
- add_locale: ~
{{#if processors}}
{{processors}}
{{/if}}
{{/if}}
22 changes: 22 additions & 0 deletions packages/cisco_asa/data_stream/log/agent/stream/tcp.yml.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
host: "{{tcp_host}}:{{tcp_port}}"
tags:
{{#if preserve_original_event}}
- preserve_original_event
{{/if}}
{{#each tags as |tag i|}}
- {{tag}}
{{/each}}
{{#contains "forwarded" tags}}
publisher_pipeline.disable_host: true
{{/contains}}
{{#if ssl}}
ssl: {{ssl}}
{{/if}}
processors:
- add_locale: ~
{{#if processors}}
{{processors}}
{{/if}}
{{#if tcp_options}}
{{tcp_options}}
{{/if}}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
udp:
host: "{{udp_host}}:{{udp_port}}"
tags:
{{#if preserve_original_event}}
Expand All @@ -14,4 +13,4 @@ processors:
- add_locale: ~
{{#if processors}}
{{processors}}
{{/if}}
{{/if}}
87 changes: 87 additions & 0 deletions packages/cisco_asa/data_stream/log/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,93 @@ streams:
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: Cisco ASA logs
description: Collect Cisco ASA logs
template_path: tcp.yml.hbs
vars:
- name: tags
type: text
title: Tags
multi: true
required: true
show_user: false
default:
- cisco-asa
- forwarded
- name: tcp_host
type: text
title: Listen Address
description: The bind address to listen for TCP connections. Set to `0.0.0.0` to bind to all available interfaces.
multi: false
required: true
show_user: true
default: localhost
- name: tcp_port
type: integer
title: Listen Port
description: The TCP port number to listen on.
multi: false
required: true
show_user: true
default: 9001
- 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.

- name: ssl
type: yaml
title: SSL Configuration
description: i.e. certificate_authorities, supported_protocols, verification_mode etc.
multi: false
required: false
show_user: false
default: |
#certificate_authorities:
# - |
# -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mIl6U9Pvk
# sxSmbIUfc2SGJGCJD4I=
# -----END CERTIFICATE-----
- name: tcp_options
type: yaml
title: Custom TCP Options
multi: false
required: false
show_user: false
default: |
#max_connections: 1
#framing: delimitier
#line_delimiter: "\n"
description: Specify custom configuration options for the TCP input.
- input: logfile
enabled: false
title: Cisco ASA logs
Expand Down
5 changes: 4 additions & 1 deletion packages/cisco_asa/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
format_version: 1.0.0
name: cisco_asa
title: Cisco ASA
version: 2.3.0
version: 2.4.0
license: basic
description: Collect logs from Cisco ASA with Elastic Agent.
type: integration
Expand All @@ -26,6 +26,9 @@ policy_templates:
title: Cisco ASA logs
description: Collect logs from Cisco ASA instances
inputs:
- type: tcp
title: Collect logs from Cisco ASA via TCP
description: Collecting logs from Cisco ASA via TCP
- type: udp
title: Collect logs from Cisco ASA via UDP
description: Collecting logs from Cisco ASA via UDP
Expand Down