Skip to content

Commit

Permalink
filebeat/module/auditd: teach kv about quoted spaces (#34069)
Browse files Browse the repository at this point in the history
Audit messages may contain spaces when the value is quoted, so let the
kv processor know how to deal with this case.

(cherry picked from commit f5054f7)
  • Loading branch information
efd6 authored and mergify[bot] committed Jan 18, 2023
1 parent 6c31bf8 commit 787bc86
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ https://github.com/elastic/beats/compare/v8.2.0\...main[Check the HEAD diff]

*Filebeat*
- [google_workspace] Fix pagination and cursor value update. {pull}34274[34274]
- Fix handling of quoted values in auditd module. {issue}22587[22587] {pull}34069[34069]


*Heartbeat*
Expand Down
4 changes: 2 additions & 2 deletions filebeat/module/auditd/log/ingest/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ processors:
- "%{AUDIT_TYPE} %{AUDIT_KEY_VALUES:auditd.log.kv}"
- kv:
field: auditd.log.kv
field_split: "\\s+"
value_split: "="
field_split: '\s(?![\w\"]+?(\s+|$))'
value_split: '(?<!\\)='
target_field: auditd.log
- kv:
field: auditd.log.sub_kv
Expand Down
1 change: 1 addition & 0 deletions filebeat/module/auditd/log/test/audit-rhel7_2.log
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
type=ANOM_ABEND msg=audit(1605431420.026:123): auid=12345 uid=123 gid=123 ses=123456789 pid=1234 comm="extproc" reason="memory violation" sig=6
32 changes: 32 additions & 0 deletions filebeat/module/auditd/log/test/audit-rhel7_2.log-expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[
{
"@timestamp": "2020-11-15T09:10:20.026Z",
"auditd.log.reason": "memory violation",
"auditd.log.record_type": "ANOM_ABEND",
"auditd.log.sequence": 123,
"auditd.log.ses": "123456789",
"auditd.log.sig": "6",
"event.action": [
"crashed-program"
],
"event.category": [
"process"
],
"event.dataset": "auditd.log",
"event.kind": "event",
"event.module": "auditd",
"event.original": "type=ANOM_ABEND msg=audit(1605431420.026:123): auid=12345 uid=123 gid=123 ses=123456789 pid=1234 comm=\"extproc\" reason=\"memory violation\" sig=6",
"event.type": [
"end"
],
"fileset.name": "log",
"input.type": "log",
"log.offset": 0,
"process.name": "extproc",
"process.pid": 1234,
"service.type": "auditd",
"user.audit.id": "12345",
"user.group.id": "123",
"user.id": "123"
}
]

0 comments on commit 787bc86

Please sign in to comment.