Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit b6c861d

Browse files
committed
Allow cve queries to match against cve-id
Signed-off-by: Christian Dupuis <[email protected]>
1 parent be7359e commit b6c861d

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

query/base_image_cve_query.edn

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@
5454
)
5555

5656
(not-join [?image ?source-id]
57-
[?v :vulnerability/source-id ?source-id]
57+
(or-join [?v ?source-id]
58+
[?v :vulnerability/source-id ?source-id]
59+
[?v :vulnerability/cve-id ?source-id])
5860
[?v :vulnerability/source ?source]
5961
[?v :vulnerability/advisories ?adv]
6062
[(missing? $ ?v :vulnerability/withdrawn-at)]

query/package_cve.edn

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@
2222
:keys purl source-id source vulnerable-range url fixed-by v cve
2323
:in $ $b %% ?ctx [?packages ?source-id]
2424
:where
25-
[?v :vulnerability/source-id ?source-id]
25+
26+
(or-join [?v ?source-id]
27+
[?v :vulnerability/cve-id ?source-id]
28+
(and
29+
[(missing? $ ?v :vulnerability/cve-id)]
30+
[?v :vulnerability/source-id ?source-id]))
2631
[?v :vulnerability/source ?source]
2732
[?v :vulnerability/advisories ?adv]
2833

@@ -35,12 +40,6 @@
3540
[?versions :vulnerability.advisory.version/vulnerable-range ?range]
3641
(range-satisfied? ?type ?version ?source ?range)
3742

38-
(or-join [?v ?source-id]
39-
[?v :vulnerability/cve-id ?source-id]
40-
(and
41-
[(missing? $ ?v :vulnerability/cve-id)]
42-
[?v :vulnerability/source-id ?source-id]))
43-
4443
(or-join [?versions ?fixed-by]
4544
[?versions :vulnerability.advisory.version/fixed-by ?fixed-by]
4645
(and

0 commit comments

Comments
 (0)