Audit Log

Lịch sử toàn bộ hành động trong hệ thống — ai làm gì, khi nào, từ đâu — phục vụ compliance và điều tra sự cố

Audit Log

Audit Log ghi lại mọi hành động quan trọng trong hệ thống: ai thực hiện, làm gì, khi nào, từ địa chỉ IP nào. Phục vụ compliance, điều tra sự cố bảo mật, và giám sát hoạt động.

Truy cập Audit Log

  • Tenant Admin: Audit Logs (menu chính)
  • System Admin: Xem tất cả tenant
  • Customer: Không có quyền truy cập

Cấu trúc một Log Entry

TrườngÝ nghĩa
TimestampThời gian thực hiện (chính xác millisecond)
Entity TypeLoại entity bị tác động
Entity NameTên entity
UserEmail người thực hiện
Action TypeLoại hành động
StatusSUCCESS / FAILURE
IP AddressĐịa chỉ IP người dùng
DetailsChi tiết thay đổi (JSON diff)

Entity Types được theo dõi

DEVICE, ASSET, CUSTOMER, USER, TENANT, TENANT_PROFILE, RULE_CHAIN, DASHBOARD, WIDGET_TYPE, WIDGET_BUNDLE, DEVICE_PROFILE, ASSET_PROFILE, ALARM, RELATION, ENTITY_VIEW, OTA_PACKAGE, QUEUE, API_USAGE_STATE, NOTIFICATION_RULE, NOTIFICATION_TARGET, ...

Action Types

ActionMô tả
ADDEDTạo mới entity
UPDATEDCập nhật entity
DELETEDXóa entity
ACTIVATEDKích hoạt (user)
SUSPENDEDTạm khóa
CREDENTIALS_UPDATEDĐổi credentials
CREDENTIALS_READĐọc credentials
LOGINĐăng nhập thành công
LOGOUTĐăng xuất
LOCKOUTBị khóa tài khoản
ASSIGNED_TO_CUSTOMERGán vào customer
UNASSIGNED_FROM_CUSTOMERGỡ khỏi customer
ASSIGNED_TO_TENANTGán vào tenant
RPC_CALLGửi lệnh RPC
ALARM_ACKXác nhận alarm
ALARM_CLEARClear alarm

Tìm kiếm và lọc

Bộ lọc:

  • Time range: Khoảng thời gian
  • Entity type: Lọc theo loại entity
  • User: Lọc theo người thực hiện
  • Action status: Success / Failure
  • Full-text search: Tìm trong tên entity

Ví dụ log entries

2024-01-15 09:23:11 | DEVICE | Sensor-101 | admin@acme.com | UPDATED | SUCCESS | 192.168.1.1 2024-01-15 09:24:05 | USER | john@co.com| admin@acme.com | ADDED | SUCCESS | 192.168.1.1 2024-01-15 09:31:22 | DEVICE | Gateway-01 | john@co.com | CREDENTIALS_READ | SUCCESS | 10.0.0.5 2024-01-15 09:45:00 | ALARM | HighTemp | system | ADDED | SUCCESS | - 2024-01-15 10:01:33 | USER | unknown | - | LOGIN | FAILURE | 203.x.x.x

Export Audit Log

Audit Log > Export Format: CSV / JSON Columns: timestamp, entityType, entityName, user, actionType, status, ip

Lưu giữ dữ liệu

Cấu hình thời gian giữ audit log:

System Settings > Audit Log: Logging enabled: ✓ Retain events for: 30 days (default)

Tăng lên 90-365 ngày cho compliance (PCI-DSS, ISO 27001).


API

GET /api/audit/logs?pageSize=50&page=0&sortProperty=createdTime&sortOrder=DESC GET /api/audit/logs/customer/{customerId} GET /api/audit/logs/user/{userId} GET /api/audit/logs/entity/{entityType}/{entityId}

Compliance use cases

Yêu cầuDùng Audit Log để
Ai xóa thiết bị?Filter: Action=DELETED, EntityType=DEVICE
Ai đọc credentials?Filter: Action=CREDENTIALS_READ
Đăng nhập thất bạiFilter: Action=LOGIN, Status=FAILURE
Thay đổi trong ngàyFilter: Time range = hôm nay
Hoạt động của user XFilter: User = user@domain.com