Documentation ¶
Index ¶
- type AddAssetDepInput
- type AddAssetInput
- type AddCVEInput
- type AddCVENodeCPEMatchInput
- type AddCVENodeInput
- type AddCVEReferenceInput
- type DeleteAssetInput
- type DeleteCVEInput
- type ErrAlreadyExist
- type ErrNotExist
- type GetAssetInput
- type GetCVEInput
- type Key
- type Memory
- func (mem *Memory) AddAsset(input AddAssetInput) error
- func (mem *Memory) AddCVE(input AddCVEInput) error
- func (mem *Memory) DeleteAsset(input DeleteAssetInput) error
- func (mem *Memory) DeleteCVE(input DeleteCVEInput) error
- func (mem *Memory) GetAsset(input GetAssetInput) (*model.Asset, error)
- func (mem *Memory) GetAssetCVEs(asset *model.Asset) []*model.CVE
- func (mem *Memory) GetCVE(input GetCVEInput) (*model.CVE, error)
- func (mem *Memory) GetCVEAssets(cve *model.CVE) []*model.Asset
- func (mem *Memory) QueryAssets(input QueryAssetInput) []*model.Asset
- func (mem *Memory) QueryCVEs(input QueryCVEInput) []*model.CVE
- func (mem *Memory) UpdateAsset(input UpdateAssetInput) error
- func (mem *Memory) UpdateCVE(input UpdateCVEInput) error
- type QueryAssetInput
- type QueryCVEInput
- type UpdateAssetCVEsInput
- type UpdateAssetDepInput
- type UpdateAssetInput
- type UpdateCVEAssetInput
- type UpdateCVEInput
- type UpdateCVENodeCPEMatchInput
- type UpdateCVENodeInput
- type UpdateCVEReferencesInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddAssetDepInput ¶
type AddAssetDepInput struct {
ID string `json:"id"`
}
type AddAssetInput ¶
type AddAssetInput struct { ID string `json:"id"` Name string `json:"name"` CPE23 string `json:"cpe23"` Dependents []AddAssetDepInput `json:"dependents"` Dependencies []AddAssetDepInput `json:"dependencies"` }
type AddCVEInput ¶
type AddCVEInput struct { ID string `json:"id"` Description string `json:"description"` PublicationDate time.Time `json:"publicationDate"` LastUpdate time.Time `json:"lastUpdate"` CVSS2Vector *string `json:"cvss2Vector,omitempty"` CVSS3Vector *string `json:"cvss3Vector,omitempty"` Configurations []AddCVENodeInput `json:"configurations"` References []AddCVEReferenceInput `json:"references"` }
type AddCVENodeCPEMatchInput ¶
type AddCVENodeCPEMatchInput struct { Vulnerable bool `json:"vulnerable"` CPE23 string `json:"cpe23"` VersionStartIncluding *string `json:"versionStartIncluding,omitempty"` VersionStartExcluding *string `json:"versionStartExcluding,omitempty"` VersionEndIncluding *string `json:"versionEndIncluding,omitempty"` VersionEndExcluding *string `json:"versionEndExcluding,omitempty"` }
type AddCVENodeInput ¶
type AddCVENodeInput struct { Negate *bool `json:"negate,omitempty"` Operator string `json:"operator"` Children []AddCVENodeInput `json:"children"` CPEMatches []AddCVENodeCPEMatchInput `json:"cpeMatches"` }
type AddCVEReferenceInput ¶
type DeleteAssetInput ¶
type DeleteAssetInput struct {
ID string `json:"id"`
}
type DeleteCVEInput ¶
type DeleteCVEInput struct {
ID string `json:"id"`
}
type ErrAlreadyExist ¶
ErrAlreadyExist is returned when the in-memory DB already know an element of value V for the type given its key.
func (ErrAlreadyExist) Error ¶
func (err ErrAlreadyExist) Error() string
type ErrNotExist ¶
ErrNotExist is returned when the in-memory DB does not know an element of value V for the type given its key.
func (ErrNotExist) Error ¶
func (err ErrNotExist) Error() string
type GetAssetInput ¶
type GetAssetInput struct {
ID string `json:"id"`
}
type GetCVEInput ¶
type GetCVEInput struct {
ID string `json:"id"`
}
type Memory ¶
type Memory struct { // Assets indexes *model.Asset on to the ID Assets map[string]*model.Asset // AssetVPIndex indexes *model.Asset on the vendor:product // couple of the CPEs. // Second map indexes by the Asset's ID. AssetVPIndex map[string]map[string]struct{} // CVEs indexes *model.CVE on to the ID CVEs map[string]*model.CVE // CVEVPIndex indexes *model.CVE on the vendor:product couple // of the CPEs in its configurations. // Second map indexes by the CVE's ID. CVEVPIndex map[string]map[string]struct{} // contains filtered or unexported fields }
Memory holds the in-memory graph database, powering the whole tool. It only achieve what a standard graph database is expected to do : checks for consistency of (un)existing objects, but no more. Cycles, multigraphs...etc. are handled by the business layer.
Input and output objects are hardened by a copy of values to block the possibility of modifying the outside data affecting the saved data, so a Memory instance can behave as an outside component (sealed from the current application).
func (*Memory) AddAsset ¶
func (mem *Memory) AddAsset(input AddAssetInput) error
func (*Memory) AddCVE ¶
func (mem *Memory) AddCVE(input AddCVEInput) error
func (*Memory) DeleteAsset ¶
func (mem *Memory) DeleteAsset(input DeleteAssetInput) error
func (*Memory) DeleteCVE ¶
func (mem *Memory) DeleteCVE(input DeleteCVEInput) error
func (*Memory) GetAssetCVEs ¶
GetAssetCVEs returns a Asset's CVEs. As it is an edge resolver, it does not perform a check on the given pointer.
func (*Memory) GetCVEAssets ¶
GetCVEAssets returns a CVE's Assets. As it is an edge resolver, it does not perform a check on the id.
func (*Memory) QueryAssets ¶
func (mem *Memory) QueryAssets(input QueryAssetInput) []*model.Asset
func (*Memory) UpdateAsset ¶
func (mem *Memory) UpdateAsset(input UpdateAssetInput) error
func (*Memory) UpdateCVE ¶
func (mem *Memory) UpdateCVE(input UpdateCVEInput) error
type QueryAssetInput ¶
type QueryAssetInput struct {
VP *string `json:"vp,omitempty"`
}
type QueryCVEInput ¶
type QueryCVEInput struct {
VP *string `json:"vp,omitempty"`
}
type UpdateAssetCVEsInput ¶
type UpdateAssetCVEsInput struct {
ID string `json:"id"`
}
type UpdateAssetDepInput ¶
type UpdateAssetDepInput struct {
ID string `json:"id"`
}
type UpdateAssetInput ¶
type UpdateAssetInput struct { ID string `json:"id"` Name *string `json:"name,omitempty"` CPE23 *string `json:"cpe23,omitempty"` Dependents []UpdateAssetDepInput `json:"dependents,omitempty"` Dependencies []UpdateAssetDepInput `json:"dependencies,omitempty"` CVEs []UpdateAssetCVEsInput `json:"cves,omitempty"` }
type UpdateCVEAssetInput ¶
type UpdateCVEAssetInput struct {
ID string `json:"id"`
}
type UpdateCVEInput ¶
type UpdateCVEInput struct { ID string `json:"id"` Description *string `json:"description,omitempty"` LastUpdate *time.Time `json:"lastUpdate"` CVSS2Vector *string `json:"cvss2Vector,omitempty"` CVSS3Vector *string `json:"cvss3Vector,omitempty"` Configurations []UpdateCVENodeInput `json:"configurations"` Assets []UpdateCVEAssetInput `json:"assets"` References []UpdateCVEReferencesInput `json:"references"` }
type UpdateCVENodeCPEMatchInput ¶
type UpdateCVENodeCPEMatchInput struct { Vulnerable bool `json:"vulnerable"` CPE23 string `json:"cpe23"` VersionStartIncluding *string `json:"versionStartIncluding,omitempty"` VersionStartExcluding *string `json:"versionStartExcluding,omitempty"` VersionEndIncluding *string `json:"versionEndIncluding,omitempty"` VersionEndExcluding *string `json:"versionEndExcluding,omitempty"` }
type UpdateCVENodeInput ¶
type UpdateCVENodeInput struct { Negate *bool `json:"negate,omitempty"` Operator string `json:"operator"` Children []UpdateCVENodeInput `json:"children"` CPEMatches []UpdateCVENodeCPEMatchInput `json:"cpeMatches"` }