mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-05-05 22:56:26 +00:00
* feat:重构操作日志模块 * feat: 改密计划增加操作日志记录 * feat: 支持操作日志接入ES,且接口limit支持自定义限制大小 * feat:翻译 * feat: 生成迁移文件 * feat: 优化迁移文件 * feat: 优化多对多日志记录 * feat: 命令存储ES部分和日志存储ES部分代码优化 * feat: 优化敏感字段脱敏 Co-authored-by: Jiangjie.Bai <bugatti_it@163.com>
19 lines
491 B
Python
19 lines
491 B
Python
from importlib import import_module
|
|
|
|
from django.conf import settings
|
|
|
|
|
|
TYPE_ENGINE_MAPPING = {
|
|
'db': 'audits.backends.db',
|
|
'es': 'audits.backends.es',
|
|
}
|
|
|
|
|
|
def get_operate_log_storage(default=False):
|
|
engine_mod = import_module(TYPE_ENGINE_MAPPING['db'])
|
|
es_config = settings.OPERATE_LOG_ELASTICSEARCH_CONFIG
|
|
if not default and es_config:
|
|
engine_mod = import_module(TYPE_ENGINE_MAPPING['es'])
|
|
storage = engine_mod.OperateLogStore(es_config)
|
|
return storage
|