diff --git a/apps/terminal/api/command.py b/apps/terminal/api/command.py index f98fa0e7c..d18c70858 100644 --- a/apps/terminal/api/command.py +++ b/apps/terminal/api/command.py @@ -55,14 +55,15 @@ class CommandQueryMixin: q = self.request.query_params multi_command_storage = get_multi_command_storage() queryset = multi_command_storage.filter( - date_from=date_from, date_to=date_to, input=q.get("input"), - user=q.get("user"), asset=q.get("asset"), - system_user=q.get("system_user"), + date_from=date_from, date_to=date_to, + user=q.get("user"), asset=q.get("asset"), system_user=q.get("system_user"), + input=q.get("input"), session=q.get("session_id"), risk_level=self.get_query_risk_level(), org_id=self.get_org_id(), ) return queryset def filter_queryset(self, queryset): + # 解决es存储命令时,父类根据filter_fields过滤出现异常的问题,返回的queryset类型list return queryset def get_date_range(self): diff --git a/apps/terminal/backends/command/base.py b/apps/terminal/backends/command/base.py index d95697ed0..4bb85e127 100644 --- a/apps/terminal/backends/command/base.py +++ b/apps/terminal/backends/command/base.py @@ -16,7 +16,7 @@ class CommandBase(object): @abc.abstractmethod def filter(self, date_from=None, date_to=None, user=None, asset=None, system_user=None, - input=None, session=None): + input=None, session=None, risk_level=None, org_id=None): pass @abc.abstractmethod