审计日志是数据库的记录凭证,通过审计日志功能可以查询到用户在数据库中增删改查等各项操作,以保证信息安全。关于IoTDB的审计日志功能可以实现以下场景的需求:
通过审计日志功能追踪到所有用户在数据中的各项操作。其中所记录的信息要包含数据操作(新增、删除、查询)及元数据操作(新增、修改、删除、查询)、客户端登录信息(用户名、ip地址)。
客户端的来源
如非人为操作,硬件采集器通过 Session/JDBC/MQTT 写入的数据不需要记录审计日志
通过配置可以实现:
在iotdb-system.properties中修改以下几项配置
#################### ### Audit log Configuration #################### # whether to enable the audit log. # Datatype: Boolean # enable_audit_log=false # Output location of audit logs # Datatype: String # IOTDB: the stored time series is: root.__system.audit._{user} # LOGGER: log_audit.log in the log directory # audit_log_storage=IOTDB,LOGGER # whether enable audit log for DML operation of data # whether enable audit log for DDL operation of schema # whether enable audit log for QUERY operation of data and schema # Datatype: String # audit_log_operation=DML,DDL,QUERY # whether the local write api records audit logs # Datatype: Boolean # This contains Session insert api: insertRecord(s), insertTablet(s),insertRecordsOfOneDevice # MQTT insert api # RestAPI insert api # This parameter will cover the DML in audit_log_operation # enable_audit_log_for_native_insert_api=true