-
Notifications
You must be signed in to change notification settings - Fork 5k
[Feature][service]add audit fuction #5822
Description
[Feature][service]add audit fuction
Feature Desciption
This function records the operations that users successfully perform to change the system or workflow configuration, such as creating queue, creating workflow and so on. User can determine whether audit function turn on or not through the switch setting. The default implementation mode of the audit data is written to MySQL, and the extension interface is provided to store the data in other ways. The audit log is displayed on the front page, and the basic filtering operation is provided.
why this new feature usefule for most users
-
Improve the security of the system, audit function records the modification and operator of the database, which is convenient to view the specific reasons when the business is modified.
-
Users can view the historical behavior, and can trace back according to the operation history when the business has problems
-
At present, only the API operation information and user-defined workflow output log are recorded in the log. Users need to track the log when troubleshooting, which is not convenient and simple to use.
Design plan
Plan a: publish and subscribe mode . After user completes the modification operation, the operation behavior information is published as the form of message
Plan B: implementation using AOP
Audit Log Schema Design
| Module | Type | IP | operator | time |
|---|---|---|---|---|
| workflow definition | create workflow | 124.202.192.246 | admin | 2021-10-11 12:11:10 |
Additional context
Airflow provides basic user behavior recording and viewing functions, recording the time, operator, event, parameter and other information of operation.
功能描述
该功能记录用户成功执行的对系统工作流配置有改动的操作,如创建队列、创建工作流等操作。通过开关设置是否开启审计功能, 审计的数据
默认提供的实现方式是写入mysql,并且提供扩展接口实现使用其他方式存储。在前端页面上展示审计日志,并且提供基本的筛选操作。
实现方案
plan A:采用发布订阅模式,用户修改操作执行完成后,将操作行为信息以消息的方式进行发布
plan B:使用AOP进行实现
该功能为何对大多数用户有用?
- 提高系统安全性,审计功能记录下数据库的修改和操作人,方便在业务被修改等情况查看具体原因。
- 用户能够查看历史行为,在业务出现问题的时候,可以根据操作历史进行回溯
- 目前只在日志中记录了对API的操作信息,以及用户定义的工作流输出日志。用户进行问题排查时,需要追踪日志,使用不够方便和简单。
日志的shema设计
| Module | Type | IP | operator | time |
|---|---|---|---|---|
| workflow definition | create workflow | 124.202.192.246 | admin | 2021-10-11 12:11:10 |
其他
airflow提供了基本的用户行为记录和查看功能,记录了用户操作的时间、操作人、事件、参数等信息。