models

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2017 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 Container added in v0.1.4

type Container struct {
	ContainerID string
	Name        string
}

Container has Container information

type CveInfo

type CveInfo struct {
	CveDetail cve.CveDetail
	VulnInfo
}

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 {
	AdvisoryID string
	Severity   string
	Issued     time.Time
	Updated    time.Time
}

DistroAdvisory has Amazon Linux, RHEL, FreeBSD Security Advisory information.

type NWLink struct {
	IPAddress string
	Netmask   string
	DevName   string
	LinkState string
}

NWLink has network link information.

type PackageInfo

type PackageInfo struct {
	Name       string
	Version    string
	Release    string
	NewVersion string
	NewRelease string
	Repository 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) MergeNewVersion added in v0.2.0

func (ps PackageInfoList) MergeNewVersion(as PackageInfoList)

MergeNewVersion merges candidate version information to the receiver struct

func (PackageInfoList) ToUpdatablePacksSummary added in v0.2.0

func (ps PackageInfoList) ToUpdatablePacksSummary() string

ToUpdatablePacksSummary returns a summary of updatable packages

func (PackageInfoList) UniqByName

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

UniqByName be uniq by name.

type PackageInfosByName added in v0.2.0

type PackageInfosByName []PackageInfo

PackageInfosByName implements sort.Interface for []PackageInfo based on the Name field.

func (PackageInfosByName) Len added in v0.2.0

func (a PackageInfosByName) Len() int

func (PackageInfosByName) Less added in v0.2.0

func (a PackageInfosByName) Less(i, j int) bool

func (PackageInfosByName) Swap added in v0.2.0

func (a PackageInfosByName) Swap(i, j int)

type Platform added in v0.1.5

type Platform struct {
	Name       string // aws or azure or gcp or other...
	InstanceID string
}

Platform has platform information

type ScanHistory

type ScanHistory struct {
	ScanResults ScanResults
}

ScanHistory is the history of Scanning.

type ScanResult

type ScanResult struct {
	ScannedAt time.Time

	Lang       string
	ServerName string // TOML Section key
	Family     string
	Release    string
	Container  Container
	Platform   Platform

	// Scanned Vulns via SSH + CPE Vulns
	ScannedCves []VulnInfo

	KnownCves   []CveInfo
	UnknownCves []CveInfo
	IgnoredCves []CveInfo

	Packages PackageInfoList

	Optional [][]interface{}
}

ScanResult has the result of scanned CVE information.

func (ScanResult) AllCves added in v0.1.7

func (r ScanResult) AllCves() []CveInfo

AllCves returns Known and Unknown CVEs

func (ScanResult) CveSummary

func (r ScanResult) CveSummary() string

CveSummary summarize the number of CVEs group by CVSSv2 Severity

func (ScanResult) FillCveDetail added in v0.2.0

func (r ScanResult) FillCveDetail() (ScanResult, error)

FillCveDetail fetches CVE detailed information from CVE Database, and then set to fields.

func (ScanResult) FilterByCvssOver added in v0.2.0

func (r ScanResult) FilterByCvssOver() ScanResult

FilterByCvssOver is filter function.

func (ScanResult) ReportFileName added in v0.2.0

func (r ScanResult) ReportFileName() (name string)

ReportFileName returns the filename on localhost without extention

func (ScanResult) ReportKeyName added in v0.2.0

func (r ScanResult) ReportKeyName() (name string)

ReportKeyName returns the name of key on S3, Azure-Blob without extention

func (ScanResult) ServerInfo added in v0.1.4

func (r ScanResult) ServerInfo() string

ServerInfo returns server name one line

func (ScanResult) ServerInfoTui added in v0.1.4

func (r ScanResult) ServerInfoTui() string

ServerInfoTui returns server infromation for TUI sidebar

type ScanResults

type ScanResults []ScanResult

ScanResults is slice of ScanResult.

func (ScanResults) Len added in v0.1.4

func (s ScanResults) Len() int

Len implement Sort Interface

func (ScanResults) Less added in v0.1.4

func (s ScanResults) Less(i, j int) bool

Less implement Sort Interface

func (ScanResults) Swap added in v0.1.4

func (s ScanResults) Swap(i, j int)

Swap implement Sort Interface

type VulnInfo added in v0.2.0

type VulnInfo struct {
	CveID            string
	Packages         PackageInfoList
	DistroAdvisories []DistroAdvisory // for Aamazon, RHEL, FreeBSD
	CpeNames         []string
}

VulnInfo holds a vulnerability information and unsecure packages

type VulnInfos added in v0.2.0

type VulnInfos []VulnInfo

VulnInfos is VulnInfo list, getter/setter, sortable methods.

func (VulnInfos) FindByCveID added in v0.2.0

func (s VulnInfos) FindByCveID(cveID string) (VulnInfo, bool)

FindByCveID find by CVEID

func (VulnInfos) Len added in v0.2.0

func (s VulnInfos) Len() int

Len implement Sort Interface

func (VulnInfos) Less added in v0.2.0

func (s VulnInfos) Less(i, j int) bool

Less implement Sort Interface

func (VulnInfos) Swap added in v0.2.0

func (s VulnInfos) Swap(i, j int)

Swap implement Sort Interface

Jump to

Keyboard shortcuts

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