Catalog

Linux Auditd

Linux Auditd

Pack nameLinux Auditd
Version1.0.0
VendorLinux Foundation
CapabilitiesParser · Streaming Rules · Correlation Rules · Dashboard
CategoriesEndpoint Security · Linux · Authentication · Process Monitoring

Overview

Pack cung cấp giám sát bảo mật toàn diện Linux Audit subsystem (auditd) trên SecOps platform, bao gồm:

  • Parser — chuẩn hóa 5 loại auditd record (SYSCALL, USER_AUTH, USER_LOGIN, EXECVE, CRED_ACQ) sang ECS
  • 7 streaming rules — phát hiện privilege escalation, SSH failure, root SSH login, execution từ /tmp, reconnaissance command, credential failure
  • 3 correlation rules — phát hiện SSH brute-force, credential compromise đã xác nhận, SSH attack spreading
  • 1 dashboard — 12 chart giám sát SOC authentication và process execution

Yêu cầu trước khi cài đặt

Yêu cầuChi tiết
Linux với auditdsystemctl status auditd phải đang running
Log shipperFilebeat auditd module, Fluentd, hoặc Logstash đẩy JSON-wrapped về SecOps
Tag log sourcevendor = linuxservice = auditd
Quyền platformRole Content Pack Manager

Định dạng log bắt buộc

{
  "message": "type=TYPE msg=audit(timestamp:serial): key=value ...",
  "timestamp": "2026-03-17T08:15:23.456Z",
  "host": "web-server-01"
}

Parser đọc timestamp cho event time, hosthost.hostname, message → toàn bộ audit record.

Ví dụ log hợp lệ

SYSCALL — privilege escalation:

{"@timestamp":"2026-03-17T08:15:23.456Z","message":"type=SYSCALL msg=audit(1742197023.456:8421): arch=c000003e syscall=59 success=yes exit=0 a0=7f3b2c001a00 a1=7f3b2c001b00 a2=7f3b2c001c00 a3=0 items=2 ppid=12300 pid=12345 auid=1001 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=42 comm=\"bash\" exe=\"/usr/bin/bash\" key=\"privilege_escalation\"","timestamp":"2026-03-17T08:15:23.456Z","host":"web-server-01"}

USER_AUTH — SSH authentication failed:

{"@timestamp":"2026-03-17T08:20:11.123Z","message":"type=USER_AUTH msg=audit(1742197211.123:8500): pid=15200 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:authentication grantors=? acct=\"admin\" exe=\"/usr/sbin/sshd\" hostname=203.0.113.45 addr=203.0.113.45 terminal=ssh res=failed'","timestamp":"2026-03-17T08:20:11.123Z","host":"web-server-01"}

USER_LOGIN — successful SSH login:

{"@timestamp":"2026-03-17T08:25:00.000Z","message":"type=USER_LOGIN msg=audit(1742197500.000:8600): pid=15300 uid=0 auid=1002 ses=43 msg='op=login id=1002 exe=\"/usr/sbin/sshd\" hostname=10.0.1.50 addr=10.0.1.50 terminal=ssh res=success'","timestamp":"2026-03-17T08:25:00.000Z","host":"web-server-01"}

EXECVE — process execution:

{"@timestamp":"2026-03-17T08:30:00.000Z","message":"type=EXECVE msg=audit(1742197800.000:8700): argc=2 a0=\"/tmp/malware\" a1=\"-c\"","timestamp":"2026-03-17T08:30:00.000Z","host":"web-server-01"}

Parser phân biệt loại record qua prefix type= trong message: SYSCALL, USER_AUTH, USER_LOGIN, EXECVE, CRED_ACQ.


Cài đặt

  1. Vào Marketplace → tìm "Linux Audit Security"Install
  2. Kiểm tra Parserslinux-audit-parser đang active
  3. Kiểm tra Detection Rules → filter tag Linux → 10 rules đang enabled
  4. Mở DashboardsLinux Audit Security Overview

Parser — Các trường ECS chính

ECS FieldNguồnMô tả
event.actionDerived từ type=syscall, user_auth, user_login, execve, credential_acquired
event.outcomeres= fieldsuccess / failure
user.audit.idauid=Login user gốc — không đổi khi sudo/su
user.effective.ideuid= / id=UID đang có quyền thực thi
user.nameacct=Tên tài khoản
process.executableexe= / a0=File thực thi
process.pid / process.ppidpid= / ppid=PID và parent PID
source.ipaddr= / hostname=IP nguồn (SSH connections)

