Documentation ¶
Index ¶
- type DB
- type MemDB
- func (m *MemDB) GetScanVulnerabilities(scanID ...string) ([]models.Vulnerability, error)
- func (m *MemDB) GetTargetVulnerabilities(target ...string) ([]models.Vulnerability, error)
- func (m *MemDB) SaveScanVulnerabilities(scanID string, date string, reports []report.Report) error
- func (m *MemDB) SaveState(stateFile string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB interface { SaveScanVulnerabilities(scanID string, date string, reports []report.Report) error GetScanVulnerabilities(scanID ...string) ([]models.Vulnerability, error) GetTargetVulnerabilities(target ...string) ([]models.Vulnerability, error) }
DB defines the methods for the persistence layer to be implemented.
type MemDB ¶
type MemDB struct { // Historic is a map that stores the reports generated by the // execution of every Check. // The map key is a MD5 sum of the concatenation of the following fields: // - Name of the Checktype for the executed Check // - Target of the executed Check // - Options of the executed Check // Those three fields together conform the PRIMARY KEY. // The value of map entries is an array of struct containing: // - The scanID the Check pertains to // - The date of the scan when the Check was executed // - The Vulcan Core Report associated to it. // The array is ordered by execution time, so last entry overwrites previous one. Historic map[string][]entry // contains filtered or unexported fields }
MemDB is a concurrent-safe persistence layer stored in memory. It stores both the vulnerabilities detected for every scan.
func NewMemDB ¶
func NewMemDB() *MemDB
NewMemDB creates a new MemDB instance and returns its address.
func (*MemDB) GetScanVulnerabilities ¶
func (m *MemDB) GetScanVulnerabilities(scanID ...string) ([]models.Vulnerability, error)
GetScanVulnerabilities retrieves the vulnerabilities of the given scans from the storage.
func (*MemDB) GetTargetVulnerabilities ¶
func (m *MemDB) GetTargetVulnerabilities(target ...string) ([]models.Vulnerability, error)
GetTargetVulnerabilities retrieves the vulnerabilities of the given targets from the storage.
func (*MemDB) SaveScanVulnerabilities ¶
SaveScanVulnerabilities gets a list of Vulcan Core Reports and updates the historic.
Click to show internal directories.
Click to hide internal directories.