forked from logstash-plugins/logstash-codec-cef
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: proactively detect malformed CEF
When encountering malformed-CEF or non-CEF payloads, this plugin now emits helpful descriptive log messages, and prevents data-loss and corruption by emitting an event tagged with `_cefparsefailure` containing the bytes it received. This set of changes catches 3 distinct cases of malformed payloads. - missing one or more of the 7 required CEF header fields; a payload that does not have all 7 unescaped-pipe-terminated header fields cannot be reliably interpreted as CEF (prevents corruption). - containing something OTHER than a sequence of key=value pairs in the extensions space (prevent data-loss; previously when extensions were invalid they were silently omitted) - containing unescaped newlines (prevents corruption; previously data after the first newline was injected into the currently-parsed extension field) In catching these classes of malformed inputs, this changeset also resolves logstash-plugins#99 in which our failure to detect a malformed input proactively caused an unhelpful `NoMethodError` message to be logged before a `_cefparsefailure`-tagged event was emitted.
- Loading branch information
Showing
3 changed files
with
132 additions
and
17 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
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