user.audit.id = login gốc (bất biến kể cả khi sudo/su). user.effective.id = quyền thực tế đang dùng.


Detection Rules

Streaming Rules (7 rules — real-time)

#RuleSeverityMô tả
1Linux Privilege Escalation via sudo/suHighSYSCALL với euid=0 từ user thường — dấu hiệu privilege escalation thành công
2Linux SSH Authentication FailedMediumXác thực SSH thất bại — brute-force hoặc unauthorized access attempt
3Linux Successful SSH LoginLowĐăng nhập SSH thành công — giám sát remote access
4Linux Root Direct SSH LoginCriticalĐăng nhập SSH trực tiếp bằng root — vi phạm best practice, nguy cơ cao
5Linux Execution from /tmpHighThực thi file từ /tmp — indicator of compromise điển hình của malware/exploit
6Linux Suspicious Reconnaissance CommandMediumThực thi các lệnh thu thập thông tin hệ thống (id, whoami, uname, netstat...)
7Linux Credential Acquisition FailureMediumCRED_ACQ thất bại — lỗi xác thực PAM, có thể là unauthorized sudo attempt

Correlation Rules (3 rules — pattern)

#RuleSeverityMô tảNgưỡngLookback
8Linux SSH Brute Force AttackHighNhiều lần SSH thất bại từ cùng IP — brute-force tấn công> 10 lần15 phút
9Linux Brute Force Succeeded — Credential CompromiseCriticalNhiều failure + ít nhất 1 success từ cùng IP — tài khoản đã bị compromise≥ 5 fail + ≥ 1 success30 phút
10Linux SSH Attack Spreading Across HostsHighCùng IP tấn công nhiều host khác nhau — lateral movement hoặc worm/scanner≥ 5 fail + ≥ 3 hosts15 phút

Dashboard — Linux Audit Security Overview

#ChartLoạiMô tả
1Authentication Events TrendLINETrend auth events theo thời gian
2Total Auth EventsMETRICTổng số authentication events
3Failed Auth EventsMETRICTổng xác thực thất bại
4Privilege Escalation EventsMETRICTổng sự kiện privilege escalation
5Process Execution EventsMETRICTổng EXECVE events
6Auth Outcome DistributionPIESuccess vs Failure
7Event Action BreakdownPIEPhân bố loại action
8Top Failed Login Source IPsBARIP SSH attack nhiều nhất
9Top Targeted UsersBARUser bị tấn công nhiều nhất
10Top Executed Process BinariesBARFile thực thi xuất hiện nhiều nhất
11Recent Auth FailuresTABLE20 xác thực thất bại gần nhất
12Recent Privilege EscalationTABLE20 sự kiện privilege escalation gần nhất

SOC Triage nhanh:

  1. Metric 4 → privilege escalation cao → có thể đang bị exploited
  2. Chart 8 → một IP chiếm đa số → targeted SSH attack
  3. Rule 9 alert (brute then success) → tài khoản đã bị compromise — xử lý ngay
  4. Table 12 → xác nhận user bị leo thang quyền và host bị ảnh hưởng

Troubleshooting

Triệu chứngNguyên nhânCách xử lý
Không có eventSai tag log sourceKiểm tra vendor = linuxservice = auditd
Chỉ có SYSCALL eventsauditd rules thiếuKiểm tra /etc/audit/rules.d/ — cần rules cho auth và execve
source.ip trốngUSER_LOGIN thiếu addr=Kiểm tra SSH syslog và auditd kết hợp — addr= chỉ có trong USER_LOGIN
user.name trốngThiếu acct= trong recordMột số auditd version không log acct= cho non-interactive sessions
Parser không khớpParser bị tắtKiểm tra linux-audit-parser.yaml đang active trong Parsers

Checklist parser:

  • Tag vendor = linux + service = auditd
  • JSON có đủ message (type=TYPE...), timestamp, host
  • auditd đang chạy và có rules phù hợp
  • linux-audit-parser.yaml đang active

Hỗ trợ

  • Lỗi platform: Mở ticket tại SecOps support portal
  • Góp ý pack: Dùng tính năng feedback trên trang Marketplace
  • Tuning rule: Slack #detection-engineering

Last updated: 2026-06-04 · Vendor: Linux Foundation · Author: secops-team