mirror of
https://github.com/anchore/syft.git
synced 2026-11-05 00:46:38 +01:00
feat(cataloger): add a terraform provider cataloger (#3378)
* feat(cataloger): add a terraform provider cataloger * chore: bump schema from 16.0.19 -> 16.0.20 ------ Signed-off-by: Thomas Gosteli <thomas.gosteli@protonmail.ch> Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> Signed-off-by: Christopher Angelo Phillips <32073428+spiffcs@users.noreply.github.com> Co-authored-by: Alex Goodman <wagoodman@users.noreply.github.com> Co-authored-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
This commit is contained in:
co-authored by
Alex Goodman
Christopher Phillips
parent
1906c179d0
commit
c10e904c28
+15
-9
@@ -33,6 +33,7 @@ const (
|
||||
LinuxKernelModulePkg Type = "linux-kernel-module"
|
||||
NixPkg Type = "nix"
|
||||
NpmPkg Type = "npm"
|
||||
OpamPkg Type = "opam"
|
||||
PhpComposerPkg Type = "php-composer"
|
||||
PhpPeclPkg Type = "php-pecl"
|
||||
PortagePkg Type = "portage"
|
||||
@@ -43,7 +44,7 @@ const (
|
||||
RustPkg Type = "rust-crate"
|
||||
SwiftPkg Type = "swift"
|
||||
SwiplPackPkg Type = "swiplpack"
|
||||
OpamPkg Type = "opam"
|
||||
TerraformPkg Type = "terraform"
|
||||
WordpressPluginPkg Type = "wordpress-plugin"
|
||||
)
|
||||
|
||||
@@ -71,6 +72,7 @@ var AllPkgs = []Type{
|
||||
LinuxKernelModulePkg,
|
||||
NixPkg,
|
||||
NpmPkg,
|
||||
OpamPkg,
|
||||
PhpComposerPkg,
|
||||
PhpPeclPkg,
|
||||
PortagePkg,
|
||||
@@ -81,7 +83,7 @@ var AllPkgs = []Type{
|
||||
RustPkg,
|
||||
SwiftPkg,
|
||||
SwiplPackPkg,
|
||||
OpamPkg,
|
||||
TerraformPkg,
|
||||
WordpressPluginPkg,
|
||||
}
|
||||
|
||||
@@ -131,14 +133,16 @@ func (t Type) PackageURLType() string {
|
||||
return packageurl.TypePyPi
|
||||
case PortagePkg:
|
||||
return "portage"
|
||||
case LuaRocksPkg:
|
||||
return packageurl.TypeLuaRocks
|
||||
case NixPkg:
|
||||
return "nix"
|
||||
case NpmPkg:
|
||||
return packageurl.TypeNPM
|
||||
case OpamPkg:
|
||||
return "opam"
|
||||
case Rpkg:
|
||||
return packageurl.TypeCran
|
||||
case LuaRocksPkg:
|
||||
return packageurl.TypeLuaRocks
|
||||
case RpmPkg:
|
||||
return packageurl.TypeRPM
|
||||
case RustPkg:
|
||||
@@ -147,8 +151,8 @@ func (t Type) PackageURLType() string {
|
||||
return packageurl.TypeSwift
|
||||
case SwiplPackPkg:
|
||||
return "swiplpack"
|
||||
case OpamPkg:
|
||||
return "opam"
|
||||
case TerraformPkg:
|
||||
return "terraform"
|
||||
case WordpressPluginPkg:
|
||||
return "wordpress-plugin"
|
||||
default:
|
||||
@@ -170,7 +174,7 @@ func TypeFromPURL(p string) Type {
|
||||
return TypeByName(ptype)
|
||||
}
|
||||
|
||||
//nolint:funlen
|
||||
//nolint:funlen,gocyclo
|
||||
func TypeByName(name string) Type {
|
||||
switch name {
|
||||
case packageurl.TypeDebian:
|
||||
@@ -221,14 +225,16 @@ func TypeByName(name string) Type {
|
||||
return LinuxKernelModulePkg
|
||||
case "nix":
|
||||
return NixPkg
|
||||
case "opam":
|
||||
return OpamPkg
|
||||
case packageurl.TypeCran:
|
||||
return Rpkg
|
||||
case packageurl.TypeSwift:
|
||||
return SwiftPkg
|
||||
case "swiplpack":
|
||||
return SwiplPackPkg
|
||||
case "opam":
|
||||
return OpamPkg
|
||||
case "terraform":
|
||||
return TerraformPkg
|
||||
case "wordpress-plugin":
|
||||
return WordpressPluginPkg
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user