Skip to content

Commit

Permalink
Merge pull request #134 from Nithunikzz/main
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
vijeyash1 authored Aug 2, 2023
2 parents 1c19c60 + ff45fa6 commit c590808
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions client/pkg/clickhouse/db_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,12 @@ func (c *DBClient) InsertTrivyImageMetrics(metrics model.TrivyImage) {
metrics.ID,
metrics.ClusterName,
metrics.Report.ArtifactName,
metrics.Report.Metadata.Size,
metrics.Report.Metadata.OS.Name,
metrics.Report.Metadata.ImageID,
strings.Join(metrics.Report.Metadata.DiffIDs, ","),
strings.Join(metrics.Report.Metadata.RepoTags, ","),
strings.Join(metrics.Report.Metadata.RepoDigests, ","),
vulnerability.VulnerabilityID,
vulnerability.PkgID,
vulnerability.PkgName,
Expand Down
8 changes: 7 additions & 1 deletion client/pkg/clickhouse/statements.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ const trivyTableImage DBStatement = `
id UUID,
cluster_name String,
artifact_name String,
metadata_size BIGINT,
metadata_osname String,
metadata_imageid String,
metadata_diffid String,
metadata_repotags String,
metadata_repodigest String,
vul_id String,
vul_pkg_id String,
vul_pkg_name String,
Expand Down Expand Up @@ -158,5 +164,5 @@ const containerDockerhubTable DBStatement = `CREATE table IF NOT EXISTS containe
const containerGithubTable DBStatement = `CREATE table IF NOT EXISTS container_github(event JSON) ENGINE = MergeTree ORDER BY tuple();`
const InsertKubeScore string = "INSERT INTO kubescore (id, namespace, cluster_name, recommendations) VALUES (?, ?, ?, ?)"
const InsertTrivyVul string = "INSERT INTO trivy_vul (id, cluster_name, namespace, kind, name, vul_id, vul_vendor_ids, vul_pkg_id, vul_pkg_name, vul_pkg_path, vul_installed_version, vul_fixed_version, vul_title, vul_severity, vul_published_date, vul_last_modified_date) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?. ?)"
const InsertTrivyImage string = "INSERT INTO trivyimage (id, cluster_name, artifact_name, vul_id, vul_pkg_id, vul_pkg_name, vul_installed_version, vul_fixed_version, vul_title, vul_severity, vul_published_date, vul_last_modified_date) VALUES ( ?, ?,?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
const InsertTrivyImage string = "INSERT INTO trivyimage (id, cluster_name, artifact_name,metadata_size ,metadata_osname ,metadata_imageid ,metadata_diffid ,metadata_repotags ,metadata_repodigest, vul_id, vul_pkg_id, vul_pkg_name, vul_installed_version, vul_fixed_version, vul_title, vul_severity, vul_published_date, vul_last_modified_date) VALUES ( ?, ?,?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?,?,?,?,?,?)"
const InsertTrivyMisconfig string = "INSERT INTO trivy_misconfig (id, cluster_name, namespace, kind, name, misconfig_id, misconfig_avdid, misconfig_type, misconfig_title, misconfig_desc, misconfig_msg, misconfig_query, misconfig_resolution, misconfig_severity, misconfig_status) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?. ?, ?)"

0 comments on commit c590808

Please sign in to comment.