From da571495e810da30b6a286dad819101e3727c839 Mon Sep 17 00:00:00 2001 From: gongzt Date: Mon, 23 Oct 2023 18:47:24 +0800 Subject: [PATCH] Fixed the problem that the number of hosts in the cve list repeated statistics --- 0006-fix-cve-list-by-host-count.patch | 28 +++++++++++++++++++++++++++ aops-apollo.spec | 6 +++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 0006-fix-cve-list-by-host-count.patch diff --git a/0006-fix-cve-list-by-host-count.patch b/0006-fix-cve-list-by-host-count.patch new file mode 100644 index 0000000..52e3789 --- /dev/null +++ b/0006-fix-cve-list-by-host-count.patch @@ -0,0 +1,28 @@ +From c4e6df14e518206ee9f4de55b3ba45f9f6632d1b Mon Sep 17 00:00:00 2001 +From: gongzt +Date: Mon, 23 Oct 2023 15:39:44 +0800 +Subject: Fixed the problem that the number of hosts in the cve list repeated statistics +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + database/apollo.sql | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/database/apollo.sql b/database/apollo.sql +index a87f85c..b79707b 100644 +--- a/database/apollo.sql ++++ b/database/apollo.sql +@@ -130,7 +130,7 @@ BEGIN + DROP TABLE IF EXISTS cve_host_user_count; + SET @tmp_cve_host_count_sql = 'CREATE TEMPORARY TABLE cve_host_user_count SELECT + cve_id, +- COUNT(host_id) AS host_num ++ COUNT(DISTINCT host_id) AS host_num + FROM + cve_host_match FORCE INDEX (ix_cve_host_match_host_id) + WHERE 1=1 '; +-- +Gitee + diff --git a/aops-apollo.spec b/aops-apollo.spec index 816787b..9cfbfc3 100644 --- a/aops-apollo.spec +++ b/aops-apollo.spec @@ -1,6 +1,6 @@ Name: aops-apollo Version: v1.3.4 -Release: 6 +Release: 7 Summary: Cve management service, monitor machine vulnerabilities and provide fix functions. License: MulanPSL2 URL: https://gitee.com/openeuler/%{name} @@ -10,6 +10,7 @@ Patch0002: 0002-fix-query-all-by-cve-list.patch Patch0003: 0003-fix-cve-list-get-api-query-error.patch Patch0004: 0004-fix-query-cve-list-error-and-sql-error.patch Patch0005: 0005-fix-the-severity-field-filtering-error.patch +Patch0006: 0006-fix-cve-list-by-host-count.patch BuildRequires: python3-setuptools Requires: aops-vulcanus >= v1.3.0 @@ -72,6 +73,9 @@ popd %{python3_sitelib}/aops_apollo_tool/* %changelog +* Mon Oct 23 2023 gongzhengtang - v1.3.4-7 +- fixed the problem that the number of hosts in the cve list repeated statistics + * Mon Oct 23 2023 wenxin - v1.3.4-6 - fix the severity field filtering error