model

package
v1.1.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Finding

type Finding struct {
	ID                     string  `json:"id" db:"id"`
	IssueID                string  `json:"-" db:"issue_id"`
	TargetID               string  `json:"-" db:"target_id"`
	AffectedResource       string  `json:"affected_resource" db:"affected_resource"`
	AffectedResourceString string  `json:"-" db:"affected_resource_string"`
	Details                string  `json:"details" db:"details"`
	ImpactDetails          string  `json:"impact_details" db:"impact_details"`
	Status                 string  `json:"status" db:"status"`
	Score                  float32 `json:"score" db:"score"`

	// TotalExposure contains the time, in hours, a finding was open during its
	// entire lifetime. For instance: if the finding was open for one day, then
	// it was fixed, open again for onther day and finally fixed, the
	// TotalExposure would be 48. If the finding is OPEN the TotalExposure also
	// includes the period between the last time it was found and now.
	TotalExposure int64 `json:"total_exposure"`

	// Resources stores the resources of the finding, if any, in as a non typed json.
	Resources Resources `json:"resources"`
	//OpenFinding defines the fields that only open findings have defined.
	*OpenFinding
}

Finding represents the relationship between an Issue and a Target.

type FindingEvent

type FindingEvent struct {
	ID                     string     `json:"id" db:"id"`
	FindingID              string     `json:"finding_id" db:"finding_id"`
	SourceID               string     `json:"source_id" db:"source_id"`
	Score                  float32    `json:"score" db:"score"`
	Details                *string    `json:"details" db:"details"`
	Resources              *Resources `json:"resources"`
	Fingerprint            string     `json:"-"`
	AffectedResourceString *string    `json:"-" db:"affected_resource_string"`
	Time                   time.Time  `json:"time" db:"time"`
}

FindingEvent represents the event of discovering a Finding.

type FindingExpanded

type FindingExpanded struct {
	Finding
	Issue  Issue  `json:"issue"`
	Target Target `json:"target"`
	Source Source `json:"source"`
}

FindingExpanded represents a finding including the expanded inner child's. for the related issue and target.

type FindingExposure

type FindingExposure struct {
	FindingID string    `json:"finding_id" db:"finding_id"`
	FoundAt   time.Time `json:"found_at" db:"found_at"`
	FixedAt   time.Time `json:"fixed_at" db:"fixed_at"`
	TTR       float32   `json:"ttr" db:"ttr"`
}

FindingExposure represents the exposure time of a Finding.

type Issue

type Issue struct {
	ID              string         `json:"id" db:"id"`
	Summary         string         `json:"summary" db:"summary"`
	CWEID           int            `json:"cwe_id" db:"cwe_id"`
	Description     string         `json:"description" db:"description"`
	Recommendations pq.StringArray `json:"recommendations" db:"recommendations"`
	ReferenceLinks  pq.StringArray `json:"reference_links" db:"reference_links"`
	Labels          []string       `json:"labels"`

	// The following fields represent extra data that can be aggregated.
	Open  *int `json:"open,omitempty" db:"open"`
	Fixed *int `json:"fixed,omitempty" db:"fixed"`
}

Issue represents a vulnerability.

type IssueSummary

type IssueSummary struct {
	IssueID        string  `json:"issue_id" db:"issue_id"`
	Summary        string  `json:"summary" db:"summary"`
	TargetsCount   int     `json:"targets_count" db:"targets_count"`
	ResourcesCount int     `json:"resources_count" db:"resources_count"`
	MaxScore       float32 `json:"max_score" db:"max_score"`
}

IssueSummary represents a summary for an issue and its affected targets.

type OpenFinding

type OpenFinding struct {
	// CurrentExposure contains the total hours that passed from the last time
	// it was found until now.
	CurrentExposure int64 `json:"current_exposure,omitempty"`
}

OpenFinding contains the specific information for an open finding.

type PatchFindingPayload

type PatchFindingPayload struct {
	Status string `json:"status"`
}

PatchFindingPayload represents the payload submitted to perform a patch operation on findings.

type ResourceGroup

type ResourceGroup struct {
	Name       string              `json:"name"`
	Attributes []string            `json:"attributes"`
	Resources  []map[string]string `json:"resources"`
}

ResourceGroup reprents a resource in a finding.

type Resources

type Resources []ResourceGroup

Resources defines the structure of a the resources of a finding.

type Source

type Source struct {
	ID        string `json:"id" db:"id"`
	Name      string `json:"name" db:"name"`
	Component string `json:"component" db:"component"`
	Instance  string `json:"instance" db:"instance"`
	Options   string `json:"options" db:"options"`
	Time      string `json:"time" db:"time"`
	TargetID  string `json:"target_id,omitempty" db:"target_id"`
}

Source represents a producer of vulnerabilities.

type StatsAssetsSeverity

type StatsAssetsSeverity struct {
	Total         float32 `json:"total" db:"total"`
	Critical      float32 `json:"critical" db:"critical"`
	High          float32 `json:"high" db:"high"`
	Medium        float32 `json:"medium" db:"medium"`
	Low           float32 `json:"low" db:"low"`
	Informational float32 `json:"informational" db:"informational"`
}

StatsAssetsSeverity represents the number of assets by severity.

type StatsExposure

type StatsExposure struct {
	Percentile10 float32 `json:"percentile_10" db:"percentile_10"`
	Percentile25 float32 `json:"percentile_25" db:"percentile_25"`
	Percentile50 float32 `json:"percentile_50" db:"percentile_50"`
	Percentile75 float32 `json:"percentile_75" db:"percentile_75"`
	Percentile90 float32 `json:"percentile_90" db:"percentile_90"`
	Mean         float32 `json:"mean" db:"mean"`
}

StatsExposure represents the exposure time stats by different averages.

type StatsIssueSeverity

type StatsIssueSeverity struct {
	Critical      int `json:"critical"`
	High          int `json:"high"`
	Medium        int `json:"medium"`
	Low           int `json:"low"`
	Informational int `json:"informational"`
}

StatsIssueSeverity represents the number of occurences for each issue severity.

type StatsMTTRSeverity

type StatsMTTRSeverity struct {
	Total         float32 `json:"total" db:"total"`
	Critical      float32 `json:"critical" db:"critical"`
	High          float32 `json:"high" db:"high"`
	Medium        float32 `json:"medium" db:"medium"`
	Low           float32 `json:"low" db:"low"`
	Informational float32 `json:"informational" db:"informational"`
}

StatsMTTRSeverity represents the mean time to remediation stats by issue severity.

type StatsSize

type StatsSize struct {
	Sources       int `json:"sources" db:"sources"`
	Targets       int `json:"targets" db:"targets"`
	Issues        int `json:"issues" db:"issues"`
	Findings      int `json:"findings" db:"findings"`
	FindingEvents int `json:"finding_events" db:"finding_events"`
}

StatsSize represents the size of each data set.

type Target

type Target struct {
	ID         string   `json:"id" db:"id"`
	Identifier string   `json:"identifier" db:"identifier"`
	Teams      []string `json:"teams"`
}

Target represents an object affected by vulnerabilities.

type TargetSummary

type TargetSummary struct {
	TargetID      string  `json:"target_id" db:"target_id"`
	Identifier    string  `json:"identifier" db:"identifier"`
	FindingsCount int     `json:"findings_count" db:"findings_count"`
	IssuesCount   int     `json:"issues_count" db:"issues_count"`
	MaxScore      float32 `json:"max_score" db:"max_score"`
}

TargetSummary represents a target summary and its associated findings.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL