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

[Filebeat] Cisco FTD issues parsing Security Event messages #16889

Merged
merged 2 commits into from
Mar 12, 2020

Conversation

andrewstucki
Copy link

@andrewstucki andrewstucki commented Mar 6, 2020

You'll want to take a look at this pr with ?w=1 since there was a lot of formatting changes for the pipeline.

What does this PR do?

Fixes a few bugs with the shared cisco parsing pipeline that was causing some fields to be dropped/misinterpreted

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

Related issues

@elasticmachine
Copy link
Collaborator

Pinging @elastic/siem (Team:SIEM)

- kv:
if: '["430001", "430002", "430003", "430004", "430005", ""].contains(ctx._temp_.cisco.message_id)'
field: "message"
field_split: ",(?=\\s[A-za-z1-9\\s]+:)"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was causing some fields to get dropped when field values contained a , character in them. The regex portion is a lookahead to make sure we have a space followed by a valid field name (all letters, numbers, and spaces) with a colon at the end.

patterns:
- "(?:%{SYSLOG_HEADER})?\\s*%{GREEDYDATA:log.original}"
pattern_definitions:
SYSLOG_HEADER: "(?:%{SYSLOGFACILITY}\\s*)?(?:%{FTD_DATE:_temp_.raw_date}:?\\s+)?(?:%{PROCESS_HOST}|%{HOST_PROCESS})(?:{DATA})?%{SYSLOG_END}?"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lack of an optional SYSLOG_END was causing timestamps to get truncated in the test log. Furthermore, some logs have process prior to hostname, so added an alternative swapping of the hostname and process.

- grok:
field: log.original
patterns:
- "%{FTD_PREFIX}-(?:%{FTD_SUFFIX:_temp_.cisco.suffix}-)?%{NONNEGINT:event.severity:int}-%{POSINT:_temp_.cisco.message_id}?:?\\s*%{GREEDYDATA:message}"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of POSINT was causing cases of -0- severity to get misinterpreted.

Copy link
Contributor

@adriansr adriansr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for fixing!

@andrewstucki andrewstucki merged commit 912eac4 into elastic:master Mar 12, 2020
@andrewstucki andrewstucki deleted the cisco-module-fixes branch March 12, 2020 13:46
andrewstucki pushed a commit to andrewstucki/beats that referenced this pull request Mar 12, 2020
…16889)

* Fix grok and kv split bugs

* Fix optional whitespace for field name separator

(cherry picked from commit 912eac4)
andrewstucki pushed a commit to andrewstucki/beats that referenced this pull request Mar 12, 2020
…16889)

* Fix grok and kv split bugs

* Fix optional whitespace for field name separator

(cherry picked from commit 912eac4)
andrewstucki pushed a commit that referenced this pull request Mar 19, 2020
…ty Event messages (#16981)

* [Filebeat] Cisco FTD issues parsing Security Event messages (#16889)

* Fix grok and kv split bugs

* Fix optional whitespace for field name separator

(cherry picked from commit 912eac4)

* [Filebeat] Add changelog entry for Cisco fixes (#17124)

* Add changelog entry for Cisco fixes

* move new entry to the end of the changelog section

* Remove stray changelog entries from cherry-pick
andrewstucki pushed a commit that referenced this pull request Apr 4, 2020
…ty Event messages (#16982)

* [Filebeat] Cisco FTD issues parsing Security Event messages (#16889)

* Fix grok and kv split bugs

* Fix optional whitespace for field name separator

(cherry picked from commit 912eac4)

* [Filebeat] Add changelog entry for Cisco fixes (#17124)

* Add changelog entry for Cisco fixes

* move new entry to the end of the changelog section

* Remove stray changelog entries from cherry-pick
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cisco FTD issues parsing Security Event messages
3 participants