@@ -68,6 +68,7 @@ type quickDiffCVE struct {
6868 References string
6969 CISAExploitAdd * time.Time
7070 CISAActionDue * time.Time
71+ EUVDExploitAdd * time.Time
7172 CISARequiredAction * string
7273 CISAVulnerabilityName * string
7374 EPSS * float64
@@ -142,7 +143,8 @@ func ComputeQuickDiff(ctx context.Context, tx pgx.Tx, fromVersion time.Time) (*Q
142143 c.description, c.cvss, c."references", c.cisa_required_action,
143144 c.cisa_vulnerability_name, c.epss, c.percentile, c.vector,
144145 c.cisa_exploit_add,
145- c.cisa_action_due
146+ c.cisa_action_due,
147+ c.euvd_exploit_add
146148 FROM cves c
147149 WHERE NOT EXISTS (SELECT 1 FROM _snap_cves s WHERE s.id = c.id)
148150 ` )
@@ -159,7 +161,8 @@ func ComputeQuickDiff(ctx context.Context, tx pgx.Tx, fromVersion time.Time) (*Q
159161 c.description, c.cvss, c."references", c.cisa_required_action,
160162 c.cisa_vulnerability_name, c.epss, c.percentile, c.vector,
161163 c.cisa_exploit_add,
162- c.cisa_action_due
164+ c.cisa_action_due,
165+ c.euvd_exploit_add
163166 FROM cves c
164167 JOIN _snap_cves s ON s.id = c.id
165168 WHERE s.content_hash != c.content_hash
@@ -390,25 +393,25 @@ func computeDiffFromQuickDiff(ctx context.Context, tx pgx.Tx, diff *QuickDiff) e
390393 return fmt .Errorf ("computeDiffFromQuickDiff: copy _diff_del_cves: %w" , err )
391394 }
392395
393- cvePlain := []string {"id" , "content_hash" , "cve" , "date_published" , "date_last_modified" , "description" , "cvss" , "references" , "cisa_exploit_add" , "cisa_action_due" , "cisa_required_action" , "cisa_vulnerability_name" , "epss" , "percentile" , "vector" }
394- if err := createLike ("_diff_ins_cves" , "cves" , `id, content_hash, cve, date_published, date_last_modified, description, cvss, "references", cisa_exploit_add, cisa_action_due, cisa_required_action, cisa_vulnerability_name, epss, percentile, vector` ); err != nil {
396+ cvePlain := []string {"id" , "content_hash" , "cve" , "date_published" , "date_last_modified" , "description" , "cvss" , "references" , "cisa_exploit_add" , "cisa_action_due" , "cisa_required_action" , "cisa_vulnerability_name" , "epss" , "percentile" , "vector" , "euvd_exploit_add" }
397+ if err := createLike ("_diff_ins_cves" , "cves" , `id, content_hash, cve, date_published, date_last_modified, description, cvss, "references", cisa_exploit_add, cisa_action_due, cisa_required_action, cisa_vulnerability_name, epss, percentile, vector, euvd_exploit_add ` ); err != nil {
395398 return fmt .Errorf ("computeDiffFromQuickDiff: create _diff_ins_cves: %w" , err )
396399 }
397400 if len (diff .CVEsInserted ) > 0 {
398401 if _ , err := tx .CopyFrom (ctx , pgx.Identifier {"_diff_ins_cves" }, cvePlain , pgx .CopyFromSlice (len (diff .CVEsInserted ), func (i int ) ([]any , error ) {
399402 c := diff .CVEsInserted [i ]
400- return []any {c .ID , c .ContentHash , c .CVE , c .DatePublished , c .DateLastModified , c .Description , c .CVSS , c .References , c .CISAExploitAdd , c .CISAActionDue , c .CISARequiredAction , c .CISAVulnerabilityName , c .EPSS , c .Percentile , c .Vector }, nil
403+ return []any {c .ID , c .ContentHash , c .CVE , c .DatePublished , c .DateLastModified , c .Description , c .CVSS , c .References , c .CISAExploitAdd , c .CISAActionDue , c .CISARequiredAction , c .CISAVulnerabilityName , c .EPSS , c .Percentile , c .Vector , c . EUVDExploitAdd }, nil
401404 })); err != nil {
402405 return fmt .Errorf ("computeDiffFromQuickDiff: copy _diff_ins_cves: %w" , err )
403406 }
404407 }
405- if err := createLike ("_diff_upd_cves" , "cves" , `id, content_hash, cve, date_published, date_last_modified, description, cvss, "references", cisa_exploit_add, cisa_action_due, cisa_required_action, cisa_vulnerability_name, epss, percentile, vector` ); err != nil {
408+ if err := createLike ("_diff_upd_cves" , "cves" , `id, content_hash, cve, date_published, date_last_modified, description, cvss, "references", cisa_exploit_add, cisa_action_due, cisa_required_action, cisa_vulnerability_name, epss, percentile, vector, euvd_exploit_add ` ); err != nil {
406409 return fmt .Errorf ("computeDiffFromQuickDiff: create _diff_upd_cves: %w" , err )
407410 }
408411 if len (diff .CVEsUpdated ) > 0 {
409412 if _ , err := tx .CopyFrom (ctx , pgx.Identifier {"_diff_upd_cves" }, cvePlain , pgx .CopyFromSlice (len (diff .CVEsUpdated ), func (i int ) ([]any , error ) {
410413 c := diff .CVEsUpdated [i ]
411- return []any {c .ID , c .ContentHash , c .CVE , c .DatePublished , c .DateLastModified , c .Description , c .CVSS , c .References , c .CISAExploitAdd , c .CISAActionDue , c .CISARequiredAction , c .CISAVulnerabilityName , c .EPSS , c .Percentile , c .Vector }, nil
414+ return []any {c .ID , c .ContentHash , c .CVE , c .DatePublished , c .DateLastModified , c .Description , c .CVSS , c .References , c .CISAExploitAdd , c .CISAActionDue , c .CISARequiredAction , c .CISAVulnerabilityName , c .EPSS , c .Percentile , c .Vector , c . EUVDExploitAdd }, nil
412415 })); err != nil {
413416 return fmt .Errorf ("computeDiffFromQuickDiff: copy _diff_upd_cves: %w" , err )
414417 }
@@ -629,7 +632,7 @@ func collectCVERows(rows pgx.Rows) ([]quickDiffCVE, error) {
629632 & c .ID , & c .ContentHash , & c .CVE , & c .DatePublished , & c .DateLastModified ,
630633 & c .Description , & c .CVSS , & c .References , & c .CISARequiredAction ,
631634 & c .CISAVulnerabilityName , & c .EPSS , & c .Percentile , & c .Vector ,
632- & c .CISAExploitAdd , & c .CISAActionDue ,
635+ & c .CISAExploitAdd , & c .CISAActionDue , & c . EUVDExploitAdd ,
633636 ); err != nil {
634637 return nil , err
635638 }
0 commit comments