Skip to content

Commit

Permalink
⭐️ use running kernel version for vuln analysis (#1193)
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-rock authored Mar 21, 2024
1 parent c7b1852 commit 3eadd25
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion apps/cnspec/cmd/vuln.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ var vulnCmdRun = func(cmd *cobra.Command, runtime *providers.Runtime, cliRes *pl
log.Fatal().Err(err).Msg("failed to initialize advisory scanner client")
}

var runningKernel string
if bom.Asset.Labels != nil {
runningKernel = bom.Asset.Labels[sbom.LABEL_KERNEL_RUNNING]
}

req := &mvd.AnalyseAssetRequest{
Platform: &mvd.Platform{
Name: bom.Asset.Platform.Name,
Expand All @@ -106,7 +111,8 @@ var vulnCmdRun = func(cmd *cobra.Command, runtime *providers.Runtime, cliRes *pl
Labels: bom.Asset.Platform.Labels,
Title: bom.Asset.Platform.Title,
},
Packages: make([]*mvd.Package, 0),
Packages: make([]*mvd.Package, 0),
KernelVersion: runningKernel,
}

for i := range bom.Packages {
Expand Down

0 comments on commit 3eadd25

Please sign in to comment.