Catalog
Linux Auditd
Linux Auditd
| Pack name | Linux Auditd |
| Version | 1.0.0 |
| Vendor | Linux Foundation |
| Capabilities | Parser · Streaming Rules · Correlation Rules · Dashboard |
| Categories | Endpoint 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ầu | Chi tiết |
|---|---|
| Linux với auditd | systemctl status auditd phải đang running |
| Log shipper | Filebeat auditd module, Fluentd, hoặc Logstash đẩy JSON-wrapped về SecOps |
| Tag log source | vendor = linux và service = auditd |
| Quyền platform | Role 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
timestampcho event time,host→host.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
- Vào Marketplace → tìm "Linux Audit Security" → Install
- Kiểm tra Parsers →
linux-audit-parserđang active - Kiểm tra Detection Rules → filter tag Linux → 10 rules đang enabled
- Mở Dashboards → Linux Audit Security Overview
Parser — Các trường ECS chính
| ECS Field | Nguồn | Mô tả |
|---|---|---|
event.action | Derived từ type= | syscall, user_auth, user_login, execve, credential_acquired |
event.outcome | res= field | success / failure |
user.audit.id | auid= | Login user gốc — không đổi khi sudo/su |
user.effective.id | euid= / id= | UID đang có quyền thực thi |
user.name | acct= | Tên tài khoản |
process.executable | exe= / a0= | File thực thi |
process.pid / process.ppid | pid= / ppid= | PID và parent PID |
source.ip | addr= / 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)
| # | Rule | Severity | Mô tả |
|---|---|---|---|
| 1 | Linux Privilege Escalation via sudo/su | High | SYSCALL với euid=0 từ user thường — dấu hiệu privilege escalation thành công |
| 2 | Linux SSH Authentication Failed | Medium | Xác thực SSH thất bại — brute-force hoặc unauthorized access attempt |
| 3 | Linux Successful SSH Login | Low | Đăng nhập SSH thành công — giám sát remote access |
| 4 | Linux Root Direct SSH Login | Critical | Đăng nhập SSH trực tiếp bằng root — vi phạm best practice, nguy cơ cao |
| 5 | Linux Execution from /tmp | High | Thực thi file từ /tmp — indicator of compromise điển hình của malware/exploit |
| 6 | Linux Suspicious Reconnaissance Command | Medium | Thực thi các lệnh thu thập thông tin hệ thống (id, whoami, uname, netstat...) |
| 7 | Linux Credential Acquisition Failure | Medium | CRED_ACQ thất bại — lỗi xác thực PAM, có thể là unauthorized sudo attempt |
Correlation Rules (3 rules — pattern)
| # | Rule | Severity | Mô tả | Ngưỡng | Lookback |
|---|---|---|---|---|---|
| 8 | Linux SSH Brute Force Attack | High | Nhiều lần SSH thất bại từ cùng IP — brute-force tấn công | > 10 lần | 15 phút |
| 9 | Linux Brute Force Succeeded — Credential Compromise | Critical | Nhiều failure + ít nhất 1 success từ cùng IP — tài khoản đã bị compromise | ≥ 5 fail + ≥ 1 success | 30 phút |
| 10 | Linux SSH Attack Spreading Across Hosts | High | Cùng IP tấn công nhiều host khác nhau — lateral movement hoặc worm/scanner | ≥ 5 fail + ≥ 3 hosts | 15 phút |
Dashboard — Linux Audit Security Overview
| # | Chart | Loại | Mô tả |
|---|---|---|---|
| 1 | Authentication Events Trend | LINE | Trend auth events theo thời gian |
| 2 | Total Auth Events | METRIC | Tổng số authentication events |
| 3 | Failed Auth Events | METRIC | Tổng xác thực thất bại |
| 4 | Privilege Escalation Events | METRIC | Tổng sự kiện privilege escalation |
| 5 | Process Execution Events | METRIC | Tổng EXECVE events |
| 6 | Auth Outcome Distribution | PIE | Success vs Failure |
| 7 | Event Action Breakdown | PIE | Phân bố loại action |
| 8 | Top Failed Login Source IPs | BAR | IP SSH attack nhiều nhất |
| 9 | Top Targeted Users | BAR | User bị tấn công nhiều nhất |
| 10 | Top Executed Process Binaries | BAR | File thực thi xuất hiện nhiều nhất |
| 11 | Recent Auth Failures | TABLE | 20 xác thực thất bại gần nhất |
| 12 | Recent Privilege Escalation | TABLE | 20 sự kiện privilege escalation gần nhất |
SOC Triage nhanh:
- Metric 4 → privilege escalation cao → có thể đang bị exploited
- Chart 8 → một IP chiếm đa số → targeted SSH attack
- Rule 9 alert (brute then success) → tài khoản đã bị compromise — xử lý ngay
- Table 12 → xác nhận user bị leo thang quyền và host bị ảnh hưởng
Troubleshooting
| Triệu chứng | Nguyên nhân | Cách xử lý |
|---|---|---|
| Không có event | Sai tag log source | Kiểm tra vendor = linux và service = auditd |
| Chỉ có SYSCALL events | auditd rules thiếu | Kiểm tra /etc/audit/rules.d/ — cần rules cho auth và execve |
source.ip trống | USER_LOGIN thiếu addr= | Kiểm tra SSH syslog và auditd kết hợp — addr= chỉ có trong USER_LOGIN |
user.name trống | Thiếu acct= trong record | Một số auditd version không log acct= cho non-interactive sessions |
| Parser không khớp | Parser bị tắt | Kiể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