Documentation
¶
Index ¶
- Constants
- func ReadFileListFindingsOutput(filename string) (inspector2.ListFindingsOutput, error)
- func ReadFileListFindingsOutputStream(filename string, fn func(f types.Finding) error) error
- func ResourceTableColumns() ([]string, map[int]string)
- type Finding
- func (f Finding) CVEID() *string
- func (f Finding) FilePaths() []string
- func (f Finding) FilePathsInclPOMProperties() bool
- func (f Finding) FindingOrVendorSeverity(canonical bool) string
- func (f Finding) FindingSeverity(canonical bool) string
- func (f Finding) ImageHashes() []string
- func (f Finding) ImageRepoNameVulnIDs(sep string) []string
- func (f Finding) ImageRepositoryNames() []string
- func (f Finding) ImageTags() []string
- func (f Finding) ToFinding(opts FindingSpecOptions) []findingspec.Finding
- func (f Finding) VendorCreatedAt() *time.Time
- func (f Finding) VendorCreatedAtAgeMonths() *float32
- func (f Finding) VendorSeverity(canonical bool) string
- func (f Finding) VulnerabilityID() string
- func (f Finding) VulnerablePackages() Packages
- func (f Finding) VulnerablePackagesIDs() []string
- func (f Finding) VulnerablePackagesX() []Package
- type FindingMerger
- type FindingSpecOptions
- type Findings
- func (fs Findings) FilterImageHashes(hashesIncl []string) Findings
- func (fs Findings) FilterImageTags(tagsIncl []string) Findings
- func (fs Findings) FilterPOMPropertiesExcl() Findings
- func (fs Findings) FindingOneRawMatch(s string) *Finding
- func (fs Findings) Findings(opts FindingSpecOptions) *findingspec.FindingSet
- func (fs Findings) ImageHashes() []string
- func (fs Findings) ImageRepoNameVulnIDs(sep string) []string
- func (fs Findings) ImageRepoNameVulnIDsMapSeverity() map[string][]string
- func (fs Findings) ImageRepositoryNames() []string
- func (fs Findings) ImageSet(hashesIncl []string) (*ImageSet, error)
- func (fs Findings) ImageSetRepoNameByTagsOrLatest(imageTagOverrides []string) (*ImageSet, error)
- func (fs Findings) MergeByImageRepoNameAndVulnID() (Findings, error)
- func (fs Findings) MergeFilteredByImageRepoNameAndVulnID() (*types.Finding, error)
- func (fs Findings) ResourceSet(inclResourceTypes []types.ResourceType) (*ResourceSet, error)
- func (fs Findings) Stats() FindingsStats
- func (fs Findings) VulnerabilityIDs() []string
- type FindingsStats
- func (stats FindingsStats) FindingVulnerablePackageCounts() map[string]int
- func (stats FindingsStats) ImagenameVulnidCounts() map[string]int
- func (stats FindingsStats) ImagenameVulnidRevCounts() map[string]int
- func (stats FindingsStats) VendorCreatedAtMonthly() map[string]int
- func (stats FindingsStats) VendorCreatedAtYearly() map[string]int
- func (stats FindingsStats) VendorSeverities(canonicalSev bool) map[string]int
- type ImageSet
- func (set *ImageSet) Add(imgs ...types.AwsEcrContainerImageDetails) error
- func (set *ImageSet) FilterHashes(hashesIncl []string) (*ImageSet, error)
- func (set *ImageSet) ImageByHash(imgHash string) *types.AwsEcrContainerImageDetails
- func (set *ImageSet) ImageByLatest() *types.AwsEcrContainerImageDetails
- func (set *ImageSet) ImageHashes() []string
- func (set *ImageSet) ImageSetsByRepoName() (*ImageSets, error)
- func (set *ImageSet) ImageTags() ([]string, map[string]int)
- func (set *ImageSet) ImagesByTag(imageTags []string) []types.AwsEcrContainerImageDetails
- func (set *ImageSet) ImagesByTagsOrLatest(imageTagOverrides []string) []types.AwsEcrContainerImageDetails
- func (set *ImageSet) RepositoryNames() ([]string, map[string]int)
- func (set *ImageSet) Table() (*table.Table, error)
- func (set *ImageSet) WriteFileJSON(filename, prefix, indent string, perm os.FileMode) error
- func (set *ImageSet) WriteFileXLSX(filename string) error
- type ImageSets
- func (sets *ImageSets) AddImagesByRepositoryName(imgs ...types.AwsEcrContainerImageDetails) error
- func (sets *ImageSets) FilterLatestByRepositoryName(imageTagOverrides []string) (*ImageSets, error)
- func (sets *ImageSets) ImageSetByRepositoryNameTagsOrLatest(repoTagOverrides []string) (*ImageSet, error)
- type Package
- func (p Package) FilepathAtVersion() string
- func (p Package) FilepathAtVersionFixed() string
- func (p Package) FilepathString() string
- func (p Package) NameAndFilepathAtVersion() string
- func (p Package) NameAndFilepathAtVersionFixed() string
- func (p Package) NameAtVersion() string
- func (p Package) NameAtVersionAtFilepath() string
- func (p Package) NameAtVersionFixed() string
- func (p Package) NameString() string
- func (p Package) PackageType() string
- func (p Package) VersionFixedString() string
- func (p Package) VersionString() string
- type Packages
- func (ps Packages) Filepaths() []string
- func (ps Packages) FilepathsAtVersion() string
- func (ps Packages) FilepathsAtVersionFixed() string
- func (ps Packages) FilepathsContainsPOMProperties() int
- func (ps Packages) NameAtVersionAtFilepaths() []string
- func (ps Packages) NamesAndFilepathsAtVersion() string
- func (ps Packages) NamesAndFilepathsAtVersionFixed() string
- func (ps Packages) PackagesManagers() []string
- func (ps Packages) PackagesTypes() string
- type Resource
- type ResourceSet
- func (rs *ResourceSet) Add(r Resource) error
- func (rs *ResourceSet) FilterImageHash(hashesIncl []string) *ResourceSet
- func (rs *ResourceSet) FilterImageTags(tagsAny []string) *ResourceSet
- func (rs *ResourceSet) FilterResourceTypes(inclResourceTypes []types.ResourceType) (*ResourceSet, error)
- func (rs *ResourceSet) ImageRepositoryNames() []string
- func (rs *ResourceSet) ImageSet(hashesIncl []string) (*ImageSet, error)
- func (rs *ResourceSet) ImageTags() []string
- func (rs *ResourceSet) Table(cols []string, fmtMap map[int]string) (*table.Table, error)
- type Resources
- type Vulnerability
Constants ¶
const ( // Resource table field-name constants. ImageHash = "image_hash" ImageRepositoryName = "image_repo_name" ImageTags = "image_tags" ResourceTypeAwsEc2Instance = types.ResourceTypeAwsEc2Instance ResourceTypeAwsEcrContainerImage = types.ResourceTypeAwsEcrContainerImage ResourceTypeAwsEcrRepository = types.ResourceTypeAwsEcrRepository ResourceTypeAwsLambdaFunction = types.ResourceTypeAwsLambdaFunction )
Variables ¶
This section is empty.
Functions ¶
func ReadFileListFindingsOutput ¶
func ReadFileListFindingsOutput(filename string) (inspector2.ListFindingsOutput, error)
func ReadFileListFindingsOutputStream ¶ added in v0.10.0
ReadFileListFindingsOutputStream streams findings from a ListFindingsOutput JSON file, invoking fn for each finding without loading the full findings array into memory.
func ResourceTableColumns ¶ added in v0.8.0
Types ¶
type Finding ¶
func (Finding) FilePathsInclPOMProperties ¶
func (Finding) FindingOrVendorSeverity ¶ added in v0.7.2
func (Finding) FindingSeverity ¶
func (Finding) ImageHashes ¶
func (Finding) ImageRepoNameVulnIDs ¶
ImageRepoNameVulnID is used as a unique key across images.
func (Finding) ImageRepositoryNames ¶
func (Finding) ToFinding ¶ added in v0.11.0
func (f Finding) ToFinding(opts FindingSpecOptions) []findingspec.Finding
ToFinding converts a single AWS Inspector2 finding into a slice of findingspec.Finding values, one per vulnerable package. Findings that are not package vulnerabilities return nil.
func (Finding) VendorCreatedAt ¶
func (Finding) VendorCreatedAtAgeMonths ¶
func (Finding) VendorSeverity ¶
func (Finding) VulnerabilityID ¶
func (Finding) VulnerablePackages ¶
func (Finding) VulnerablePackagesIDs ¶ added in v0.8.0
func (Finding) VulnerablePackagesX ¶ added in v0.8.0
type FindingMerger ¶ added in v0.8.0
func NewFindingMerger ¶ added in v0.8.0
func NewFindingMerger() FindingMerger
func (*FindingMerger) Merge ¶ added in v0.8.0
func (set *FindingMerger) Merge() (Findings, error)
type FindingSpecOptions ¶ added in v0.11.0
type FindingSpecOptions struct {
// Repo sets Location.Repo for multi-repo/workspace sweeps, optional.
Repo string
}
FindingSpecOptions configures conversion of AWS Inspector2 findings to findingspec.
type Findings ¶
func (Findings) FilterImageHashes ¶
func (Findings) FilterImageTags ¶ added in v0.8.1
func (Findings) FilterPOMPropertiesExcl ¶
func (Findings) FindingOneRawMatch ¶
func (Findings) Findings ¶ added in v0.11.0
func (fs Findings) Findings(opts FindingSpecOptions) *findingspec.FindingSet
Findings converts a list of AWS Inspector2 findings into a findingspec.FindingSet of normalized security vulnerability findings. Each vulnerable package within a finding produces its own findingspec.Finding.
func (Findings) ImageHashes ¶ added in v0.8.0
ImageHashes returns a list of unique repo names
func (Findings) ImageRepoNameVulnIDs ¶
ImageRepoNameVulnID is used as a unique key across images.
func (Findings) ImageRepoNameVulnIDsMapSeverity ¶ added in v0.8.0
ImageRepoNameVulnID is used as a unique key across images.
func (Findings) ImageRepositoryNames ¶
ImageRepositoryNames returns a list of unique repo names
func (Findings) ImageSetRepoNameByTagsOrLatest ¶ added in v0.8.0
func (Findings) MergeByImageRepoNameAndVulnID ¶ added in v0.8.0
MergeByImageRepoNameAndVulnID merges select fields including images and packages.
func (Findings) MergeFilteredByImageRepoNameAndVulnID ¶ added in v0.8.0
MergeFilteredByImageRepoNameAndVulnID merges select fields including images and packages. Image repo name and vulnid must be the same.
func (Findings) ResourceSet ¶ added in v0.8.0
func (fs Findings) ResourceSet(inclResourceTypes []types.ResourceType) (*ResourceSet, error)
func (Findings) Stats ¶
func (fs Findings) Stats() FindingsStats
func (Findings) VulnerabilityIDs ¶ added in v0.8.0
type FindingsStats ¶
type FindingsStats struct {
Findings Findings
}
func (FindingsStats) FindingVulnerablePackageCounts ¶
func (stats FindingsStats) FindingVulnerablePackageCounts() map[string]int
func (FindingsStats) ImagenameVulnidCounts ¶
func (stats FindingsStats) ImagenameVulnidCounts() map[string]int
ImageRepoNameVulnID is used as a unique key across images.
func (FindingsStats) ImagenameVulnidRevCounts ¶
func (stats FindingsStats) ImagenameVulnidRevCounts() map[string]int
func (FindingsStats) VendorCreatedAtMonthly ¶
func (stats FindingsStats) VendorCreatedAtMonthly() map[string]int
func (FindingsStats) VendorCreatedAtYearly ¶
func (stats FindingsStats) VendorCreatedAtYearly() map[string]int
func (FindingsStats) VendorSeverities ¶
func (stats FindingsStats) VendorSeverities(canonicalSev bool) map[string]int
type ImageSet ¶ added in v0.8.0
type ImageSet struct {
Data map[string]types.AwsEcrContainerImageDetails `json:"data"`
}
func NewImageSet ¶ added in v0.8.0
func NewImageSet() *ImageSet
func (*ImageSet) Add ¶ added in v0.8.0
func (set *ImageSet) Add(imgs ...types.AwsEcrContainerImageDetails) error
func (*ImageSet) FilterHashes ¶ added in v0.8.0
func (*ImageSet) ImageByHash ¶ added in v0.8.0
func (set *ImageSet) ImageByHash(imgHash string) *types.AwsEcrContainerImageDetails
func (*ImageSet) ImageByLatest ¶ added in v0.8.0
func (set *ImageSet) ImageByLatest() *types.AwsEcrContainerImageDetails
func (*ImageSet) ImageHashes ¶ added in v0.8.0
func (*ImageSet) ImageSetsByRepoName ¶ added in v0.8.0
func (*ImageSet) ImagesByTag ¶ added in v0.8.0
func (set *ImageSet) ImagesByTag(imageTags []string) []types.AwsEcrContainerImageDetails
func (*ImageSet) ImagesByTagsOrLatest ¶ added in v0.8.0
func (set *ImageSet) ImagesByTagsOrLatest(imageTagOverrides []string) []types.AwsEcrContainerImageDetails
func (*ImageSet) RepositoryNames ¶ added in v0.8.0
func (*ImageSet) WriteFileJSON ¶ added in v0.8.0
func (*ImageSet) WriteFileXLSX ¶ added in v0.8.0
type ImageSets ¶ added in v0.8.0
func NewImageSets ¶ added in v0.8.0
func NewImageSets() *ImageSets
func (*ImageSets) AddImagesByRepositoryName ¶ added in v0.8.0
func (sets *ImageSets) AddImagesByRepositoryName(imgs ...types.AwsEcrContainerImageDetails) error
func (*ImageSets) FilterLatestByRepositoryName ¶ added in v0.8.0
type Package ¶
type Package types.VulnerablePackage
func (Package) FilepathAtVersion ¶
func (Package) FilepathAtVersionFixed ¶
func (Package) FilepathString ¶
func (Package) NameAndFilepathAtVersion ¶
func (Package) NameAndFilepathAtVersionFixed ¶
func (Package) NameAtVersion ¶
func (Package) NameAtVersionAtFilepath ¶ added in v0.8.0
NameAtVersionAtFilepath can be treated as a package id.
func (Package) NameAtVersionFixed ¶
func (Package) NameString ¶
func (Package) PackageType ¶ added in v0.8.2
func (Package) VersionFixedString ¶
func (Package) VersionString ¶
type Packages ¶
type Packages []types.VulnerablePackage
func (Packages) FilepathsAtVersion ¶
func (Packages) FilepathsAtVersionFixed ¶
func (Packages) FilepathsContainsPOMProperties ¶ added in v0.8.0
func (Packages) NameAtVersionAtFilepaths ¶ added in v0.8.0
func (Packages) NamesAndFilepathsAtVersion ¶
func (Packages) NamesAndFilepathsAtVersionFixed ¶
func (Packages) PackagesManagers ¶ added in v0.8.2
func (Packages) PackagesTypes ¶ added in v0.8.2
type Resource ¶
func (Resource) HasTagsAny ¶ added in v0.8.0
func (Resource) ImageRepositoryName ¶
func (Resource) ImageTagFirst ¶
type ResourceSet ¶ added in v0.8.0
func NewResourceSet ¶ added in v0.8.0
func NewResourceSet() *ResourceSet
func (*ResourceSet) Add ¶ added in v0.8.0
func (rs *ResourceSet) Add(r Resource) error
func (*ResourceSet) FilterImageHash ¶ added in v0.8.0
func (rs *ResourceSet) FilterImageHash(hashesIncl []string) *ResourceSet
func (*ResourceSet) FilterImageTags ¶ added in v0.8.0
func (rs *ResourceSet) FilterImageTags(tagsAny []string) *ResourceSet
func (*ResourceSet) FilterResourceTypes ¶ added in v0.8.0
func (rs *ResourceSet) FilterResourceTypes(inclResourceTypes []types.ResourceType) (*ResourceSet, error)
func (*ResourceSet) ImageRepositoryNames ¶ added in v0.8.0
func (rs *ResourceSet) ImageRepositoryNames() []string
func (*ResourceSet) ImageSet ¶ added in v0.8.0
func (rs *ResourceSet) ImageSet(hashesIncl []string) (*ImageSet, error)
func (*ResourceSet) ImageTags ¶ added in v0.8.0
func (rs *ResourceSet) ImageTags() []string
type Resources ¶ added in v0.8.0
func (Resources) ImageHashes ¶ added in v0.8.0
type Vulnerability ¶
type Vulnerability types.PackageVulnerabilityDetails