File tree Expand file tree Collapse file tree 2 files changed +77
-0
lines changed Expand file tree Collapse file tree 2 files changed +77
-0
lines changed Original file line number Diff line number Diff line change 1+ id : all_vulnerabilities_fixes_for_image 
2+ type : query 
3+ title : All Vulnerabilities And Fixes For Image in parameters 
4+ description : All Images Vulnerabilities and their details and fixes for image in parameters 
5+ integration_type :
6+   - github_account 
7+ query : | 
8+   WITH ArtifactPackagesWithVulns AS ( 
9+       SELECT DISTINCT 
10+           p.image_url, 
11+           p.artifact_id, 
12+           p.ecosystem, 
13+           p.package_name, 
14+           p.version, 
15+           v.vulnerabilities 
16+       FROM ( 
17+           SELECT DISTINCT 
18+               image_url, 
19+               artifact_id, 
20+               (jsonb_array_elements(packages)->>'ecosystem') AS ecosystem, 
21+               (jsonb_array_elements(packages)->>'name') AS package_name, 
22+               (jsonb_array_elements(packages)->>'version') AS version 
23+           FROM artifact_package_list 
24+           WHERE artifact_url = '{{.artifactUrl}}' 
25+       ) AS p 
26+       JOIN packages_with_vulnerabilities v ON 
27+           p.ecosystem = v.ecosystem AND 
28+           p.package_name = v.package_name AND 
29+           p.version = v.version 
30+       WHERE v.vulnerabilities IS NOT NULL AND v.vulnerabilities <> '[]'::jsonb 
31+     ) 
32+     SELECT 
33+       apv.image_url, 
34+       apv.artifact_id, 
35+       apv.ecosystem, 
36+       apv.package_name, 
37+       apv.version, 
38+       vuln_id, 
39+       ovd.* 
40+     FROM ArtifactPackagesWithVulns apv 
41+       CROSS JOIN LATERAL jsonb_array_elements_text(apv.vulnerabilities) AS v_list(vuln_id) 
42+       LEFT JOIN osv_vulnerability_details ovd ON v_list.vuln_id = ovd.id; 
43+ tags :
44+   platform_queries_bookmark :
45+     - ' true' 
Original file line number Diff line number Diff line change 1+ id : list_all_container_packages_vulnerabilities_for_image 
2+ type : query 
3+ title : List all packages vulnerabilities in all containers for image 
4+ description : Get the list of all vulnerabilities in all packages in all containers for image in parameters 
5+ integration_type :
6+     - github_account 
7+ query : | 
8+     SELECT DISTINCT 
9+         p.image_url, 
10+         p.artifact_id, 
11+         p.ecosystem, 
12+         p.package_name, 
13+         p.version, 
14+         v.vulnerabilities -- Replace with the actual vulnerability column(s) 
15+     FROM ( 
16+         SELECT DISTINCT 
17+             image_url, 
18+             artifact_id, 
19+             (jsonb_array_elements(packages)->>'ecosystem') AS ecosystem, 
20+             (jsonb_array_elements(packages)->>'name') AS package_name, 
21+             (jsonb_array_elements(packages)->>'version') AS version 
22+         FROM artifact_package_list 
23+         WHERE artifact_url = '{{.artifactUrl}}' 
24+         ) AS p 
25+     JOIN packages_with_vulnerabilities v ON 
26+         p.ecosystem = v.ecosystem AND 
27+         p.package_name = v.package_name AND 
28+         p.version = v.version 
29+     WHERE v.vulnerabilities is not null and v.vulnerabilities <> '[]'; 
30+ tags :
31+     platform_queries_bookmark :
32+         - ' true' 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments