containerscan

package
v0.0.499 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	//defines Relevancy as enum-like
	Unknown   = "Unknown"
	Relevant  = "Relevant"
	Irelevant = "Irelevant"
	NoSP      = "No signature profile to compare"

	//Clair Severities
	UnknownSeverity    = "Unknown"
	NegligibleSeverity = "Negligible"
	LowSeverity        = "Low"
	MediumSeverity     = "Medium"
	HighSeverity       = "High"
	CriticalSeverity   = "Critical"

	ContainerScanRedisPrefix = "_containerscan"

	UnknownScore    = 1
	NegligibleScore = 100
	LowScore        = 200
	MediumScore     = 300
	HighScore       = 400
	CriticalScore   = 500
)

Variables

View Source
var SeverityStr2Score = map[string]int{
	"Unknown":    1,
	"Negligible": 100,
	"Low":        200,
	"Medium":     300,
	"High":       400,
	"Critical":   500,
}

Functions

func CalculateFixed

func CalculateFixed(Fixes []FixedIn) int

func GenerateBogusHash

func GenerateBogusHash(context map[string]string) string

GenerateBogusHash - generate the old (bogus) hash for the workload

func GenerateContainerScanLayer

func GenerateContainerScanLayer(layer *ScanResultLayer, generateVuln func(*Vulnerability) error)

GenerateContainerScanLayer - generate a layer with random vuls

func GenerateVulnerability

func GenerateVulnerability(v *Vulnerability) error

