cvelistrepo

package
v0.0.0-...-239384d Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: BSD-3-Clause, CC-BY-4.0 Imports: 18 Imported by: 0

Documentation

Overview

Package cvelistrepo supports working with the repo containing the list of CVEs.

Index

Constants

View Source
const (
	URLv4 = "https://github.com/CVEProject/cvelist"
	URLv5 = "https://github.com/CVEProject/cvelistV5"
)

URLs of the CVE project list repos.

Variables

This section is empty.

Functions

func FetchCVE

func FetchCVE(ctx context.Context, repo *git.Repository, cveID string, cve CVE) (err error)

FetchCVE fetches the CVE file for cveID from the CVElist repo and returns the parsed info.

func Parse

func Parse(repo *git.Repository, f File, v any) error

Parse unmarshals the contents of f into v.

func WriteTxtarRepo

func WriteTxtarRepo(ctx context.Context, url string, filename string, cveIDs []string) error

WriteTxtarRepo downloads the given CVEs from the CVE list (v4 or v5) in url, and writes them as a txtar repo to filename.

Intended for testing.

Types

type CVE

type CVE any

type File

type File struct {
	DirPath  string
	Filename string
	TreeHash plumbing.Hash
	BlobHash plumbing.Hash
	Year     int
	Number   int
}

A File is a file in the cvelist repo that contains a CVE.

func Files

func Files(repo *git.Repository, commit *object.Commit) (_ []File, err error)

Files returns all the CVE files in the given repo commit, sorted by name.

func (*File) ReadAll

func (f *File) ReadAll(repo *git.Repository) ([]byte, error)

Jump to

Keyboard shortcuts

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