perf: 修改 CommandFilterACL, CommandGroup Model 的 Meta 内部类; 修改 Command Model 的 system_user -> account 字段; 修改 ConnectionToken 的 command_filter_acls 返回字段;

This commit is contained in:
Bai
2022-12-05 13:27:51 +08:00
parent 0cfcfacb6d
commit cc7424dbfe
16 changed files with 106 additions and 60 deletions

View File

@@ -26,7 +26,7 @@ __all__ = ['CommandViewSet', 'InsecureCommandAlertAPI']
class CommandQueryMixin:
command_store = get_command_storage()
filterset_fields = [
"asset", "system_user", "user", "session",
"asset", "account", "user", "session",
"risk_level", "input"
]
default_days_ago = 5
@@ -56,7 +56,7 @@ class CommandQueryMixin:
multi_command_storage = get_multi_command_storage()
queryset = multi_command_storage.filter(
date_from=date_from, date_to=date_to,
user=q.get("user"), asset=q.get("asset"), system_user=q.get("system_user"),
user=q.get("user"), asset=q.get("asset"), account=q.get("account"),
input=q.get("input"), session=q.get("session_id", q.get('session')),
risk_level=self.get_query_risk_level(), org_id=self.get_org_id(),
)
@@ -91,7 +91,7 @@ class CommandViewSet(JMSBulkModelViewSet):
{
"user": "admin",
"asset": "localhost",
"system_user": "web",
"account": "web",
"session": "xxxxxx",
"input": "whoami",
"output": "d2hvbWFp", # base64.b64encode(s)