mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
support msrc types
Signed-off-by: Alfredo Deza <adeza@anchore.com>
This commit is contained in:
parent
032cecbe7f
commit
5af2687022
@ -18,6 +18,7 @@ const (
|
|||||||
ArchLinux Type = "archlinux"
|
ArchLinux Type = "archlinux"
|
||||||
OpenSuseLeap Type = "opensuseleap"
|
OpenSuseLeap Type = "opensuseleap"
|
||||||
Photon Type = "photon"
|
Photon Type = "photon"
|
||||||
|
Windows Type = "windows"
|
||||||
)
|
)
|
||||||
|
|
||||||
// All contains all Linux distribution options
|
// All contains all Linux distribution options
|
||||||
@ -34,6 +35,7 @@ var All = []Type{
|
|||||||
ArchLinux,
|
ArchLinux,
|
||||||
OpenSuseLeap,
|
OpenSuseLeap,
|
||||||
Photon,
|
Photon,
|
||||||
|
Windows,
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDMapping connects a distro ID like "ubuntu" to a Distro type
|
// IDMapping connects a distro ID like "ubuntu" to a Distro type
|
||||||
@ -50,6 +52,7 @@ var IDMapping = map[string]Type{
|
|||||||
"arch": ArchLinux,
|
"arch": ArchLinux,
|
||||||
"opensuse-leap": OpenSuseLeap,
|
"opensuse-leap": OpenSuseLeap,
|
||||||
"photon": Photon,
|
"photon": Photon,
|
||||||
|
"windows": Windows,
|
||||||
}
|
}
|
||||||
|
|
||||||
// String returns the string representation of the given Linux distribution.
|
// String returns the string representation of the given Linux distribution.
|
||||||
|
|||||||
11
syft/pkg/kb_package_metadata.go
Normal file
11
syft/pkg/kb_package_metadata.go
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
package pkg
|
||||||
|
|
||||||
|
// KbPackageMetadata is slightly odd in how it is expected to map onto data.
|
||||||
|
// This is critical to grasp because there is no MSRC cataloger. The `ProductID`
|
||||||
|
// field is expected to be the MSRC Product ID, for example:
|
||||||
|
// "Windows 10 Version 1703 for 32-bit Systems".
|
||||||
|
// `Kb` is expected to be the actual KB number, for example "5001028"
|
||||||
|
type KbPackageMetadata struct {
|
||||||
|
ProductID string `toml:"product_id" json:"product_id"`
|
||||||
|
Kb string `toml:"kb" json:"kb"`
|
||||||
|
}
|
||||||
@ -14,4 +14,5 @@ const (
|
|||||||
RpmdbMetadataType MetadataType = "RpmdbMetadata"
|
RpmdbMetadataType MetadataType = "RpmdbMetadata"
|
||||||
PythonPackageMetadataType MetadataType = "PythonPackageMetadata"
|
PythonPackageMetadataType MetadataType = "PythonPackageMetadata"
|
||||||
RustCargoPackageMetadataType MetadataType = "RustCargoPackageMetadata"
|
RustCargoPackageMetadataType MetadataType = "RustCargoPackageMetadata"
|
||||||
|
KbPackageMetadataType MetadataType = "KbPackageMetadata"
|
||||||
)
|
)
|
||||||
|
|||||||
@ -18,6 +18,7 @@ const (
|
|||||||
JenkinsPluginPkg Type = "jenkins-plugin"
|
JenkinsPluginPkg Type = "jenkins-plugin"
|
||||||
GoModulePkg Type = "go-module"
|
GoModulePkg Type = "go-module"
|
||||||
RustPkg Type = "rust-crate"
|
RustPkg Type = "rust-crate"
|
||||||
|
KbPkg Type = "msrc-kb"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AllPkgs represents all supported package types
|
// AllPkgs represents all supported package types
|
||||||
@ -32,6 +33,7 @@ var AllPkgs = []Type{
|
|||||||
JenkinsPluginPkg,
|
JenkinsPluginPkg,
|
||||||
GoModulePkg,
|
GoModulePkg,
|
||||||
RustPkg,
|
RustPkg,
|
||||||
|
KbPkg,
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackageURLType returns the PURL package type for the current package.
|
// PackageURLType returns the PURL package type for the current package.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user