vulnerability_db

package
v0.0.0-...-a87dae0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version3 = "3"
	Version5 = "5"
)

Variables

View Source
var (
	ListingJson           = "listing.json"
	VulnerabilityDbStore  = "vulnerability"
	ListingPath           = path.Join(VulnerabilityDbStore, ListingJson)
	TOAE_THREAT_INTEL_URL = "https://threat-intel.toae.io/vulnerability-db/listing.json"
)

Functions

func DownloadDatabase

func DownloadDatabase()

func UpdateListing

func UpdateListing(newFile, newFileCheckSum string, buildTime time.Time)

func UploadToMinio

func UploadToMinio(ctx context.Context, fb []byte, fName string) (string, string, error)

Types

type DBUploadRequest

type DBUploadRequest struct {
	Database multipart.File `formData:"database" json:"database" validate:"required" required:"true"`
}

type Database

type Database struct {
	Built    time.Time `json:"built"`
	Version  int       `json:"version"`
	URL      string    `json:"url"`
	Checksum string    `json:"checksum"`
}

type VulnerabilityDBListing

type VulnerabilityDBListing struct {
	Available map[string][]Database `json:"available"`
}

func LoadListing

func LoadListing(d []byte) (*VulnerabilityDBListing, error)

func NewVulnerabilityDBListing

func NewVulnerabilityDBListing() *VulnerabilityDBListing

func (*VulnerabilityDBListing) Append

func (v *VulnerabilityDBListing) Append(db Database, version string)

func (*VulnerabilityDBListing) Bytes

func (v *VulnerabilityDBListing) Bytes() ([]byte, error)

func (*VulnerabilityDBListing) Latest

func (v *VulnerabilityDBListing) Latest(version string) *Database

func (*VulnerabilityDBListing) Sort

func (v *VulnerabilityDBListing) Sort(version string)

Jump to

Keyboard shortcuts

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