Documentation ¶
Index ¶
- Constants
- Variables
- type About
- type AboutFramework
- type AboutService
- type Analysis
- type AnalysisComment
- type AnalysisRequest
- type AnalysisService
- type BOMService
- type BOMUploadRequest
- type Client
- type Component
- type ComponentService
- type Finding
- type FindingAttribution
- type FindingService
- type License
- type LicenseGroup
- type LicenseGroupService
- type LicenseService
- type PolicyViolation
- type PolicyViolationAnalysis
- type PolicyViolationAnalysisComment
- type PolicyViolationAnalysisRequest
- type PolicyViolationAnalysisService
- type PolicyViolationService
- type Project
- type ProjectCloneRequest
- type ProjectMetrics
- type ProjectMetricsService
- type ProjectProperty
- type ProjectService
- type ProjectTag
- type RepositoryMetaComponent
- type RepositoryService
- type Vulnerability
- type VulnerabilityService
- type VulnerabilitySource
Constants ¶
View Source
const ( PolicyViolationLicense = "LICENSE" PolicyViolationOperational = "OPERATIONAL" PolicyViolationSecurity = "SECURITY" )
View Source
const ( SeverityCritical = "CRITICAL" SeverityHigh = "HIGH" SeverityMedium = "MEDIUM" SeverityLow = "LOW" SeverityInfo = "INFO" SeverityUnassigned = "UNASSIGNED" )
Variables ¶
View Source
var ( ErrConflict = errors.New("conflict") ErrForbidden = errors.New("forbidden") ErrNotFound = errors.New("not found") ErrInternalServerError = errors.New("internal server error") ErrInvalidResponseType = errors.New("invalid response type") ErrMissingTotalCountHeader = errors.New("response does not contain " + headerTotalCount + " header") )
Functions ¶
This section is empty.
Types ¶
type AboutFramework ¶
type Analysis ¶
type Analysis struct { Comments []AnalysisComment `json:"comments"` State string `json:"state"` Suppressed bool `json:"isSuppressed"` }
type AnalysisComment ¶
type AnalysisRequest ¶
type AnalysisService ¶
type BOMService ¶
type BOMUploadRequest ¶
type Client ¶
type Client struct { About AboutService Analysis AnalysisService BOM BOMService Component ComponentService Finding FindingService License LicenseService LicenseGroup LicenseGroupService PolicyViolation PolicyViolationService PolicyViolationAnalysis PolicyViolationAnalysisService Project ProjectService ProjectMetrics ProjectMetricsService Repository RepositoryService Vulnerability VulnerabilityService // contains filtered or unexported fields }
func (Client) GuessVulnerabilitySource ¶
func (c Client) GuessVulnerabilitySource(vulnID string) VulnerabilitySource
FIXME: Move this to internal package
type Component ¶
type Component struct { Author string `json:"author"` Blake2b_256 string `json:"blake2b_256"` Blake2b_384 string `json:"blake2b_384"` Blake2b_512 string `json:"blake2b_512"` Blake3 string `json:"blake3"` Classifier string `json:"classifier"` Copyright string `json:"copyright"` CPE string `json:"cpe"` Extension string `json:"extension"` Filename string `json:"filename"` Group string `json:"group"` Internal bool `json:"isInternal"` License string `json:"license"` MD5 string `json:"md5"` Name string `json:"name"` PackageURL string `json:"purl"` Publisher string `json:"publisher"` ResolvedLicense License `json:"resolvedLicense"` SHA1 string `json:"sha1"` SHA256 string `json:"sha256"` SHA384 string `json:"sha384"` SHA512 string `json:"sha512"` SHA3_256 string `json:"sha3_256"` SHA3_384 string `json:"sha3_384"` SHA3_512 string `json:"sha3_512"` SWIDTagID string `json:"swidTagId"` UUID string `json:"uuid"` Version string `json:"version"` }
type ComponentService ¶
type Finding ¶
type Finding struct { Attribution *FindingAttribution `json:"attribution"` Analysis *Analysis `json:"analysis"` Component Component `json:"component"` Matrix string `json:"matrix"` Vulnerability Vulnerability `json:"vulnerability"` }
type FindingAttribution ¶
type FindingService ¶
type License ¶
type License struct { Comment string `json:"comment"` DeprecatedLicenseID bool `json:"deprecatedLicenseId"` FSFLibre bool `json:"fsfLibre"` Groups []LicenseGroup `json:"licenseGroups"` Header string `json:"header"` LicenseID string `json:"licenseId"` Name string `json:"name"` OSIApproved bool `json:"isOsiApproved"` SeeAlso []string `json:"seeAlso"` Text string `json:"licenseText"` UUID string `json:"uuid"` }
type LicenseGroup ¶
type LicenseGroupService ¶
type LicenseGroupService interface {
GetAll(ctx context.Context) ([]LicenseGroup, error)
}
type LicenseService ¶
type PolicyViolation ¶
type PolicyViolationAnalysis ¶
type PolicyViolationAnalysis struct { Comments []PolicyViolationAnalysisComment `json:"analysisComments"` State string `json:"analysisState"` Suppressed bool `json:"isSuppressed"` }
type PolicyViolationAnalysisService ¶
type PolicyViolationAnalysisService interface { Create(ctx context.Context, req PolicyViolationAnalysisRequest) (*PolicyViolationAnalysis, error) Get(ctx context.Context, componentUUID, violationUUID string) (*PolicyViolationAnalysis, error) }
type PolicyViolationService ¶
type PolicyViolationService interface { GetForComponent(ctx context.Context, componentUUID string) ([]PolicyViolation, error) GetForProject(ctx context.Context, projectUUID string) ([]PolicyViolation, error) }
type Project ¶
type Project struct { Author string `json:"author"` Classifier string `json:"classifier"` CPE string `json:"cpe"` Description string `json:"description"` Group string `json:"group"` LastBOMImport int64 `json:"lastBomImport"` LastBOMImportFormat string `json:"lastBomImportFormat"` LastInheritedRiskScore float32 `json:"lastInheritedRiskScore"` Metrics *ProjectMetrics `json:"metrics"` Name string `json:"name"` PackageURL string `json:"purl"` Properties []ProjectProperty `json:"properties"` Publisher string `json:"publisher"` SWIDTagID string `json:"swidTagId"` Tags []ProjectTag `json:"tags"` UUID string `json:"uuid"` Version string `json:"version"` }
type ProjectCloneRequest ¶
type ProjectCloneRequest struct { ProjectUUID string `json:"project"` Version string `json:"version"` IncludeAuditHistory bool `json:"includeAuditHistory"` IncludeComponents bool `json:"includeComponents"` IncludeProperties bool `json:"includeProperties"` IncludeServices bool `json:"includeServices"` IncludeTags bool `json:"includeTags"` }
type ProjectMetrics ¶
type ProjectMetrics struct { Components int `json:"components"` Critical int `json:"critical"` FindingsAudited int `json:"findingsAudited"` FindingsTotal int `json:"findingsTotal"` FindingsUnaudited int `json:"findingsUnaudited"` High int `json:"high"` InheritedRiskScore float32 `json:"inheritedRiskScore"` Low int `json:"low"` Medium int `json:"medium"` PolicyViolationsFail int `json:"policyViolationsFail"` PolicyViolationsInfo int `json:"policyViolationsInfo"` PolicyViolationsLicenseTotal int `json:"policyViolationsLicenseTotal"` PolicyViolationsOperationalTotal int `json:"policyViolationsOperationalTotal"` PolicyViolationsSecurityTotal int `json:"policyViolationsSecurityTotal"` PolicyViolationsTotal int `json:"policyViolationsTotal"` PolicyViolationsWarn int `json:"policyViolationsWarn"` Suppressed int `json:"suppressed"` Unassigned int `json:"unassigned"` VulnerableComponents int `json:"vulnerableComponents"` }
func (ProjectMetrics) GetSeverityCount ¶
func (pm ProjectMetrics) GetSeverityCount(severity string) (count int, err error)
func (ProjectMetrics) GetViolationCount ¶
func (pm ProjectMetrics) GetViolationCount(violationType string) (count int, err error)
type ProjectMetricsService ¶
type ProjectProperty ¶
type ProjectService ¶
type ProjectService interface { Clone(ctx context.Context, req ProjectCloneRequest) error GetAll(ctx context.Context) ([]Project, error) GetByUUID(ctx context.Context, uuid string) (*Project, error) Lookup(ctx context.Context, name, version string) (*Project, error) Resolve(ctx context.Context, uuid, name, version string) (*Project, error) }
type ProjectTag ¶
type ProjectTag struct {
Name string `json:"name"`
}
type RepositoryMetaComponent ¶
type RepositoryMetaComponent struct {
LatestVersion string `json:"latestVersion"`
}
type RepositoryService ¶
type RepositoryService interface {
GetMetaComponent(ctx context.Context, purl string) (*RepositoryMetaComponent, error)
}
type Vulnerability ¶
type VulnerabilityService ¶
type VulnerabilityService interface { GetAll(ctx context.Context) ([]Vulnerability, error) GetAllForProject(ctx context.Context, projectUUID string) ([]Vulnerability, error) GetByUUID(ctx context.Context, uuid string) (*Vulnerability, error) GetByVulnID(ctx context.Context, vulnID string, source VulnerabilitySource) (*Vulnerability, error) }
type VulnerabilitySource ¶
type VulnerabilitySource string
const ( NVD VulnerabilitySource = "NVD" OSSIndex VulnerabilitySource = "OSSIndex" UnknownSource VulnerabilitySource = "" )
Click to show internal directories.
Click to hide internal directories.