Documentation ¶
Index ¶
- Constants
- Variables
- type Changelog
- type Confidence
- type Container
- type CveInfo
- type CveInfos
- type DistroAdvisory
- type NWLink
- type PackageInfo
- type PackageInfoList
- func (ps PackageInfoList) Exists(name string) bool
- func (ps PackageInfoList) FindByName(name string) (result PackageInfo, found bool)
- func (ps PackageInfoList) FormatUpdatablePacksSummary() string
- func (ps PackageInfoList) MergeNewVersion(as PackageInfoList)
- func (ps PackageInfoList) UniqByName() (distincted PackageInfoList)
- type PackageInfosByName
- type Platform
- type ScanHistory
- type ScanResult
- func (r ScanResult) AllCves() []CveInfo
- func (r ScanResult) CveSummary() string
- func (r ScanResult) FillCveDetail() (*ScanResult, error)
- func (r ScanResult) FilterByCvssOver() ScanResult
- func (r ScanResult) FormatServerName() string
- func (r ScanResult) ReportFileName() (name string)
- func (r ScanResult) ReportKeyName() (name string)
- func (r ScanResult) ServerInfo() string
- func (r ScanResult) ServerInfoTui() string
- type ScanResults
- type VulnInfo
- type VulnInfos
Constants ¶
const ( // CpeNameMatchStr is a String representation of CpeNameMatch CpeNameMatchStr = "CpeNameMatch" // YumUpdateSecurityMatchStr is a String representation of YumUpdateSecurityMatch YumUpdateSecurityMatchStr = "YumUpdateSecurityMatch" // PkgAuditMatchStr is a String representation of PkgAuditMatch PkgAuditMatchStr = "PkgAuditMatch" // ChangelogExactMatchStr is a String representation of ChangelogExactMatch ChangelogExactMatchStr = "ChangelogExactMatch" // ChangelogLenientMatchStr is a String representation of ChangelogLenientMatch ChangelogLenientMatchStr = "ChangelogLenientMatch" // FailedToGetChangelog is a String representation of FailedToGetChangelog FailedToGetChangelog = "FailedToGetChangelog" // FailedToFindVersionInChangelog is a String representation of FailedToFindVersionInChangelog FailedToFindVersionInChangelog = "FailedToFindVersionInChangelog" )
Variables ¶
var ChangelogExactMatch = Confidence{95, ChangelogExactMatchStr}
ChangelogExactMatch is a ranking how confident the CVE-ID was deteted correctly
var ChangelogLenientMatch = Confidence{50, ChangelogLenientMatchStr}
ChangelogLenientMatch is a ranking how confident the CVE-ID was deteted correctly
var CpeNameMatch = Confidence{100, CpeNameMatchStr}
CpeNameMatch is a ranking how confident the CVE-ID was deteted correctly
var PkgAuditMatch = Confidence{100, PkgAuditMatchStr}
PkgAuditMatch is a ranking how confident the CVE-ID was deteted correctly
var YumUpdateSecurityMatch = Confidence{100, YumUpdateSecurityMatchStr}
YumUpdateSecurityMatch is a ranking how confident the CVE-ID was deteted correctly
Functions ¶
This section is empty.
Types ¶
type Changelog ¶ added in v0.3.0
Changelog has contents of changelog and how to get it. Method: modesl.detectionMethodStr
type Confidence ¶ added in v0.3.0
Confidence is a ranking how confident the CVE-ID was deteted correctly Score: 0 - 100
func (Confidence) String ¶ added in v0.3.0
func (c Confidence) String() string
type CveInfo ¶
CveInfo has Cve Information.
func (*CveInfo) NilSliceToEmpty ¶ added in v0.3.0
func (c *CveInfo) NilSliceToEmpty()
NilSliceToEmpty set nil slice fields to empty slice to avoid null in JSON
type DistroAdvisory ¶
DistroAdvisory has Amazon Linux, RHEL, FreeBSD Security Advisory information.
type PackageInfo ¶
type PackageInfo struct { Name string Version string Release string NewVersion string NewRelease string Repository string Changelog Changelog }
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) FormatUpdatablePacksSummary ¶ added in v0.3.0
func (ps PackageInfoList) FormatUpdatablePacksSummary() string
FormatUpdatablePacksSummary returns a summary of updatable packages
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) 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 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 Errors []string 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) FormatServerName ¶ added in v0.3.0
func (r ScanResult) FormatServerName() string
FormatServerName returns server and container name
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 Confidence Confidence Packages PackageInfoList DistroAdvisories []DistroAdvisory // for Aamazon, RHEL, FreeBSD CpeNames []string }
VulnInfo holds a vulnerability information and unsecure packages
func (*VulnInfo) NilSliceToEmpty ¶ added in v0.3.0
func (v *VulnInfo) NilSliceToEmpty()
NilSliceToEmpty set nil slice fields to empty slice to avoid null in JSON