models

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2016 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CpeName

type CpeName struct {
	gorm.Model
	CveInfoID uint

	Name string
}

CpeName has CPE name

type CveInfo

type CveInfo struct {
	gorm.Model
	ScanResultID uint

	CveDetail        cve.CveDetail
	Packages         []PackageInfo
	DistroAdvisories []DistroAdvisory
	CpeNames         []CpeName
}

CveInfo has Cve Information.

type CveInfos

type CveInfos []CveInfo

CveInfos is for sorting

func (CveInfos) Len

func (c CveInfos) Len() int

func (CveInfos) Less

func (c CveInfos) Less(i, j int) bool

func (CveInfos) Swap

func (c CveInfos) Swap(i, j int)

type DistroAdvisory

type DistroAdvisory struct {
	gorm.Model
	CveInfoID uint

	AdvisoryID string
	Severity   string
	Issued     time.Time
	Updated    time.Time
}

DistroAdvisory has Amazon Linux AMI Security Advisory information. TODO Rename to DistroAdvisory

type NWLink struct {
	gorm.Model
	ScanResultID uint

	IPAddress string
	Netmask   string
	DevName   string
	LinkState string
}

NWLink has network link information.

type PackageInfo

type PackageInfo struct {
	gorm.Model
	CveInfoID uint

	Name    string
	Version string
	Release string

	NewVersion string
	NewRelease string
}

PackageInfo has installed packages.

func (PackageInfo) ToStringCurrentVersion

func (p PackageInfo) ToStringCurrentVersion() string

ToStringCurrentVersion returns package name-version-release

func (PackageInfo) ToStringNewVersion

func (p PackageInfo) ToStringNewVersion() string

ToStringNewVersion returns package name-version-release

type PackageInfoList

type PackageInfoList []PackageInfo

PackageInfoList is slice of PackageInfo

func (PackageInfoList) Exists

func (ps PackageInfoList) Exists(name string) bool

Exists returns true if exists the name

func (PackageInfoList) FindByName

func (ps PackageInfoList) FindByName(name string) (result PackageInfo, found bool)

FindByName search PackageInfo by name

func (PackageInfoList) UniqByName

func (ps PackageInfoList) UniqByName() (distincted PackageInfoList)

UniqByName be uniq by name.

type ScanHistory

type ScanHistory struct {
	gorm.Model
	ScanResults []ScanResult
	ScannedAt   time.Time
}

ScanHistory is the history of Scanning.

type ScanResult

type ScanResult struct {
	gorm.Model
	ScanHistoryID uint

	ServerName string // TOML Section key
	//  Hostname    string
	Family  string
	Release string
	//  Fqdn        string
	//  NWLinks     []NWLink
	KnownCves   []CveInfo
	UnknownCves []CveInfo
}

ScanResult has the result of scanned CVE information.

func (ScanResult) CveSummary

func (r ScanResult) CveSummary() string

CveSummary summarize the number of CVEs group by CVSSv2 Severity

type ScanResults

type ScanResults []ScanResult

ScanResults is slice of ScanResult.

func (ScanResults) FilterByCvssOver

func (results ScanResults) FilterByCvssOver() (filtered ScanResults)

FilterByCvssOver is filter function.

Jump to

Keyboard shortcuts

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