I have created a conditional grok filter for audit log and seperated the SYSCALL event from audit. Created a parser for SYSCALL.

This commit is contained in:
Mosiur Rahman
2026-08-19 03:49:50 +00:00
parent 146264b34d
commit 0f060b9315
2 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1 @@
helm upgrade --install -n observability data-prepper -f values.yaml .

View File

@@ -224,6 +224,37 @@ pipelineConfig:
- drop_events: - drop_events:
drop_when: '/log_source != "audit.audit.log"' drop_when: '/log_source != "audit.audit.log"'
- grok:
break_on_match: true
match:
log:
- '^type=%{WORD:log_type} msg=audit\(%{INT:timestamp_seconds}\.%{INT:timestamp_fraction}:%{INT:event_id}\): %{GREEDYDATA:msg}'
target_key: audit
- grok:
break_on_match: true
grok_when: '/audit/log_type == "SYSCALL"'
match:
/audit/msg:
- ^arch=%{WORD:arch} syscall=%{INT:syscall_id} success=%{WORD:success}
exit=%{INT:exit_code} a0=%{NOTSPACE:a0} a1=%{NOTSPACE:a1} a2=%{NOTSPACE:a2}
a3=%{NOTSPACE:a3} items=%{INT:items} ppid=%{INT:ppid} pid=%{INT:pid} auid=%{INT:auid}
uid=%{INT:uid} gid=%{INT:gid} euid=%{INT:euid} suid=%{INT:suid} fsuid=%{INT:fsuid}
egid=%{INT:egid} sgid=%{INT:sgid} fsgid=%{INT:fsgid} tty=%{GREEDYDATA:terminal}
ses=%{INT:ses} comm=\"%{NOTSPACE:comm}\" exe=\"%{GREEDYDATA:exe}\" subj=%{GREEDYDATA:subject}
key=\"%{WORD:key}\".*ARCH=%{GREEDYDATA:architecture} SYSCALL=%{WORD:syscall} AUID=\"%{GREEDYDATA:AUID}\"
UID=\"%{GREEDYDATA:UID}\" GID=\"%{GREEDYDATA:GID}\" EUID=\"%{GREEDYDATA:EUID}\" SUID=\"%{GREEDYDATA:SUID}\"
FSUID=\"%{GREEDYDATA:FSUID}\"
EGID=\"%{GREEDYDATA:EGID}\" SGID=\"%{GREEDYDATA:SGID}\" FSGID=\"%{GREEDYDATA:FSGID}\"
target_key: syscall
- date:
match:
- key: /audit/timestamp_seconds
patterns:
- epoch_second
destination: "@timestamp"
sink: sink:
- opensearch: - opensearch:
hosts: hosts:
@@ -235,6 +266,7 @@ pipelineConfig:
cert: /usr/share/dataprepper/cert/root-ca.pem cert: /usr/share/dataprepper/cert/root-ca.pem
index: cpanel-audit-log-%{yyyy.MM.dd} index: cpanel-audit-log-%{yyyy.MM.dd}
cpanel-kernel-pipeline: cpanel-kernel-pipeline:
source: source:
pipeline: pipeline: