mirror of
https://github.com/anchore/syft.git
synced 2026-11-03 16:06:36 +01:00
Merge the .NET deps.json and PE binary catalogers (#3563)
* add combined deps.json + pe binary cataloger Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * deprecate pe and deps standalone catalogers Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * parse resource names + add tests Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * fix integration and CLI tests Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * add some helpful code comments Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * allow for dropping Dep packages that are missing DLLs Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * migrate json schema changes to 24 Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * keep application configuration Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * correct config help Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * [wip] detect claims of dlls within deps.json Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * [wip] fix tests Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * add assembly repack detection Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * .net package count is lower due to dll claim requirement Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> --------- Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
/*
|
||||
Package dotnet provides a concrete Cataloger implementation relating to packages within the C#/.NET language/runtime ecosystem.
|
||||
*/
|
||||
package dotnet
|
||||
|
||||
import (
|
||||
@@ -8,19 +5,27 @@ import (
|
||||
"github.com/anchore/syft/syft/pkg/cataloger/generic"
|
||||
)
|
||||
|
||||
// NewDotnetDepsCataloger returns a new Dotnet cataloger object base on deps json files.
|
||||
// NewDotnetDepsBinaryCataloger returns a cataloger based on PE and deps.json file contents.
|
||||
func NewDotnetDepsBinaryCataloger(config CatalogerConfig) pkg.Cataloger {
|
||||
return &depsBinaryCataloger{
|
||||
config: config,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDotnetDepsCataloger returns a cataloger based on deps.json file contents.
|
||||
// Deprecated: use NewDotnetDepsBinaryCataloger instead which combines the PE and deps.json data which yields more accurate results (will be removed in syft v2.0).
|
||||
func NewDotnetDepsCataloger() pkg.Cataloger {
|
||||
return generic.NewCataloger("dotnet-deps-cataloger").
|
||||
WithParserByGlobs(parseDotnetDeps, "**/*.deps.json")
|
||||
return &depsCataloger{}
|
||||
}
|
||||
|
||||
// NewDotnetPortableExecutableCataloger returns a new Dotnet cataloger object base on portable executable files.
|
||||
func NewDotnetPortableExecutableCataloger(cfg CatalogerConfig) pkg.Cataloger {
|
||||
p := dotnetPortableExecutableParser{cfg: cfg}
|
||||
return generic.NewCataloger("dotnet-portable-executable-cataloger").
|
||||
WithParserByGlobs(p.parseDotnetPortableExecutable, "**/*.dll", "**/*.exe")
|
||||
// NewDotnetPortableExecutableCataloger returns a cataloger based on PE file contents.
|
||||
// Deprecated: use NewDotnetDepsBinaryCataloger instead which combines the PE and deps.json data which yields more accurate results (will be removed in syft v2.0).
|
||||
func NewDotnetPortableExecutableCataloger() pkg.Cataloger {
|
||||
return &binaryCataloger{}
|
||||
}
|
||||
|
||||
// NewDotnetPackagesLockCataloger returns a cataloger based on packages.lock.json files.
|
||||
func NewDotnetPackagesLockCataloger() pkg.Cataloger {
|
||||
return generic.NewCataloger("dotnet-packages-lock-cataloger").WithParserByGlobs(parseDotnetPackagesLock, "**/packages.lock.json")
|
||||
return generic.NewCataloger("dotnet-packages-lock-cataloger").
|
||||
WithParserByGlobs(parseDotnetPackagesLock, "**/packages.lock.json")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user