Documentation ¶
Overview ¶
Package types defines useful types that are used in database models.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // MinVersion is a special package version which is always sorted first MinVersion = Version{/* contains filtered or unexported fields */} // MaxVersion is a special package version which is always sorted last MaxVersion = Version{/* contains filtered or unexported fields */} )
var Priorities = []Priority{Unknown, Negligible, Low, Medium, High, Critical, Defcon1}
Priorities lists all known priorities, ordered from lower to higher
Functions ¶
This section is empty.
Types ¶
type Priority ¶
type Priority string
Priority defines a vulnerability priority
const ( // Unknown is either a security problem that has not been // assigned to a priority yet or a priority that our system // did not recognize Unknown Priority = "Unknown" // Negligible is technically a security problem, but is // only theoretical in nature, requires a very special // situation, has almost no install base, or does no real // damage. These tend not to get backport from upstreams, // and will likely not be included in security updates unless // there is an easy fix and some other issue causes an update. Negligible Priority = "Negligible" // Low is a security problem, but is hard to // exploit due to environment, requires a user-assisted // attack, a small install base, or does very little damage. // These tend to be included in security updates only when // higher priority issues require an update, or if many // low priority issues have built up. Low Priority = "Low" // Medium is a real security problem, and is exploitable // for many people. Includes network daemon denial of service // attacks, cross-site scripting, and gaining user privileges. // Updates should be made soon for this priority of issue. Medium Priority = "Medium" // High is a real problem, exploitable for many people in a default // installation. Includes serious remote denial of services, // local root privilege escalations, or data loss. High Priority = "High" // Critical is a world-burning problem, exploitable for nearly all people // in a default installation of Linux. Includes remote root // privilege escalations, or massive data loss. Critical Priority = "Critical" // Defcon1 is a Critical problem which has been manually highlighted by // the team. It requires an immediate attention. Defcon1 Priority = "Defcon1" )
type Version ¶
type Version struct {
// contains filtered or unexported fields
}
Version represents a package version
func NewVersion ¶
NewVersion function parses a string into a Version struct which can be compared
The implementation is based on http://man.he.net/man5/deb-version on https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version
It uses the dpkg-1.17.25's algorithm (lib/parsehelp.c)
func NewVersionUnsafe ¶
NewVersionUnsafe is just a wrapper around NewVersion that ignore potentiel parsing error. Useful for test purposes
func (Version) Compare ¶
Compare function compares two Debian-like package version
The implementation is based on http://man.he.net/man5/deb-version on https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version
It uses the dpkg-1.17.25's algorithm (lib/version.c)