Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c9637b8
add kernel handler
deitch Mar 20, 2023
787e8b6
[wip] combine kernel and kernel module cataloging
wagoodman Mar 29, 2023
c33e142
[wip] combine kernel and kernel module cataloging
wagoodman Mar 29, 2023
be3cc95
Merge remote-tracking branch 'origin/main' into kernel-and-modules-ca…
wagoodman Apr 4, 2023
acc8426
rename Kernel package to LinuxKernel package
wagoodman Apr 6, 2023
d144523
split kernel and module packages within cataloger
wagoodman Apr 10, 2023
db5e932
wire up application configuration with kernel cataloger options
wagoodman Apr 10, 2023
3c68a93
Merge remote-tracking branch 'origin/main' into kernel-and-modules-ca…
wagoodman Apr 13, 2023
950583b
dont use references for packages on relationships
wagoodman Apr 13, 2023
7eb054f
fix linting and tests
wagoodman Apr 13, 2023
aacf2e2
kernel cataloger should be resistent to partial failure
wagoodman Apr 13, 2023
8056339
log upon kernel module metadata missing
wagoodman Apr 13, 2023
49cdee0
add tests for linux kernel cataloger
wagoodman Apr 14, 2023
dca44ae
update integration tests
wagoodman Apr 14, 2023
500015b
update cli package test counts
wagoodman Apr 14, 2023
9f75d14
Merge remote-tracking branch 'origin/main' into kernel-and-modules-ca…
wagoodman Apr 14, 2023
5ea16e3
add evidence annotations for kernel packages
wagoodman Apr 14, 2023
0a68e73
reduce noise in cli test output
wagoodman Apr 14, 2023
d67f89b
missed cli test to reduce noise for
wagoodman Apr 14, 2023
449132d
fix package counts
wagoodman Apr 14, 2023
1476626
update docs with linux kernel cataloging refs
wagoodman Apr 14, 2023
3091d01
bump json schema with new metadata fields
wagoodman Apr 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ For commercial support options with Syft or Grype, please [contact Anchore](http
- Java (jar, ear, war, par, sar, nar, native-image)
- JavaScript (npm, yarn)
- Jenkins Plugins (jpi, hpi)
- Linux kernel archives (vmlinz)
- Linux kernel modules (ko)
- Nix (outputs in /nix/store)
- PHP (composer)
- Python (wheel, egg, poetry, requirements.txt)
Expand Down Expand Up @@ -513,6 +515,11 @@ golang:
# SYFT_GOLANG_LOCAL_MOD_CACHE_DIR env var
local-mod-cache-dir: ""

linux-kernel:
# whether to catalog linux kernel modules found within lib/modules/** directories
# SYFT_LINUX_KERNEL_CATALOG_MODULES env var
catalog-modules: true

# cataloging file contents is exposed through the power-user subcommand
file-contents:
cataloger:
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ require (
github.com/Masterminds/sprig/v3 v3.2.3
github.com/anchore/go-logger v0.0.0-20220728155337-03b66a5207d8
github.com/anchore/stereoscope v0.0.0-20230406143206-e95d60a265e3
github.com/deitch/magic v0.0.0-20230404182410-1ff89d7342da
github.com/docker/docker v23.0.3+incompatible
github.com/google/go-containerregistry v0.14.0
github.com/google/licensecheck v0.3.1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/deitch/magic v0.0.0-20230404182410-1ff89d7342da h1:ZOjWpVsFZ06eIhnh4mkaceTiVoktdU67+M7KDHJ268M=
github.com/deitch/magic v0.0.0-20230404182410-1ff89d7342da/go.mod h1:B3tI9iGHi4imdLi4Asdha1Sc6feLMTfPLXh9IUYmysk=
github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1/go.mod h1:+hnT3ywWDTAFrW5aE+u2Sa/wT555ZqwoCS+pk3p6ry4=
github.com/docker/cli v23.0.1+incompatible h1:LRyWITpGzl2C9e9uGxzisptnxAn1zfZKXy13Ul2Q5oM=
github.com/docker/cli v23.0.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
Expand Down
5 changes: 5 additions & 0 deletions internal/config/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/anchore/syft/internal/log"
"github.com/anchore/syft/syft/pkg/cataloger"
golangCataloger "github.com/anchore/syft/syft/pkg/cataloger/golang"
"github.com/anchore/syft/syft/pkg/cataloger/kernel"
)

var (
Expand Down Expand Up @@ -50,6 +51,7 @@ type Application struct {
Catalogers []string `yaml:"catalogers" json:"catalogers" mapstructure:"catalogers"`
Package pkg `yaml:"package" json:"package" mapstructure:"package"`
Golang golang `yaml:"golang" json:"golang" mapstructure:"golang"`
LinuxKernel linuxKernel `yaml:"linux-kernel" json:"linux-kernel" mapstructure:"linux-kernel"`
Attest attest `yaml:"attest" json:"attest" mapstructure:"attest"`
FileMetadata FileMetadata `yaml:"file-metadata" json:"file-metadata" mapstructure:"file-metadata"`
FileClassification fileClassification `yaml:"file-classification" json:"file-classification" mapstructure:"file-classification"`
Expand All @@ -76,6 +78,9 @@ func (cfg Application) ToCatalogerConfig() cataloger.Config {
SearchLocalModCacheLicenses: cfg.Golang.SearchLocalModCacheLicenses,
LocalModCacheDir: cfg.Golang.LocalModCacheDir,
},
LinuxKernel: kernel.LinuxCatalogerConfig{
CatalogModules: cfg.LinuxKernel.CatalogModules,
},
}
}

Expand Down
11 changes: 11 additions & 0 deletions internal/config/linux_kernel.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package config

import "github.com/spf13/viper"

type linuxKernel struct {
CatalogModules bool `json:"catalog-modules" yaml:"catalog-modules" mapstructure:"catalog-modules"`
}

func (cfg linuxKernel) loadDefaultValues(v *viper.Viper) {
v.SetDefault("linux-kernel.catalog-modules", true)
}
2 changes: 1 addition & 1 deletion internal/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ const (

// JSONSchemaVersion is the current schema version output by the JSON encoder
// This is roughly following the "SchemaVer" guidelines for versioning the JSON schema. Please see schema/json/README.md for details on how to increment.
JSONSchemaVersion = "7.1.2"
JSONSchemaVersion = "7.1.3"
)
2 changes: 2 additions & 0 deletions schema/json/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ type artifactMetadataContainer struct {
Hackage pkg.HackageMetadata
Java pkg.JavaMetadata
KbPackage pkg.KbPackageMetadata
LinuxKernel pkg.LinuxKernelMetadata
LinuxKernelModule pkg.LinuxKernelModuleMetadata
Nix pkg.NixStoreMetadata
NpmPackage pkg.NpmPackageJSONMetadata
NpmPackageLock pkg.NpmPackageLockJSONMetadata
Expand Down
Loading