xsagit

package
v0.0.0-...-9a7fc0b Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: GPL-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package xsagit has functionality related to the Xen Project Security Team's `xsa.git` tree; specifically, pulling XSA version and public release information from tags in the tree.

Index

Constants

View Source
const (
	XsaStateCreated      = XsaState(iota) // No tagged version, TreeAdvisory !Deallocated
	XsaStateDeallocated  = XsaState(iota) // Most recent tagged version is deallocated
	XsaStatePredisclosed = XsaState(iota) // Most recent tagged version is embargoed
	XsaStatePublic       = XsaState(iota) // Most recent tagged version is public
	XsaStateWithdrawn    = XsaState(iota) // Most recent tagged version is withdrawn
)

Variables

This section is empty.

Functions

func XSAToSignedAdvisory

func XSAToSignedAdvisory(xsanum int) string

XSAToSignedAdvisory generates the advisory filename from an XSA number.

Types

type VersionInfo

type VersionInfo struct {
	When     time.Time
	Hash     plumbing.Hash
	Advisory parseadvisory.Advisory
}

VersionInfo contains information about a particular XSA version: The time the version was created, the git hash which the version tags, and the contents of the advisory at that hash.

type XSARepoOpt

type XSARepoOpt func(*getXSARepoOpt) error

XSARepoOpt is used to pass options into GetAdvisories

func FilterXSANums

func FilterXSANums(xsanums ...int) XSARepoOpt

FilterXSANums will add a filter which only matches the listed XSA numbers. For example, the following will only get XSAs 436 and 437:

xsas, err := repo.GetAdvisories(xsagit.FilterXSANums(436, 437))

type XsaInfo

type XsaInfo struct {
	Xsa int
	// Versions is indexed by "real" version number; i.e., Versions[1] contains
	// information about v1.  This means Versions[0] is empty, and the total
	// number of versions is len(Versions)-1.
	Versions     []VersionInfo
	TreeAdvisory parseadvisory.Advisory // The advisory as checked in at the tip of the tree
	State        XsaState
	// Either the embargo time of the most recent version, or the version time
	// of the first non-embargoed version
	PublicReleaseTime time.Time
}

func (*XsaInfo) LatestVersion

func (xi *XsaInfo) LatestVersion() *VersionInfo

type XsaRepo

type XsaRepo struct {
	// contains filtered or unexported fields
}

func Open

func Open(path string) (*XsaRepo, error)

func (*XsaRepo) GetAdvisories

func (r *XsaRepo) GetAdvisories(options ...XSARepoOpt) (map[int]*XsaInfo, error)

GetAdvisories will parse advisories from the xsa.git repo, collating information about versions, current state (Created, Embargoed, Public), and public release time (either future of past).

func (*XsaRepo) GetFileReaderAtVersion

func (r *XsaRepo) GetFileReaderAtVersion(vi *VersionInfo, filename string) (io.ReadCloser, error)

func (*XsaRepo) WriteVersionFiles

func (r *XsaRepo) WriteVersionFiles(vi *VersionInfo, output string) error

type XsaState

type XsaState int

Jump to

Keyboard shortcuts

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