Documentation ¶
Index ¶
- Variables
- type ConnStr
- type DB
- func (db DB) CreateTarget(t model.Target) (model.Target, error)
- func (db DB) DeleteTargetTeam(targetID, teamID string) error
- func (db DB) DeleteTeam(teamID string) error
- func (db DB) GetFinding(id string) (model.FindingExpanded, error)
- func (db DB) GetFindingFromTargetIssueAndResource(targetID, affectedResource, issueID string) (model.FindingExpanded, error)
- func (db DB) GetFindingMTTR(id string) (float32, error)
- func (db DB) GetIssue(id string) (model.Issue, error)
- func (db DB) GetIssueMTTR(id string) (float32, error)
- func (db DB) GetSource(id string) (model.Source, error)
- func (db DB) GetSourceMTTR(id string) (float32, error)
- func (db DB) GetTarget(id string) (model.Target, error)
- func (db DB) GetTargetMTTR(id string) (float32, error)
- func (db DB) IssuesSummary(filter storage.Filter) ([]model.IssueSummary, storage.Pagination, error)
- func (db DB) ListFindingEvents(filter storage.Filter) ([]model.FindingEvent, storage.Pagination, error)
- func (db DB) ListFindingEventsByFinding(id string, filter storage.Filter) ([]model.FindingEvent, storage.Pagination, error)
- func (db DB) ListFindings(filter storage.Filter) ([]model.FindingExpanded, storage.Pagination, error)
- func (db DB) ListFindingsByIssue(id string, filter storage.Filter) ([]model.FindingExpanded, storage.Pagination, error)
- func (db DB) ListFindingsBySource(id string, filter storage.Filter) ([]model.FindingExpanded, storage.Pagination, error)
- func (db DB) ListFindingsByTarget(id string, filter storage.Filter) ([]model.FindingExpanded, storage.Pagination, error)
- func (db DB) ListIssues(filter storage.Filter) ([]model.Issue, storage.Pagination, error)
- func (db DB) ListLabels(filter storage.Filter) ([]string, error)
- func (db DB) ListSources(filter storage.Filter) ([]model.Source, storage.Pagination, error)
- func (db DB) ListTargets(filter storage.Filter) ([]model.Target, storage.Pagination, error)
- func (db DB) PatchFinding(id string, payload model.PatchFindingPayload) error
- func (db DB) StatsAssetsPerSeverity(filter storage.Filter) (model.StatsAssetsSeverity, error)
- func (db DB) StatsCurrentExposure(filter storage.Filter) (model.StatsExposure, error)
- func (db DB) StatsExposure(filter storage.Filter) (model.StatsExposure, error)
- func (db DB) StatsFixedIssues(filter storage.Filter) (model.StatsIssueSeverity, error)
- func (db DB) StatsIssues(filter storage.Filter) ([]model.Issue, storage.Pagination, error)
- func (db DB) StatsMTTR(filter storage.Filter) (model.StatsMTTRSeverity, error)
- func (db DB) StatsOpenIssues(filter storage.Filter) (model.StatsIssueSeverity, error)
- func (db DB) StatsSize() (model.StatsSize, error)
- func (db DB) TargetsSummary(filter storage.Filter) ([]model.TargetSummary, storage.Pagination, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrParsingFinding indicates an error when parsing finding data retrieved from database. ErrParsingFinding = errors.New("Error parsing finding data") )
Functions ¶
This section is empty.
Types ¶
type ConnStr ¶
type ConnStr struct { Host string `toml:"host"` Port string `toml:"port"` User string `toml:"user"` Pass string `toml:"pass"` DB string `toml:"db"` SSLMode string `toml:"sslmode"` }
ConnStr holds the PostgreSQL connection information.
type DB ¶
DB holds the database connection.
func (DB) CreateTarget ¶
CreateTarget creates the given target. If the target contains teams associated, these are created as part of the same transaction. If target or associated teams already exist, no error is returned.
func (DB) DeleteTargetTeam ¶ added in v1.1.0
DeleteTargetTeam deletes the association between a target and a team.
func (DB) DeleteTeam ¶ added in v1.1.0
DeleteTeam deletes all target associations for a team.
func (DB) GetFinding ¶
func (db DB) GetFinding(id string) (model.FindingExpanded, error)
GetFinding returns a specific finding.
func (DB) GetFindingFromTargetIssueAndResource ¶
func (db DB) GetFindingFromTargetIssueAndResource(targetID, affectedResource, issueID string) (model.FindingExpanded, error)
GetFindingFromTargetIssueAndResource returns a concrete finding specified by the given target ID, issue ID and affected resource.
func (DB) GetFindingMTTR ¶
GetFindingMTTR returns the mean time to rememdiate a specific finding.
func (DB) GetIssueMTTR ¶
GetIssueMTTR returns the mean time to remediate a specific issue.
func (DB) GetSourceMTTR ¶
GetSourceMTTR returns the mean time to remedite among all the sources with the same name, component and options as the given source ID.
func (DB) GetTargetMTTR ¶
GetTargetMTTR returns the mean time to remediate findings in a specific target.
func (DB) IssuesSummary ¶
func (db DB) IssuesSummary(filter storage.Filter) ([]model.IssueSummary, storage.Pagination, error)
IssuesSummary returns a filtered list of issues.
func (DB) ListFindingEvents ¶
func (db DB) ListFindingEvents(filter storage.Filter) ([]model.FindingEvent, storage.Pagination, error)
ListFindingEvents returns a filtered list of finding events.
func (DB) ListFindingEventsByFinding ¶
func (db DB) ListFindingEventsByFinding(id string, filter storage.Filter) ([]model.FindingEvent, storage.Pagination, error)
ListFindingEventsByFinding returns a filtered list of finding events for a specific finding.
func (DB) ListFindings ¶
func (db DB) ListFindings(filter storage.Filter) ([]model.FindingExpanded, storage.Pagination, error)
ListFindings returns a filtered list of findings.
func (DB) ListFindingsByIssue ¶
func (db DB) ListFindingsByIssue(id string, filter storage.Filter) ([]model.FindingExpanded, storage.Pagination, error)
ListFindingsByIssue returns a paginated list of findings for a specific issue for a given status.
func (DB) ListFindingsBySource ¶
func (db DB) ListFindingsBySource(id string, filter storage.Filter) ([]model.FindingExpanded, storage.Pagination, error)
ListFindingsBySource returns a paginated list of findings for a specific source for a given status.
func (DB) ListFindingsByTarget ¶
func (db DB) ListFindingsByTarget(id string, filter storage.Filter) ([]model.FindingExpanded, storage.Pagination, error)
ListFindingsByTarget returns a filtered list of findings for a specific target.
func (DB) ListIssues ¶
ListIssues returns a filtered list of issues.
func (DB) ListLabels ¶
ListLabels returns a filtered list of labels.
func (DB) ListSources ¶
ListSources returns a paginated list of sources.
func (DB) ListTargets ¶
ListTargets returns a paginated list of targets.
func (DB) PatchFinding ¶
func (db DB) PatchFinding(id string, payload model.PatchFindingPayload) error
PatchFinding returns a specific finding.
func (DB) StatsAssetsPerSeverity ¶
StatsAssetsPerSeverity returns the number of assets per severity taking into account the open vulnerability with highest score from the ones associated with the target.
func (DB) StatsCurrentExposure ¶
StatsCurrentExposure returns the current exposure times by diferent averages.
func (DB) StatsExposure ¶
StatsExposure returns the exposure times by diferent averages.
func (DB) StatsFixedIssues ¶
StatsFixedIssues returns statistics about the number of FIXED findings for each issue severity.
func (DB) StatsIssues ¶
StatsIssues returns a list of aggregated issues from a set of finding events.
func (DB) StatsOpenIssues ¶
StatsOpenIssues returns statistics about the number of OPEN findings for each issue severity.
func (DB) TargetsSummary ¶
func (db DB) TargetsSummary(filter storage.Filter) ([]model.TargetSummary, storage.Pagination, error)
TargetsSummary returns a filtered list of issues.