From 80c6aae9c293540926b0307c36a80c1a04a7afc1 Mon Sep 17 00:00:00 2001 From: Bailey Taylor Date: Wed, 8 Oct 2025 10:02:35 +0800 Subject: [PATCH] Updated CVE scripts to include backfill support. --- scripts/cve-sync.log | 52 +++++++++++++++++++ scripts/fetchCVE_v2.js | 1 + .../controller/ScriptController.java | 6 +++ 3 files changed, 59 insertions(+) diff --git a/scripts/cve-sync.log b/scripts/cve-sync.log index e89869d..e78b6e9 100644 --- a/scripts/cve-sync.log +++ b/scripts/cve-sync.log @@ -46,3 +46,55 @@ [27 May 2025, 12:57:21 pm] โœ… CVE import complete! [27 May 2025, 12:57:21 pm] โœ… CVE import complete! [27 May 2025, 12:57:21 pm] โœ… fetchCVE.js finished with exit code: 0 +[08 Oct 2025, 01:12:44 am] ๐Ÿš€ ๐Ÿ“ก CVE sync launched in background. +[08 Oct 2025, 09:12:44 am] ๐Ÿงช Getting CVEs from the last 30 of days +[08 Oct 2025, 09:12:44 am] ๐Ÿš€ CVE sync started +[08 Oct 2025, 09:12:44 am] ๐Ÿ”„ Initializing script... +[08 Oct 2025, 09:12:44 am] ๐Ÿ“ Launching script +[08 Oct 2025, 09:12:44 am] ๐Ÿ“… Starting CVE sync from 2025-09-08T01:12:44.659Z to 2025-10-08T01:12:44.659Z +[08 Oct 2025, 09:12:44 am] ๐Ÿ“ก Fetching modified CVEs from 08 Sept 2025 to 08 Oct 2025... +[08 Oct 2025, 09:12:44 am] ๐Ÿงช Getting CVEs from the last 30 of days +[08 Oct 2025, 09:12:44 am] ๐Ÿš€ CVE sync started +[08 Oct 2025, 09:12:44 am] ๐Ÿ”„ Initializing script... +[08 Oct 2025, 09:12:44 am] ๐Ÿ“ Launching script +[08 Oct 2025, 09:12:44 am] ๐Ÿ“… Starting CVE sync from 2025-09-08T01:12:44.659Z to 2025-10-08T01:12:44.659Z +[08 Oct 2025, 09:12:44 am] ๐Ÿ“ก Fetching modified CVEs from 08 Sept 2025 to 08 Oct 2025... +[08 Oct 2025, 09:12:47 am] ๐Ÿ“„ Page 1 โ€” Processing 2000 CVEs from index 0 of ~9434 +[08 Oct 2025, 09:12:47 am] ๐Ÿ“„ Page 1 โ€” Processing 2000 CVEs from index 0 of ~9434 +[08 Oct 2025, 09:13:50 am] ๐Ÿ“„ Page 2 โ€” Processing 2000 CVEs from index 2000 of ~9434 +[08 Oct 2025, 09:13:50 am] ๐Ÿ“„ Page 2 โ€” Processing 2000 CVEs from index 2000 of ~9434 +[08 Oct 2025, 09:14:56 am] ๐Ÿ“„ Page 3 โ€” Processing 2000 CVEs from index 4000 of ~9434 +[08 Oct 2025, 09:14:56 am] ๐Ÿ“„ Page 3 โ€” Processing 2000 CVEs from index 4000 of ~9434 +[08 Oct 2025, 09:15:28 am] ๐Ÿ“„ Page 4 โ€” Processing 2000 CVEs from index 6000 of ~9434 +[08 Oct 2025, 09:15:28 am] ๐Ÿ“„ Page 4 โ€” Processing 2000 CVEs from index 6000 of ~9434 +[08 Oct 2025, 09:15:52 am] ๐Ÿ“„ Page 5 โ€” Processing 1434 CVEs from index 8000 of ~9434 +[08 Oct 2025, 09:15:52 am] ๐Ÿ“„ Page 5 โ€” Processing 1434 CVEs from index 8000 of ~9434 +[08 Oct 2025, 09:16:03 am] โœ… CVE import complete! +[08 Oct 2025, 09:16:03 am] โœ… CVE import complete! +[08 Oct 2025, 01:16:03 am] โœ… fetchCVE.js finished with exit code: 0 +[08 Oct 2025, 01:19:08 am] ๐Ÿš€ ๐Ÿ“ก CVE sync launched in background. +[08 Oct 2025, 09:19:08 am] ๐Ÿงช Getting CVEs from the last 30 of days +[08 Oct 2025, 09:19:08 am] ๐Ÿงช Getting CVEs from the last 30 of days +[08 Oct 2025, 09:19:08 am] ๐Ÿš€ CVE sync started +[08 Oct 2025, 09:19:08 am] ๐Ÿ”„ Initializing script... +[08 Oct 2025, 09:19:08 am] ๐Ÿ“ Launching script +[08 Oct 2025, 09:19:08 am] ๐Ÿ“… Starting CVE sync from 2025-09-08T01:19:08.312Z to 2025-10-08T01:19:08.312Z +[08 Oct 2025, 09:19:08 am] ๐Ÿ“ก Fetching modified CVEs from 08 Sept 2025 to 08 Oct 2025... +[08 Oct 2025, 09:19:08 am] ๐Ÿš€ CVE sync started +[08 Oct 2025, 09:19:08 am] ๐Ÿ”„ Initializing script... +[08 Oct 2025, 09:19:08 am] ๐Ÿ“ Launching script +[08 Oct 2025, 09:19:08 am] ๐Ÿ“… Starting CVE sync from 2025-09-08T01:19:08.312Z to 2025-10-08T01:19:08.312Z +[08 Oct 2025, 09:19:08 am] ๐Ÿ“ก Fetching modified CVEs from 08 Sept 2025 to 08 Oct 2025... +[08 Oct 2025, 09:19:10 am] ๐Ÿ“„ Page 1 โ€” Processing 2000 CVEs from index 0 of ~9439 +[08 Oct 2025, 09:19:10 am] ๐Ÿ“„ Page 1 โ€” Processing 2000 CVEs from index 0 of ~9439 +[08 Oct 2025, 09:20:17 am] ๐Ÿ“„ Page 2 โ€” Processing 2000 CVEs from index 2000 of ~9439 +[08 Oct 2025, 09:20:17 am] ๐Ÿ“„ Page 2 โ€” Processing 2000 CVEs from index 2000 of ~9439 +[08 Oct 2025, 09:21:24 am] ๐Ÿ“„ Page 3 โ€” Processing 2000 CVEs from index 4000 of ~9439 +[08 Oct 2025, 09:21:24 am] ๐Ÿ“„ Page 3 โ€” Processing 2000 CVEs from index 4000 of ~9439 +[08 Oct 2025, 09:21:53 am] ๐Ÿ“„ Page 4 โ€” Processing 2000 CVEs from index 6000 of ~9439 +[08 Oct 2025, 09:21:53 am] ๐Ÿ“„ Page 4 โ€” Processing 2000 CVEs from index 6000 of ~9439 +[08 Oct 2025, 09:22:14 am] ๐Ÿ“„ Page 5 โ€” Processing 1439 CVEs from index 8000 of ~9439 +[08 Oct 2025, 09:22:14 am] ๐Ÿ“„ Page 5 โ€” Processing 1439 CVEs from index 8000 of ~9439 +[08 Oct 2025, 09:22:22 am] โœ… CVE import complete! +[08 Oct 2025, 09:22:22 am] โœ… CVE import complete! +[08 Oct 2025, 01:22:22 am] โœ… fetchCVE.js finished with exit code: 0 diff --git a/scripts/fetchCVE_v2.js b/scripts/fetchCVE_v2.js index b3dfaa7..d4022c5 100644 --- a/scripts/fetchCVE_v2.js +++ b/scripts/fetchCVE_v2.js @@ -451,6 +451,7 @@ async function importCVEEnrichmentFast() { +// This script runs enrichment mode - use fetchCVE_withMORE.js for backfill importCVEEnrichmentFast().catch((err) => { log(`โŒ Fatal error during enrichment: ${err.message}`); logFile.end(); diff --git a/src/main/java/com/psg/dlsysinfo/dl_sysinfo_server/controller/ScriptController.java b/src/main/java/com/psg/dlsysinfo/dl_sysinfo_server/controller/ScriptController.java index aa4ad74..40b38a3 100644 --- a/src/main/java/com/psg/dlsysinfo/dl_sysinfo_server/controller/ScriptController.java +++ b/src/main/java/com/psg/dlsysinfo/dl_sysinfo_server/controller/ScriptController.java @@ -66,6 +66,12 @@ public class ScriptController { return triggerScript("fetchCVE.js", "๐Ÿ“ก CVE sync launched in background.", getCveLogFile()); } + @PreAuthorize("hasRole('ADMIN')") + @PostMapping("/fetch-cve-backfill") + public ResponseEntity runCveBackfillScript(@AuthenticationPrincipal Object user) { + return triggerScript("fetchCVE_withMORE.js", "๐Ÿ“ก CVE backfill launched - will sync back to 2002.", getCveLogFile()); + } + @PreAuthorize("hasRole('ADMIN')") @PostMapping("/fetch-kev") public ResponseEntity runKevScript(@AuthenticationPrincipal Object user) {