Audit là một framework được tích hợp sẵn vào trong nhân linux, cung cấp thông tin chi tiết để thanh tra các hoạt động hệ thống một mức rất chi tiết.
Nó có thể:
1. Giúp người dùng giám sát các tiến trình có nguy hiểm đến hệ thống hay hành vi xảy ra trên hệ thống một các chi tiết
2. Cung cấp chức năng lọc, xây dựng báo cáo để có thể trích xuất thông tin được audit log lưu lại. Chúng ta có thể filter theo các mục sau:
• User
• Group
• AuditID
• RemoteHostname
• RemoteHostAddress
• SystemCall
• SystemCallArguments • File
• FileOperations
• SuccessorFailure
• Group
• AuditID
• RemoteHostname
• RemoteHostAddress
• SystemCall
• SystemCallArguments • File
• FileOperations
• SuccessorFailure
Auditing goals
By using a powerful audit framework, the system can track many event types to monitor and audit the system. Examples include:
- Audit file access and modification
- See who changed a particular file
- Detect unauthorized changes
- Monitoring of system calls and functions
- Detect anomalies like crashing processes
- Set tripwires for intrusion detection purposes
- Record commands used by individual users
Components
The framework itself has several components:
Kernel:
- audit: hooks into the kernel to capture events and deliver them to auditd
Binaries:
- auditd: daemon to capture events and store them (log file)
- auditctl: client tool to configure auditd
- audispd: daemon to multiplex events
- aureport: reporting tool which reads from log file (auditd.log)
- ausearch: event viewer (auditd.log)
- autrace: using audit component in kernel to trace binaries
- aulast: similar to last, but instaed using audit framework
- aulastlog: similar to lastlog, also using audit framework instead
- ausyscall: map syscall ID and name
- auvirt: displaying audit information regarding virtual machines
Files:
- audit.rules: used by auditctl to read what rules need to be used
- auditd.conf: configuration file of auditd
Thành phần của Audit
Các thành phần của Audit |
Audit.rules là file chứa các luật sẽ được tải khi khởi động audit daemon. Chương trình auditctl được sử dụng cho kịch bản khởi tạo hành vi này. cấu trúc luật gồm 3 phần: control, file và syscall.
Control
Control commands generally involve configuring the audit system rather than telling it what to watch for. These commands typically include deleting all rules, setting the size of the kernel's backlog queue, setting the failure mode, setting the event rate limit, or to tell auditctl to ignore syntax errors in the rules and continue loading. Generally, these rules are at the top of the rules file.File System
File System rules are sometimes called watches. These rules are used to audit access to particular files or directories that you may be interested in. If the path given in a watch rule is a directory, then the rule used is recursive to the bottom of the directory tree excluding any directories that may be mount points. The syntax of these watch rules generally follow this format:-w path-to-file -p permissions -k keyname
- r
- - read of the file
- w
- - write to the file
- x
- - execute the file
- a
- - change in the file's attribute
System Call
The system call rules are loaded into a matching engine that intercepts each syscall that all programs on the system makes. Therefore it is very important to only use syscall rules when you have to since these affect performance. The more rules, the bigger the performance hit. You can help the performance, though, by combining syscalls into one rule whenever possible.-a action,list -S syscall -F field=value -k keyname
- always
- - always create an event
- never
- - never create an event
Một số link tham khảo hay:
1. Mô tả rule của Audit https://jlk.fjfi.cvut.cz/arch/manpages/man/audit.rules.7
2. Cấu hình cơ bản Audit https://linux-audit.com/configuring-and-auditing-linux-systems-with-audit-daemon/
3. Sách về Audit https://www.suse.com/documentation/sled10/pdfdoc/audit_sp2/audit_sp2.pdf
No comments:
Post a Comment