55 lines
2.3 KiB
Diff
55 lines
2.3 KiB
Diff
From 412ebea59d55abbf1acc328077b8854b2634a4d1 Mon Sep 17 00:00:00 2001
|
|
From: rabbitali <shusheng.wen@outlook.com>
|
|
Date: Thu, 1 Jun 2023 09:09:39 +0800
|
|
Subject: [PATCH] update cve fix
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
---
|
|
zeus/function/verify/vulnerability.py | 2 +-
|
|
zeus/vulnerability_manage/view.py | 8 ++++++--
|
|
2 files changed, 7 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/zeus/function/verify/vulnerability.py b/zeus/function/verify/vulnerability.py
|
|
index 253bb4d..4aabc00 100644
|
|
--- a/zeus/function/verify/vulnerability.py
|
|
+++ b/zeus/function/verify/vulnerability.py
|
|
@@ -75,7 +75,7 @@ class CveFixSchema(TaskGeneralSchema):
|
|
"""
|
|
tasks = fields.List(fields.Nested(CveFixTask()),
|
|
required=True, validate=lambda s: len(s) > 0)
|
|
-
|
|
+ accepted = fields.Boolean(validate=validate.OneOf([True, False]),required=True)
|
|
|
|
class CveRollbackTask(Schema):
|
|
host_id = fields.Integer(required=True, validate=lambda s: s > 0)
|
|
diff --git a/zeus/vulnerability_manage/view.py b/zeus/vulnerability_manage/view.py
|
|
index adb4bc8..368847c 100644
|
|
--- a/zeus/vulnerability_manage/view.py
|
|
+++ b/zeus/vulnerability_manage/view.py
|
|
@@ -604,7 +604,12 @@ class ExecuteCveFixTask(BaseResponse):
|
|
})
|
|
return data
|
|
|
|
+ for cve in task_info.get("cves"):
|
|
+ if cve.get("hotpatch"):
|
|
+ cve["accepted"] = task_info["accepted"]
|
|
+
|
|
command_args = {
|
|
+ "accepted": task_info.get("accepted"),
|
|
"check_items": self._check_items,
|
|
"check": task_info.get("check"),
|
|
"cves": task_info.get("cves")
|
|
@@ -732,8 +737,7 @@ class ExecuteCveFixTask(BaseResponse):
|
|
self._task_name = params.get("task_name")
|
|
self._task_type = params.get("task_type")
|
|
self._check_items = params.get('check_items')
|
|
- tasks = generate_tasks(params.get('tasks'), host_infos,
|
|
- **{"repo_info": params.get("repo_info")})
|
|
+ tasks = generate_tasks(params.get('tasks'), host_infos, **{"accepted": params.get("accepted", False)})
|
|
if params.get("timed"):
|
|
self._header.update({
|
|
"exempt_authentication": configuration.individuation.get("EXEMPT_AUTHENTICATION"),
|
|
--
|