Documentation
¶
Index ¶
- func CloneDBs(force bool)
- func DownloadDBs(serverURL string, force bool) error
- func DownloadGeoLite()
- func GenerateDBs(nvdIndexStartYear int)
- func IndexData(in string, out string, buildPath string, nvdIndexStart int, verbose bool)
- func ListAvailableVersions(serverURL string) error
- func UpdateDBs()
- type DBMetadata
- type DBServer
- type NVD2
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloneDBs ¶
func CloneDBs(force bool)
CloneDBs will clone the data bases initially from the public git repository TODO: add windows support
func DownloadDBs ¶ added in v0.7.0
DownloadDBs downloads the latest databases from the configured server
func DownloadGeoLite ¶
func DownloadGeoLite()
DownloadGeoLite will download the GeoLite Database if the API key is set in the environment
func GenerateDBs ¶
func GenerateDBs(nvdIndexStartYear int)
GenerateDBs allows to fetch the databases from their initial sources and generate the preprocessed form that netcap uses
func ListAvailableVersions ¶ added in v0.7.0
ListAvailableVersions lists all available database versions from the server
Types ¶
type DBMetadata ¶ added in v0.7.0
type DBMetadata struct {
Version string `json:"version"`
CreatedAt string `json:"created_at"`
Tarball string `json:"tarball"`
NVDStartYear int `json:"nvd_start_year"`
}
DBMetadata represents metadata about a database version
type DBServer ¶ added in v0.7.0
type DBServer struct {
// contains filtered or unexported fields
}
DBServer represents the database server
func NewDBServer ¶ added in v0.7.0
NewDBServer creates a new database server instance
type NVD2 ¶ added in v0.7.0
type NVD2 struct {
ResultsPerPage int `json:"resultsPerPage"`
StartIndex int `json:"startIndex"`
TotalResults int `json:"totalResults"`
Format string `json:"format"`
Version string `json:"version"`
Timestamp string `json:"timestamp"`
Vulnerabilities []struct {
Cve struct {
ID string `json:"id"`
SourceIdentifier string `json:"sourceIdentifier"`
Published string `json:"published"`
LastModified string `json:"lastModified"`
VulnStatus string `json:"vulnStatus"`
CveTags []interface{} `json:"cveTags"`
Descriptions []struct {
Lang string `json:"lang"`
Value string `json:"value"`
} `json:"descriptions"`
Metrics struct {
CvssMetricV2 []struct {
Source string `json:"source"`
Type string `json:"type"`
CvssData struct {
Version string `json:"version"`
VectorString string `json:"vectorString"`
BaseScore float64 `json:"baseScore"`
AccessVector string `json:"accessVector"`
AccessComplexity string `json:"accessComplexity"`
Authentication string `json:"authentication"`
ConfidentialityImpact string `json:"confidentialityImpact"`
IntegrityImpact string `json:"integrityImpact"`
AvailabilityImpact string `json:"availabilityImpact"`
} `json:"cvssData"`
BaseSeverity string `json:"baseSeverity"`
ExploitabilityScore float64 `json:"exploitabilityScore"`
ImpactScore float64 `json:"impactScore"`
AcInsufInfo bool `json:"acInsufInfo"`
ObtainAllPrivilege bool `json:"obtainAllPrivilege"`
ObtainUserPrivilege bool `json:"obtainUserPrivilege"`
ObtainOtherPrivilege bool `json:"obtainOtherPrivilege"`
UserInteractionRequired bool `json:"userInteractionRequired"`
} `json:"cvssMetricV2"`
} `json:"metrics"`
Weaknesses []struct {
Source string `json:"source"`
Type string `json:"type"`
Description []struct {
Lang string `json:"lang"`
Value string `json:"value"`
} `json:"description"`
} `json:"weaknesses"`
Configurations []struct {
Nodes []struct {
Operator string `json:"operator"`
Negate bool `json:"negate"`
CpeMatch []struct {
Vulnerable bool `json:"vulnerable"`
Criteria string `json:"criteria"`
MatchCriteriaID string `json:"matchCriteriaId"`
VersionStartIncluding string `json:"versionStartIncluding,omitempty"`
VersionEndExcluding string `json:"versionEndExcluding,omitempty"`
VersionStartExcluding string `json:"versionStartExcluding,omitempty"`
VersionEndIncluding string `json:"versionEndIncluding,omitempty"`
} `json:"cpeMatch"`
} `json:"nodes"`
} `json:"configurations"`
References []struct {
URL string `json:"url"`
Source string `json:"source"`
} `json:"references"`
} `json:"cve"`
} `json:"vulnerabilities"`
}
Click to show internal directories.
Click to hide internal directories.