Documentation ¶
Index ¶
- Constants
- Variables
- func DownloadCache(url, dest string) error
- func ShouldReload(c *Cache, latestDumpEndpoint string) bool
- type API
- func (api *API) LoadCacheFromFile(cachePath string) error
- func (api *API) LoadCacheFromURL(cacheURL string) error
- func (api *API) PeriodicCacheReload(interval time.Duration, latestDumpEndpoint string, cacheURL *string)
- func (api *API) Updates(request *Request) (*Updates, error)
- func (api *API) Vulnerabilities(request *Request) (*Vulnerabilities, error)
- func (api *API) VulnerabilitiesExtended(request *Request) (*VulnerabilitiesExtended, error)
- type AffectedPackage
- type ArchID
- type CSAFCVEID
- type CSAFCVEProduct
- type CSAFCVEs
- type CSAFProduct
- type CSAFProductID
- type CVEID
- type Cache
- type ContentSetID
- type CpeID
- type CpeLabel
- type CriteriaID
- type CveDetail
- type DBChange
- type DefinitionDetail
- type DefinitionID
- type ErratumDetail
- type ErratumID
- type EvrID
- type Module
- type ModuleStream
- type ModuleStreamPtrs
- type ModuleTestID
- type NameArch
- type NameID
- type Nevra
- type NevraIDs
- type NevraString
- type Option
- type OvalModuleTestDetail
- type OvalState
- type OvalStateID
- type OvalTestDetail
- type Package
- type PackageDetail
- type ParsedCpe
- type PkgErratum
- type PkgID
- type ProcessedDefinition
- type ProcessedDefinitions
- type ProcessedRequest
- type ProductsPackage
- type RepoDetail
- type RepoID
- type Request
- type TestID
- type Update
- type UpdateDetail
- type UpdateList
- type Updates
- type Vulnerabilities
- type VulnerabilitiesCvesDetails
- type VulnerabilitiesExtended
- type Vulnerability
- type VulnerabilityDetail
Constants ¶
View Source
const ( OvalOperationEvrEquals = 1 OvalOperationEvrLessThan = 2 OvalCheckExistenceAtLeastOne = 1 OvalCheckExistenceNone = 2 OvalDefinitionTypePatch = 1 OvalDefinitionTypeVulnerability = 2 OvalCriteriaOperatorAnd = 1 OvalCriteriaOperatorOr = 2 )
View Source
const Dump = "/data/vmaas.db"
View Source
const SecurityErrataType = "security"
Variables ¶
View Source
var ErrProcessingInput = errors.New("processing input")
Functions ¶
func DownloadCache ¶
func ShouldReload ¶ added in v1.0.1
Types ¶
type API ¶
type API struct { Cache *Cache // contains filtered or unexported fields }
func (*API) LoadCacheFromFile ¶
func (*API) LoadCacheFromURL ¶
func (*API) PeriodicCacheReload ¶
func (*API) Vulnerabilities ¶
func (api *API) Vulnerabilities(request *Request) (*Vulnerabilities, error)
func (*API) VulnerabilitiesExtended ¶
func (api *API) VulnerabilitiesExtended(request *Request) (*VulnerabilitiesExtended, error)
type AffectedPackage ¶ added in v0.7.0
type CSAFCVEProduct ¶ added in v1.3.0
type CSAFCVEProduct struct { ID CSAFCVEID CVEID CVEID CSAFProductID CSAFProductID CSAFProductStatusID int }
type CSAFProduct ¶ added in v1.3.0
type CSAFProduct struct { CpeID CpeID PackageNameID NameID PackageID PkgID ModuleStream ModuleStream }
type CSAFProductID ¶ added in v1.3.0
type CSAFProductID int
type Cache ¶
type Cache struct { Packagename2ID map[string]NameID ID2Packagename map[NameID]string // name -> []pkg ordered by e-v-r ordering Updates map[NameID][]PkgID // name -> evr -> idx into updates[name] UpdatesIndex map[NameID]map[EvrID][]int Evr2ID map[utils.Evr]EvrID ID2Evr map[EvrID]utils.Evr ID2Arch map[ArchID]string Arch2ID map[string]ArchID ArchCompat map[ArchID]map[ArchID]bool PackageDetails map[PkgID]PackageDetail Nevra2PkgID map[Nevra]PkgID RepoIDs []RepoID RepoDetails map[RepoID]RepoDetail RepoLabel2IDs map[string][]RepoID RepoPath2IDs map[string][]RepoID Label2ContentSetID map[string]ContentSetID ProductID2RepoIDs map[int][]RepoID PkgID2RepoIDs map[PkgID][]RepoID ErratumID2Name map[ErratumID]string PkgID2ErrataIDs map[PkgID][]ErratumID ErratumID2RepoIDs map[ErratumID]map[RepoID]bool CveDetail map[string]CveDetail CveNames map[int]string PkgErratum2Module map[PkgErratum][]int Module2IDs map[ModuleStream][]int ModuleRequires map[int][]int DBChange DBChange ErratumDetails map[string]ErratumDetail SrcPkgID2PkgID map[PkgID][]PkgID String map[int]string // OVAL PackagenameID2definitionIDs map[NameID][]DefinitionID RepoID2CpeIDs map[RepoID][]CpeID ContentSetID2CpeIDs map[ContentSetID][]CpeID OvaldefinitionDetail map[DefinitionID]DefinitionDetail OvaldefinitionID2Cves map[DefinitionID][]string CpeID2OvalDefinitionIDs map[CpeID][]DefinitionID OvalCriteriaID2DepModuleTestIDs map[CriteriaID][]ModuleTestID OvalCriteriaID2DepTestIDs map[CriteriaID][]TestID OvalCriteriaID2DepCriteriaIDs map[CriteriaID][]CriteriaID OvalCriteriaID2Type map[CriteriaID]int OvalStateID2Arches map[OvalStateID][]ArchID OvalModuleTestDetail map[ModuleTestID]OvalModuleTestDetail OvalTestDetail map[TestID]OvalTestDetail OvalTestID2States map[TestID][]OvalState OvalDefinitionID2ErrataIDs map[DefinitionID][]ErratumID CpeID2Label map[CpeID]CpeLabel // CSAF CSAFProductStatus map[int]string CSAFCVEs map[CSAFProduct]CSAFCVEs }
type ContentSetID ¶
type ContentSetID int
type CriteriaID ¶
type CriteriaID int
type DefinitionDetail ¶
type DefinitionDetail struct { ID DefinitionID DefinitionTypeID int CriteriaID CriteriaID }
type DefinitionID ¶
type DefinitionID int
type ErratumDetail ¶ added in v0.7.1
type ErratumDetail struct { ID ErratumID Synopsis string Summary *string Type string Severity *string Description *string CVEs []string PkgIDs []int ModulePkgIDs []int Bugzillas []string Refs []string Modules []Module Solution *string Issued *string Updated *string URL string ThirdParty bool RequiresReboot bool }
type ModuleStream ¶
type ModuleStream struct { Module string `json:"module_name"` Stream string `json:"module_stream"` }
func (*ModuleStream) Scan ¶ added in v1.3.0
func (ms *ModuleStream) Scan(value interface{}) error
Implement the Scan method for the ModuleStream type
type ModuleStreamPtrs ¶ added in v0.4.3
type ModuleTestID ¶
type ModuleTestID int
type NevraString ¶
type Option ¶ added in v1.0.0
type Option interface {
// contains filtered or unexported methods
}
func WithMaxGoroutines ¶ added in v1.0.0
Option to set maximum number of goroutines used by the lib
func WithUnfixed ¶ added in v1.0.0
Option to evaluate unfixed CVEs by OVAL
type OvalModuleTestDetail ¶
type OvalModuleTestDetail struct {
ModuleStream ModuleStream
}
type OvalState ¶
type OvalState struct { ID OvalStateID EvrID EvrID OperationEvr int }
type OvalStateID ¶
type OvalStateID int
type OvalTestDetail ¶
type PackageDetail ¶
type PkgErratum ¶ added in v0.7.1
type ProcessedDefinition ¶ added in v0.6.0
type ProcessedDefinition struct { DefinitionID DefinitionID DefinitionTypeID int CriteriaID CriteriaID Packages []Package Cpe CpeLabel }
type ProcessedDefinitions ¶ added in v0.6.0
type ProcessedDefinitions struct { Patch []*ProcessedDefinition Vulnerability []*ProcessedDefinition }
type ProcessedRequest ¶
type ProcessedRequest struct { Updates *Updates Packages []NevraString Cpes []CpeID NewerReleaseverCpes []CpeID ContentSets []ContentSetID OriginalRequest *Request }
type ProductsPackage ¶ added in v1.4.0
type ProductsPackage struct { Products []CSAFProduct Package Package }
type RepoDetail ¶
type Request ¶
type Request struct { Packages []string `json:"package_list"` Repos *[]string `json:"repository_list"` // we need to use pointers to modules to distinguish between nil and "" // to keep consistency with python implementation Modules []ModuleStreamPtrs `json:"modules_list"` Releasever *string `json:"releasever"` Basearch *string `json:"basearch"` RepoPaths []string `json:"repository_paths"` ThirdParty bool `json:"third_party"` LatestOnly bool `json:"latest_only"` SecurityOnly bool `json:"security_only"` Extended bool `json:"extended"` EpochRequired bool `json:"epoch_required"` UseCsaf bool `json:"use_csaf"` }
type Update ¶
type Update struct { Package string `json:"package"` PackageName string `json:"package_name"` EVRA string `json:"evra"` Erratum string `json:"erratum"` Repository string `json:"repository"` Basearch string `json:"basearch"` Releasever string `json:"releasever"` // contains filtered or unexported fields }
type UpdateDetail ¶
type UpdateDetail struct {
AvailableUpdates []Update `json:"available_updates,omitempty"`
}
type UpdateList ¶
type UpdateList map[string]UpdateDetail
type Updates ¶
type Updates struct { UpdateList UpdateList `json:"update_list"` RepoList *[]string `json:"repository_list,omitempty"` RepoPaths []string `json:"repository_paths,omitempty"` ModuleList []ModuleStream `json:"modules_list,omitempty"` Releasever *string `json:"releasever,omitempty"` Basearch *string `json:"basearch,omitempty"` LastChange time.Time `json:"last_change"` }
type Vulnerabilities ¶
type Vulnerabilities struct { CVEs []Vulnerability `json:"cve_list"` ManuallyFixableCVEs []Vulnerability `json:"manually_fixable_cve_list"` UnpatchedCVEs []Vulnerability `json:"unpatched_cve_list"` LastChange time.Time `json:"last_change"` }
type VulnerabilitiesCvesDetails ¶
type VulnerabilitiesCvesDetails struct { Cves map[string]VulnerabilityDetail ManualCves map[string]VulnerabilityDetail UnpatchedCves map[string]VulnerabilityDetail LastChange *time.Time }
type VulnerabilitiesExtended ¶
type VulnerabilitiesExtended struct { CVEs []VulnerabilityDetail `json:"cve_list"` ManuallyFixableCVEs []VulnerabilityDetail `json:"manually_fixable_cve_list"` UnpatchedCVEs []VulnerabilityDetail `json:"unpatched_cve_list"` LastChange time.Time `json:"last_change"` }
type Vulnerability ¶
type Vulnerability string
type VulnerabilityDetail ¶
type VulnerabilityDetail struct { CVE string `json:"cve"` Packages map[string]bool Errata map[string]bool Affected []AffectedPackage `json:"affected,omitempty"` }
func (VulnerabilityDetail) MarshalJSON ¶ added in v1.0.6
func (d VulnerabilityDetail) MarshalJSON() ([]byte, error)
marshal VulnerabilityDetail Packages and Errata as json arrays for backward compatibility
Source Files ¶
Click to show internal directories.
Click to hide internal directories.