GenerateVulnerability - generate a vul (just diff "cve"'s)

func GenerateVulnerabilityNoRCEAndFixed

func GenerateVulnerabilityNoRCEAndFixed(v *Vulnerability) error

func GenerateVulnerabilityNoRCENoFixed

func GenerateVulnerabilityNoRCENoFixed(v *Vulnerability) error

func GenerateVulnerabilityRCEAndFixed

func GenerateVulnerabilityRCEAndFixed(v *Vulnerability) error

func GenerateVulnerabilityRCENotFixed

func GenerateVulnerabilityRCENotFixed(v *Vulnerability) error

func GenerateWorkloadHash

func GenerateWorkloadHash(context map[string]string) string

GenerateWorkloadHash - generate a hash for the workload

func GetVulnLink(vulName string) string

func SeverityScoreToString added in v0.0.227

func SeverityScoreToString(score int) string

Types

type CommonContainerScanSeveritySummary

type CommonContainerScanSeveritySummary struct {
	Designators identifiers.PortalDesignator `json:"designators"`
	SeverityStats
	ImgTag          string                    `json:"imageTag"`
	ContainerName   string                    `json:"containerName"`
	CustomerGUID    string                    `json:"customerGUID"`
	ContainerScanID string                    `json:"containersScanID"`
	DayDate         string                    `json:"dayDate"`
	WLID            string                    `json:"wlid"`
	Version         string                    `json:"version"`
	ImgHash         string                    `json:"imageHash"`
	Cluster         string                    `json:"cluster"`
	Namespace       string                    `json:"namespace"`
	VersionImage    string                    `json:"versionImage"`
	Status          string                    `json:"status"`
	Registry        string                    `json:"registry"`
	JobIDs          []string                  `json:"jobIDs"`
	Context         []identifiers.ArmoContext `json:"context"`
	Timestamp       int64                     `json:"timestamp"`
}

type CommonContainerScanSummaryResult

type CommonContainerScanSummaryResult struct {
	Designators identifiers.PortalDesignator `json:"designators"`
	SeverityStats
	Version                       string                     `json:"version"`
	Registry                      string                     `json:"registry"`
	CustomerGUID                  string                     `json:"customerGUID"`
	ContainerScanID               string                     `json:"containersScanID"`
	ImageSignatureValidationError string                     `json:"imageSignatureValidationError,omitempty"`
	WLID                          string                     `json:"wlid"`
	ImageID                       string                     `json:"imageHash"`
	ImageTag                      string                     `json:"imageTag"`
	ClusterName                   string                     `json:"cluster"`
	ClusterShortName              string                     `json:"clusterShortName"`
	Namespace                     string                     `json:"namespace"`
	ApiVersion                    string                     `json:"apiVersion"`
	ContainerName                 string                     `json:"containerName"`
	ImageTagSuffix                string                     `json:"versionImage"`
	Status                        string                     `json:"status"`
	ExcludedSeveritiesStats       []SeverityStats            `json:"excludedSeveritiesStats,omitempty"`
	PackagesName                  []string                   `json:"packages"`
	SeveritiesStats               []SeverityStats            `json:"severitiesStats"`
	JobIDs                        []string                   `json:"jobIDs"`
	Vulnerabilities               []ShortVulnerabilityResult `json:"vulnerabilities"`
	Context                       []identifiers.ArmoContext  `json:"context"`
	Timestamp                     int64                      `json:"timestamp"`
	ImageSignatureValid           bool                       `json:"imageSignatureValid,omitempty"`
	ImageHasSignature             bool                       `json:"imageHasSignature,omitempty"`
	RelevantLabel                 RelevantLabel              `json:"relevantLabel"`
	HasRelevancyData              bool                       `json:"hasRelevancyData"`
	ImageManifest                 *ImageManifest             `json:"imageManifest,omitempty"`
}

func (*CommonContainerScanSummaryResult) GetApiVersion added in v0.0.294

func (summary *CommonContainerScanSummaryResult) GetApiVersion() string

func (*CommonContainerScanSummaryResult) GetClusterName

func (summary *CommonContainerScanSummaryResult) GetClusterName() string

func (*CommonContainerScanSummaryResult) GetClusterShortName

func (summary *CommonContainerScanSummaryResult) GetClusterShortName() string

func (*CommonContainerScanSummaryResult) GetContainerName

func (summary *CommonContainerScanSummaryResult) GetContainerName() string

func (*CommonContainerScanSummaryResult) GetContainerScanID

func (summary *CommonContainerScanSummaryResult) GetContainerScanID() string

func (*CommonContainerScanSummaryResult) GetContext

func (*CommonContainerScanSummaryResult) GetCustomerGUID

func (summary *CommonContainerScanSummaryResult) GetCustomerGUID() string

func (*CommonContainerScanSummaryResult) GetDesignators

func (*CommonContainerScanSummaryResult) GetHasRelevancyData

func (summary *CommonContainerScanSummaryResult) GetHasRelevancyData() bool

func (*CommonContainerScanSummaryResult) GetImageID

func (summary *CommonContainerScanSummaryResult) GetImageID() string

func (*CommonContainerScanSummaryResult) GetImageManifest added in v0.0.416

func (summary *CommonContainerScanSummaryResult) GetImageManifest() *ImageManifest

func (*CommonContainerScanSummaryResult) GetImageTag

func (summary *CommonContainerScanSummaryResult) GetImageTag() string

func (*CommonContainerScanSummaryResult) GetImageTageSuffix

func (summary *CommonContainerScanSummaryResult) GetImageTageSuffix() string

func (*CommonContainerScanSummaryResult) GetJobIDs

func (summary *CommonContainerScanSummaryResult) GetJobIDs() []string

func (*CommonContainerScanSummaryResult) GetNamespace

func (summary *CommonContainerScanSummaryResult) GetNamespace() string

func (*CommonContainerScanSummaryResult) GetRegistry

func (summary *CommonContainerScanSummaryResult) GetRegistry() string

func (*CommonContainerScanSummaryResult) GetRelevantLabel

func (summary *CommonContainerScanSummaryResult) GetRelevantLabel() RelevantLabel

func (*CommonContainerScanSummaryResult) GetRepository

func (summary *CommonContainerScanSummaryResult) GetRepository() string

func (*CommonContainerScanSummaryResult) GetSeveritiesStats

func (summary *CommonContainerScanSummaryResult) GetSeveritiesStats() []SeverityStats

func (*CommonContainerScanSummaryResult) GetSeverityStats

func (summary *CommonContainerScanSummaryResult) GetSeverityStats() SeverityStats

func (*CommonContainerScanSummaryResult) GetStatus

func (summary *CommonContainerScanSummaryResult) GetStatus() string

func (*CommonContainerScanSummaryResult) GetTimestamp

func (summary *CommonContainerScanSummaryResult) GetTimestamp() int64

func (*CommonContainerScanSummaryResult) GetVersion

func (summary *CommonContainerScanSummaryResult) GetVersion() string

func (*CommonContainerScanSummaryResult) GetWLID

func (summary *CommonContainerScanSummaryResult) GetWLID() string

func (*CommonContainerScanSummaryResult) SetApiVersion added in v0.0.294

func (summary *CommonContainerScanSummaryResult) SetApiVersion(apiVersion string)

func (*CommonContainerScanSummaryResult) SetClusterName

func (summary *CommonContainerScanSummaryResult) SetClusterName(clusterName string)

func (*CommonContainerScanSummaryResult) SetClusterShortName

func (summary *CommonContainerScanSummaryResult) SetClusterShortName(clusterShortName string)

func (*CommonContainerScanSummaryResult) SetContainerName

func (summary *CommonContainerScanSummaryResult) SetContainerName(containerName string)

func (*CommonContainerScanSummaryResult) SetContainerScanID

func (summary *CommonContainerScanSummaryResult) SetContainerScanID(containerScanID string)

func (*CommonContainerScanSummaryResult) SetContext

func (summary *CommonContainerScanSummaryResult) SetContext(context []identifiers.ArmoContext)

func (*CommonContainerScanSummaryResult) SetCustomerGUID

func (summary *CommonContainerScanSummaryResult) SetCustomerGUID(customerGUID string)

func (*CommonContainerScanSummaryResult) SetDesignators

func (summary *CommonContainerScanSummaryResult) SetDesignators(designators identifiers.PortalDesignator)

func (*CommonContainerScanSummaryResult) SetHasRelevancyData

func (summary *CommonContainerScanSummaryResult) SetHasRelevancyData(hasRelevancy bool)

func (*CommonContainerScanSummaryResult) SetImageID

func (summary *CommonContainerScanSummaryResult) SetImageID(imageID string)

func (*CommonContainerScanSummaryResult) SetImageManifest added in v0.0.416

func (summary *CommonContainerScanSummaryResult) SetImageManifest(imageManifest *ImageManifest)

func (*CommonContainerScanSummaryResult) SetImageTag

func (summary *CommonContainerScanSummaryResult) SetImageTag(imageTag string)

func (*CommonContainerScanSummaryResult) SetImageTageSuffix

func (summary *CommonContainerScanSummaryResult) SetImageTageSuffix(imageTageSuffix string)

func (*CommonContainerScanSummaryResult) SetNamespace

func (summary *CommonContainerScanSummaryResult) SetNamespace(namespace string)

func (*CommonContainerScanSummaryResult) SetRegistry

func (summary *CommonContainerScanSummaryResult) SetRegistry(registry string)

func (*CommonContainerScanSummaryResult) SetRelevantLabel

func (summary *CommonContainerScanSummaryResult) SetRelevantLabel(label RelevantLabel)

func (*CommonContainerScanSummaryResult) SetSeveritiesStats

func (summary *CommonContainerScanSummaryResult) SetSeveritiesStats(severitiesStats []SeverityStats)

func (*CommonContainerScanSummaryResult) SetSeverityStats

func (summary *CommonContainerScanSummaryResult) SetSeverityStats(severityStats SeverityStats)

func (*CommonContainerScanSummaryResult) SetStatus

func (summary *CommonContainerScanSummaryResult) SetStatus(status string)

func (*CommonContainerScanSummaryResult) SetTimestamp

func (summary *CommonContainerScanSummaryResult) SetTimestamp(timestamp int64)

func (*CommonContainerScanSummaryResult) SetVersion

func (summary *CommonContainerScanSummaryResult) SetVersion(version string)

func (*CommonContainerScanSummaryResult) SetWLID

func (summary *CommonContainerScanSummaryResult) SetWLID(wlid string)

func (*CommonContainerScanSummaryResult) Validate

func (summary *CommonContainerScanSummaryResult) Validate() bool

type CommonContainerScanSummaryResultStub

type CommonContainerScanSummaryResultStub struct {
	CommonContainerScanSummaryResult `json:",inline"`
	IsStub                           bool     `json:"isStub,omitempty"`
	ErrorsList                       []string `json:"errors,omitempty"`
}

type CommonContainerVulnerabilityResult

type CommonContainerVulnerabilityResult struct {
	Designators       identifiers.PortalDesignator `json:"designators"`
	IntroducedInLayer string                       `json:"layerHash"`
	WLID              string                       `json:"wlid"`
	ContainerScanID   string                       `json:"containersScanID"`
	Vulnerability     `json:",inline"`
	Layers            []ESLayer                                `json:"layers"`
	LayersNested      []ESLayer                                `json:"layersNested"`
	Context           []identifiers.ArmoContext                `json:"context"`
	RelevantLinks     []string                                 `json:"links"`
	RelatedExceptions []armotypes.VulnerabilityExceptionPolicy `json:"relatedExceptions,omitempty"`
	Timestamp         int64                                    `json:"timestamp"`
	IsLastScan        int                                      `json:"isLastScan"`
	IsFixed           int                                      `json:"isFixed"`
	RelevantLabel     RelevantLabel                            `json:"relevantLabel"`
	ClusterShortName  string                                   `json:"clusterShortName"`
}

func (*CommonContainerVulnerabilityResult) GetClusterShortName

func (c *CommonContainerVulnerabilityResult) GetClusterShortName() string

func (*CommonContainerVulnerabilityResult) GetContainerScanID

func (c *CommonContainerVulnerabilityResult) GetContainerScanID() string

func (*CommonContainerVulnerabilityResult) GetContext

func (*CommonContainerVulnerabilityResult) GetDesignators

func (*CommonContainerVulnerabilityResult) GetIntroducedInLayer

func (c *CommonContainerVulnerabilityResult) GetIntroducedInLayer() string

func (*CommonContainerVulnerabilityResult) GetIsFixed

func (c *CommonContainerVulnerabilityResult) GetIsFixed() int

func (*CommonContainerVulnerabilityResult) GetIsLastScan

func (c *CommonContainerVulnerabilityResult) GetIsLastScan() int

func (*CommonContainerVulnerabilityResult) GetLayers

func (*CommonContainerVulnerabilityResult) GetLayersNested

func (c *CommonContainerVulnerabilityResult) GetLayersNested() []ESLayer

func (*CommonContainerVulnerabilityResult) GetRelatedExceptions

func (*CommonContainerVulnerabilityResult) GetRelevantLabel

func (c *CommonContainerVulnerabilityResult) GetRelevantLabel() RelevantLabel
func (c *CommonContainerVulnerabilityResult) GetRelevantLinks() []string

func (*CommonContainerVulnerabilityResult) GetTimestamp

func (c *CommonContainerVulnerabilityResult) GetTimestamp() int64

func (*CommonContainerVulnerabilityResult) GetVulnerability

func (*CommonContainerVulnerabilityResult) GetWLID

func (*CommonContainerVulnerabilityResult) SetClusterShortName

func (c *CommonContainerVulnerabilityResult) SetClusterShortName(clusterShortName string)

func (*CommonContainerVulnerabilityResult) SetContainerScanID

func (c *CommonContainerVulnerabilityResult) SetContainerScanID(containerScanID string)

func (*CommonContainerVulnerabilityResult) SetContext

func (*CommonContainerVulnerabilityResult) SetDesignators

func (c *CommonContainerVulnerabilityResult) SetDesignators(designators identifiers.PortalDesignator)

func (*CommonContainerVulnerabilityResult) SetIntroducedInLayer

func (c *CommonContainerVulnerabilityResult) SetIntroducedInLayer(introducedInLayer string)

func (*CommonContainerVulnerabilityResult) SetIsFixed

func (c *CommonContainerVulnerabilityResult) SetIsFixed(isFixed int)

func (*CommonContainerVulnerabilityResult) SetIsLastScan

func (c *CommonContainerVulnerabilityResult) SetIsLastScan(isLastScan int)

func (*CommonContainerVulnerabilityResult) SetLayers

func (c *CommonContainerVulnerabilityResult) SetLayers(layers []ESLayer)

func (*CommonContainerVulnerabilityResult) SetLayersNested

func (c *CommonContainerVulnerabilityResult) SetLayersNested(layersNested []ESLayer)
func (c *CommonContainerVulnerabilityResult) SetLink(link string)

func (*CommonContainerVulnerabilityResult) SetRelatedExceptions

func (c *CommonContainerVulnerabilityResult) SetRelatedExceptions(relatedExceptions []armotypes.VulnerabilityExceptionPolicy)

func (*CommonContainerVulnerabilityResult) SetRelevantLabel

func (c *CommonContainerVulnerabilityResult) SetRelevantLabel(relevantLabel RelevantLabel)
func (c *CommonContainerVulnerabilityResult) SetRelevantLinks(relevantLinks []string)

func (*CommonContainerVulnerabilityResult) SetTimestamp

func (c *CommonContainerVulnerabilityResult) SetTimestamp(timestamp int64)

func (*CommonContainerVulnerabilityResult) SetWLID

func (c *CommonContainerVulnerabilityResult) SetWLID(wlid string)

type ContainerScanSummaryResult

type ContainerScanSummaryResult interface {
	GetDesignators() identifiers.PortalDesignator
	GetContext() []identifiers.ArmoContext
	GetWLID() string
	GetImageTag() string
	GetImageID() string
	GetSeverityStats() SeverityStats
	GetSeveritiesStats() []SeverityStats
	GetClusterName() string
	GetClusterShortName() string
	GetNamespace() string
	GetApiVersion() string
	GetContainerName() string
	GetStatus() string
	GetRegistry() string
	GetRepository() string
	GetImageTageSuffix() string
	GetVersion() string
	GetCustomerGUID() string
	GetContainerScanID() string
	GetTimestamp() int64
	GetJobIDs() []string
	GetRelevantLabel() RelevantLabel
	Validate() bool
	GetHasRelevancyData() bool
	GetImageManifest() *ImageManifest

	SetDesignators(identifiers.PortalDesignator)
	SetContext([]identifiers.ArmoContext)
	SetWLID(string)
	SetImageTag(string)
	SetImageID(string)
	SetSeverityStats(SeverityStats)
	SetSeveritiesStats([]SeverityStats)
	SetClusterName(string)
	SetClusterShortName(string)
	SetNamespace(string)
	SetContainerName(string)
	SetStatus(string)
	SetRegistry(string)
	SetImageTageSuffix(string)
	SetVersion(string)
	SetCustomerGUID(string)
	SetContainerScanID(string)
	SetTimestamp(int64)
	SetRelevantLabel(RelevantLabel)
	SetHasRelevancyData(bool)
	SetImageManifest(*ImageManifest)
}

func NewContainerScanSummaryResult

func NewContainerScanSummaryResult() ContainerScanSummaryResult

type ContainerScanVulnerabilityResult

type ContainerScanVulnerabilityResult interface {
	GetDesignators() identifiers.PortalDesignator
	GetContext() []identifiers.ArmoContext
	GetWLID() string
	GetContainerScanID() string
	GetLayers() []ESLayer
	GetLayersNested() []ESLayer
	GetTimestamp() int64
	GetIsLastScan() int
	GetIsFixed() int
	GetIntroducedInLayer() string
	GetRelevantLinks() []string
	GetRelatedExceptions() []armotypes.VulnerabilityExceptionPolicy
	GetVulnerability() VulnerabilityResult
	GetRelevantLabel() RelevantLabel
	GetClusterShortName() string

	SetDesignators(designators identifiers.PortalDesignator)
	SetContext(context []identifiers.ArmoContext)
	SetWLID(wlid string)
	SetContainerScanID(containerScanID string)
	SetLayers(layers []ESLayer)
	SetLayersNested(layersNested []ESLayer)
	SetTimestamp(timestamp int64)
	SetIsLastScan(isLastScan int)
	SetIsFixed(isFixed int)
	SetIntroducedInLayer(introducedInLayer string)
	SetLink(link string)
	SetRelevantLinks(relevantLinks []string)
	SetRelatedExceptions(relatedExceptions []armotypes.VulnerabilityExceptionPolicy)
	SetRelevantLabel(relevantLabel RelevantLabel)
	SetClusterShortName(clusterShortName string)
}

func NewCommonContainerVulnerabilityResult

func NewCommonContainerVulnerabilityResult() ContainerScanVulnerabilityResult

type ContainerSummmaryTimeValueCordindate added in v0.0.238

type ContainerSummmaryTimeValueCordindate struct {
	TimeValueCordindate `json:",inline"`
	ImageTag            string `json:"imageTag"`
	ImageHash           string `json:"imageHash"`
}

type Coordinates added in v0.0.294

type Coordinates struct {
	RealPath     string `json:"path"`
	FileSystemID string `json:"layerID,omitempty"`
}

type DesignatorsToVulnerabilityNames added in v0.0.238

type DesignatorsToVulnerabilityNames struct {
	Designators        identifiers.PortalDesignator `json:"designators"`
	VulnerabilityNames []string                     `json:"vulnerabilityNames"`
}

type ESLayer

type ESLayer struct {
	LayerHash       string `json:"layerHash"`
	ParentLayerHash string `json:"parentLayerHash"`
	*LayerInfo
}

type FixedIn

type FixedIn struct {
	Name    string `json:"name"`
	ImgTag  string `json:"imageTag"`
	Version string `json:"version"`
}

FixedIn when and which pkg was fixed (which version as well)

func (*FixedIn) NKeys

func (file *FixedIn) NKeys() int

func (*FixedIn) UnmarshalJSONObject

func (fx *FixedIn) UnmarshalJSONObject(dec *gojay.Decoder, key string) (err error)

--------Vul fixed in----------------------------------

type ImageManifest added in v0.0.415

type ImageManifest struct {
	Architecture string    `json:"architecture"`
	OS           string    `json:"os"`
	Size         int64     `json:"size"`
	Layers       []ESLayer `json:"layers"`
}

type LayerInfo

type LayerInfo struct {
	CreatedBy   string     `json:"createdBy,omitempty"`
	CreatedTime *time.Time `json:"createdTime,omitempty"`
	LayerOrder  int        `json:"layerOrder,omitempty"` // order 0 is first layer in the list
	Size        int64      `json:"size,omitempty"`
}

type LayersList

type LayersList []ScanResultLayer

VulnerabilitiesList -s.e

func (*LayersList) UnmarshalJSONArray

func (t *LayersList) UnmarshalJSONArray(dec *gojay.Decoder) error

type LinuxPackage

type LinuxPackage struct {
	PackageName    string   `json:"packageName"`
	Files          PkgFiles `json:"files"`
	PackageVersion string   `json:"version"`
}

LinuxPackage- Linux package representation

func (*LinuxPackage) NKeys

func (file *LinuxPackage) NKeys() int

func (*LinuxPackage) UnmarshalJSONObject

func (pkgnx *LinuxPackage) UnmarshalJSONObject(dec *gojay.Decoder, key string) (err error)

UnmarshalJSONObject--- Package

type LinuxPkgs

type LinuxPkgs []LinuxPackage

LinuxPkgs - slice of linux pkgs

func (*LinuxPkgs) UnmarshalJSONArray

func (pkgs *LinuxPkgs) UnmarshalJSONArray(dec *gojay.Decoder) error

type PackageFile

type PackageFile struct {
	Filename string `json:"name"`
}

PackageFile - s.e

func (*PackageFile) NKeys

func (file *PackageFile) NKeys() int

func (*PackageFile) UnmarshalJSONObject

func (file *PackageFile) UnmarshalJSONObject(dec *gojay.Decoder, key string) (err error)

UnmarshalJSONObject - File inside a pkg

type PkgFiles

type PkgFiles []PackageFile

PkgFiles - slice of files belong to specific pkg

func (*PkgFiles) UnmarshalJSONArray

func (files *PkgFiles) UnmarshalJSONArray(dec *gojay.Decoder) error

type RelevantLabel

type RelevantLabel string
const RelevantLabelNo RelevantLabel = "no"
const RelevantLabelNotExists RelevantLabel = ""
const RelevantLabelYes RelevantLabel = "yes"

type ScanReport

type ScanReport interface {
	IsLastReport() bool
	GetDesignators() identifiers.PortalDesignator
	GetContainerScanID() string
	GetTimestamp() int64
	GetWorkloadHash() string
	GetCustomerGUID() string
	GetSummary() ContainerScanSummaryResult
	GetVulnerabilities() []ContainerScanVulnerabilityResult
	GetVersion() string
	GetPaginationInfo() apis.PaginationMarks
	Validate() bool

	SetDesignators(identifiers.PortalDesignator)
	SetContainerScanID(string)
	SetTimestamp(int64)
	SetWorkloadHash(string)
	SetCustomerGUID(string)
}

type ScanResultLayer

type ScanResultLayer struct {
	LayerHash       string              `json:"layerHash"`
	ParentLayerHash string              `json:"parentLayerHash"`
	Vulnerabilities VulnerabilitiesList `json:"vulnerabilities"`
	Packages        LinuxPkgs           `json:"packageToFile"`
}

ScanResultLayer - represents a single layer from container scan result

func (*ScanResultLayer) GetFilesByPackage

func (layer *ScanResultLayer) GetFilesByPackage(pkgname string) (files *PkgFiles)

func (*ScanResultLayer) GetPackagesNames

func (layer *ScanResultLayer) GetPackagesNames() []string

func (*ScanResultLayer) NKeys

func (scan *ScanResultLayer) NKeys() int

func (*ScanResultLayer) UnmarshalJSONObject

func (scan *ScanResultLayer) UnmarshalJSONObject(dec *gojay.Decoder, key string) (err error)

type ScanResultReport

type ScanResultReport struct {
	Designators              identifiers.PortalDesignator `json:"designators"`
	CustomerGUID             string                       `json:"customerGUID"`
	ImgTag                   string                       `json:"imageTag"`
	ImgHash                  string                       `json:"imageHash"`
	WLID                     string                       `json:"wlid"`
	ContainerName            string                       `json:"containerName"`
	Timestamp                int64                        `json:"timestamp"`
	Layers                   LayersList                   `json:"layers"`
	ListOfDangerousArtifcats []string                     `json:"listOfDangerousArtifcats"`
	Session                  apis.SessionChain            `json:"session,omitempty"`

	ImageSignatureValid           bool   `json:"imageSignatureValid,omitempty"`
	ImageHasSignature             bool   `json:"imageHasSignature,omitempty"`
	ImageSignatureValidationError string `json:"imageSignatureValidationError,omitempty"`
}

ScanResultReport - the report given from scanner to event receiver TODO: remove

func GenerateContainerScanReportMock

func GenerateContainerScanReportMock(vulnGenerator func(*Vulnerability) error) ScanResultReport

GenerateContainerScanReportMock - generate a scan result

func GenerateContainerScanReportNoVulMock

func GenerateContainerScanReportNoVulMock() ScanResultReport

GenerateContainerScanReportMock - generate a scan result

func (*ScanResultReport) AsFNVHash

func (v *ScanResultReport) AsFNVHash() string

func (*ScanResultReport) GetDesignatorsNContext

func (scanresult *ScanResultReport) GetDesignatorsNContext() (*identifiers.PortalDesignator, []identifiers.ArmoContext)

func (*ScanResultReport) NKeys

func (scan *ScanResultReport) NKeys() int

func (*ScanResultReport) Summarize

func (scanresult *ScanResultReport) Summarize() *CommonContainerScanSummaryResult

func (*ScanResultReport) ToFlatVulnerabilities

func (scanresult *ScanResultReport) ToFlatVulnerabilities() []ContainerScanVulnerabilityResult

ToFlatVulnerabilities - returnsgit p

func (*ScanResultReport) UnmarshalJSONObject

func (scan *ScanResultReport) UnmarshalJSONObject(dec *gojay.Decoder, key string) (err error)

func (*ScanResultReport) Validate

func (scanresult *ScanResultReport) Validate() bool

type SeverityStats

type SeverityStats struct {
	Severity                 string `json:"severity,omitempty"`
	HealthStatus             string `json:"healthStatus"`
	TotalCount               int64  `json:"total"`
	RCEFixCount              int64  `json:"rceFixCount"`
	RelevantFixCount         int64  `json:"relevantFixCount"`
	FixAvailableOfTotalCount int64  `json:"fixedTotal"`
	RelevantCount            int64  `json:"relevantTotal"`
	RCECount                 int64  `json:"rceTotal"`
	UrgentCount              int64  `json:"urgent"`
	NeglectedCount           int64  `json:"neglected"`
	RelevancyScanCount       int64  `json:"relevancyScanCount"`
}

type SeverityTimeValue added in v0.0.238

type SeverityTimeValue struct {
	Cords    []ContainerSummmaryTimeValueCordindate `json:"cords"`
	Severity string                                 `json:"severity"`
}

type ShortVulnerabilityResult

type ShortVulnerabilityResult struct {
	Name string `json:"name"`
}

type TimeValueCordindate added in v0.0.238

type TimeValueCordindate struct {
	Value                interface{} `json:"value"`
	Timestamp            time.Time   `json:"timestamp"`
	VulnerabilitiesKinds int64       `json:"vulnerabilitiesKinds"`
}

type TopVulItem

type TopVulItem struct {
	Vulnerability   `json:",inline"`
	WorkloadsCount  int64 `json:"workloadsCount"`
	SeverityOverall int64 `json:"severityOverall"`
}

type VulFixes

type VulFixes []FixedIn

VulFixes - information bout when/how this vul was fixed

func (*VulFixes) UnmarshalJSONArray

func (t *VulFixes) UnmarshalJSONArray(dec *gojay.Decoder) error

type VulnerabilitiesList

type VulnerabilitiesList []Vulnerability

VulnerabilitiesList -s.e

func (*VulnerabilitiesList) UnmarshalJSONArray

func (t *VulnerabilitiesList) UnmarshalJSONArray(dec *gojay.Decoder) error

type Vulnerability

type Vulnerability struct {
	IsRelevant         *bool                                    `json:"isRelevant,omitempty"`
	HealthStatus       string                                   `json:"healthStatus"`
	ImageID            string                                   `json:"imageHash"`
	ImageTag           string                                   `json:"imageTag"`
	RelatedPackageName string                                   `json:"packageName"`
	PackageType        string                                   `json:"packageType"`
	PackageVersion     string                                   `json:"packageVersion"`
	Link               string                                   `json:"link"`
	Description        string                                   `json:"description"`
	Severity           string                                   `json:"severity"`
	Name               string                                   `json:"name"`
	Fixes              VulFixes                                 `json:"fixedIn"`
	ExceptionApplied   []armotypes.VulnerabilityExceptionPolicy `json:"exceptionApplied,omitempty"`
	SeverityScore      int                                      `json:"severityScore"`
	NeglectedCount     int                                      `json:"neglected"`
	UrgentCount        int                                      `json:"urgent"`
	Categories         VulnerabilityCategory                    `json:"categories"`
	Coordinates        []Coordinates                            `json:"coordinates,omitempty"`
}

Vulnerability - a vul object

func (*Vulnerability) GetCategories

func (v *Vulnerability) GetCategories() VulnerabilityCategory

func (*Vulnerability) GetCoordinates added in v0.0.294

func (v *Vulnerability) GetCoordinates() []Coordinates

func (*Vulnerability) GetDescription

func (v *Vulnerability) GetDescription() string

func (*Vulnerability) GetExceptionApplied

func (v *Vulnerability) GetExceptionApplied() []armotypes.VulnerabilityExceptionPolicy

func (*Vulnerability) GetFixes

func (v *Vulnerability) GetFixes() VulFixes

func (*Vulnerability) GetHealthStatus

func (v *Vulnerability) GetHealthStatus() string

func (*Vulnerability) GetImageID

func (v *Vulnerability) GetImageID() string

func (*Vulnerability) GetImageTag

func (v *Vulnerability) GetImageTag() string

func (*Vulnerability) GetIsRelevant

func (v *Vulnerability) GetIsRelevant() *bool
func (v *Vulnerability) GetLink() string

func (*Vulnerability) GetName

func (v *Vulnerability) GetName() string

func (*Vulnerability) GetNeglectedCount

func (v *Vulnerability) GetNeglectedCount() int

func (*Vulnerability) GetPackageType added in v0.0.294

func (v *Vulnerability) GetPackageType() string

func (*Vulnerability) GetPackageVersion

func (v *Vulnerability) GetPackageVersion() string

func (*Vulnerability) GetRelatedPackageName

func (v *Vulnerability) GetRelatedPackageName() string

func (*Vulnerability) GetSeverity

func (v *Vulnerability) GetSeverity() string

func (*Vulnerability) GetSeverityScore

func (v *Vulnerability) GetSeverityScore() int

func (*Vulnerability) GetUrgentCount

func (v *Vulnerability) GetUrgentCount() int

func (*Vulnerability) IsRCE

func (v *Vulnerability) IsRCE() bool

func (*Vulnerability) NKeys

func (v *Vulnerability) NKeys() int

func (*Vulnerability) SetCategories

func (v *Vulnerability) SetCategories(categories VulnerabilityCategory)

func (*Vulnerability) SetCoordinates added in v0.0.294

func (v *Vulnerability) SetCoordinates(coordinates []Coordinates)

func (*Vulnerability) SetDescription

func (v *Vulnerability) SetDescription(description string)

func (*Vulnerability) SetExceptionApplied

func (v *Vulnerability) SetExceptionApplied(exceptionApplied []armotypes.VulnerabilityExceptionPolicy)

func (*Vulnerability) SetFixes

func (v *Vulnerability) SetFixes(fixes VulFixes)

func (*Vulnerability) SetHealthStatus

func (v *Vulnerability) SetHealthStatus(healthStatus string)

func (*Vulnerability) SetImageID

func (v *Vulnerability) SetImageID(ImageID string)

func (*Vulnerability) SetImageTag

func (v *Vulnerability) SetImageTag(ImageTag string)

func (*Vulnerability) SetIsRelevant

func (v *Vulnerability) SetIsRelevant(isRelevant *bool)
func (v *Vulnerability) SetLink(link string)

func (*Vulnerability) SetName

func (v *Vulnerability) SetName(name string)

func (*Vulnerability) SetNeglectedCount

func (v *Vulnerability) SetNeglectedCount(neglectedCount int)

func (*Vulnerability) SetPackageType added in v0.0.294

func (v *Vulnerability) SetPackageType(packageType string)

func (*Vulnerability) SetPackageVersion

func (v *Vulnerability) SetPackageVersion(packageVersion string)

func (*Vulnerability) SetRelatedPackageName

func (v *Vulnerability) SetRelatedPackageName(relatedPackageName string)

func (*Vulnerability) SetSeverity

func (v *Vulnerability) SetSeverity(severity string)

func (*Vulnerability) SetSeverityScore

func (v *Vulnerability) SetSeverityScore(severityScore int)

func (*Vulnerability) SetUrgentCount

func (v *Vulnerability) SetUrgentCount(urgentCount int)

func (*Vulnerability) ToShortVulnerabilityResult

func (longVul *Vulnerability) ToShortVulnerabilityResult() *ShortVulnerabilityResult

func (*Vulnerability) UnmarshalJSONObject

func (v *Vulnerability) UnmarshalJSONObject(dec *gojay.Decoder, key string) (err error)

type VulnerabilityCategory

type VulnerabilityCategory struct {
	IsRCE bool `json:"isRce"`
}

type VulnerabilityResult

type VulnerabilityResult interface {
	GetName() string
	GetImageID() string
	GetImageTag() string
	GetRelatedPackageName() string
	GetPackageType() string
	GetPackageVersion() string
	GetLink() string
	GetDescription() string
	GetSeverity() string
	GetSeverityScore() int
	GetFixes() VulFixes
	GetIsRelevant() *bool
	GetUrgentCount() int
	GetNeglectedCount() int
	GetHealthStatus() string
	GetCategories() VulnerabilityCategory
	GetExceptionApplied() []armotypes.VulnerabilityExceptionPolicy
	GetCoordinates() []Coordinates

	SetName(string)
	SetImageID(string)
	SetImageTag(string)
	SetRelatedPackageName(string)
	SetPackageType(string)
	SetPackageVersion(string)
	SetLink(string)
	SetDescription(string)
	SetSeverity(string)
	SetSeverityScore(int)
	SetFixes(VulFixes)
	SetIsRelevant(*bool)
	SetUrgentCount(int)
	SetNeglectedCount(int)
	SetHealthStatus(string)
	SetCategories(VulnerabilityCategory)
	SetExceptionApplied([]armotypes.VulnerabilityExceptionPolicy)
	SetCoordinates([]Coordinates)
}

func NewVulnerability

func NewVulnerability() VulnerabilityResult

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL