models

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const LatestSchemaVersion = 2

LatestSchemaVersion manages the Schema version used in the latest goval-dictionary.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advisory

type Advisory struct {
	ID           uint `gorm:"primary_key" json:"-"`
	DefinitionID uint `gorm:"index:idx_advisories_definition_id" json:"-" xml:"-"`

	Severity           string `gorm:"type:varchar(255)"`
	Cves               []Cve
	Bugzillas          []Bugzilla
	AffectedCPEList    []Cpe
	AffectedRepository string `gorm:"type:varchar(255)"` // Amazon Linux 2 Only
	Issued             time.Time
	Updated            time.Time
}

Advisory : >definitions>definition>metadata>advisory

type Bugzilla

type Bugzilla struct {
	ID         uint `gorm:"primary_key" json:"-"`
	AdvisoryID uint `gorm:"index:idx_bugzillas_advisory_id" json:"-" xml:"-"`

	BugzillaID string `gorm:"type:varchar(255)"`
	URL        string `gorm:"type:varchar(255)"`
	Title      string `gorm:"type:varchar(255)"`
}

Bugzilla : >definitions>definition>metadata>advisory>bugzilla

type Cpe

type Cpe struct {
	ID         uint `gorm:"primary_key" json:"-"`
	AdvisoryID uint `gorm:"index:idx_cpes_advisory_id" json:"-" xml:"-"`

	Cpe string `gorm:"type:varchar(255)"`
}

Cpe : >definitions>definition>metadata>advisory>affected_cpe_list

type Cve

type Cve struct {
	ID         uint `gorm:"primary_key" json:"-"`
	AdvisoryID uint `gorm:"index:idx_cves_advisory_id" json:"-" xml:"-"`

	CveID  string `gorm:"type:varchar(255)"`
	Cvss2  string `gorm:"type:varchar(255)"`
	Cvss3  string `gorm:"type:varchar(255)"`
	Cwe    string `gorm:"type:varchar(255)"`
	Impact string `gorm:"type:varchar(255)"`
	Href   string `gorm:"type:varchar(255)"`
	Public string `gorm:"type:varchar(255)"`
}

Cve : >definitions>definition>metadata>advisory>cve

type Debian

type Debian struct {
	ID           uint `gorm:"primary_key" json:"-"`
	DefinitionID uint `gorm:"index:idx_debian_definition_id" json:"-" xml:"-"`

	MoreInfo string `gorm:"type:text"`

	Date time.Time
}

Debian : >definitions>definition>metadata>debian

type Definition

type Definition struct {
	ID     uint `gorm:"primary_key" json:"-"`
	RootID uint `gorm:"index:idx_definition_root_id" json:"-" xml:"-"`

	DefinitionID  string `gorm:"type:varchar(255)"`
	Title         string `gorm:"type:text"`
	Description   string // If the type:text, varchar(255) is specified, MySQL overflows and gives an error. No problem in GORMv2. (https://github.com/go-gorm/mysql/tree/15e2cbc6fd072be99215a82292e025dab25e2e16#configuration)
	Advisory      Advisory
	Debian        *Debian
	AffectedPacks []Package
	References    []Reference
}

Definition : >definitions>definition

type FetchMeta

type FetchMeta struct {
	gorm.Model        `json:"-"`
	GovalDictRevision string
	SchemaVersion     uint
	LastFetchedAt     time.Time
}

FetchMeta has DB information

func (FetchMeta) OutDated added in v0.6.0

func (f FetchMeta) OutDated() bool

OutDated checks whether last fetched feed is out dated

type Package

type Package struct {
	ID           uint `gorm:"primary_key" json:"-"`
	DefinitionID uint `gorm:"index:idx_packages_definition_id" json:"-" xml:"-"`

	Name            string `gorm:"index:idx_packages_name"` // If the type:text, varchar(255) is specified, MySQL overflows and gives an error. No problem in GORMv2. (https://github.com/go-gorm/mysql/tree/15e2cbc6fd072be99215a82292e025dab25e2e16#configuration)
	Version         string `gorm:"type:varchar(255)"`       // affected earlier than this version
	Arch            string `gorm:"type:varchar(255)"`       // Used for Amazon Linux, Oracle Linux and Fedora
	NotFixedYet     bool   // Ubuntu Only
	ModularityLabel string `gorm:"type:varchar(255)"` // RHEL 8 or later only
}

Package affected

type Reference

type Reference struct {
	ID           uint `gorm:"primary_key" json:"-"`
	DefinitionID uint `gorm:"index:idx_reference_definition_id" json:"-" xml:"-"`

	Source string `gorm:"type:varchar(255)"`
	RefID  string `gorm:"type:varchar(255)"`
	RefURL string `gorm:"type:text"`
}

Reference : >definitions>definition>metadata>reference

type Root

type Root struct {
	ID          uint   `gorm:"primary_key"`
	Family      string `gorm:"type:varchar(255)"`
	OSVersion   string `gorm:"type:varchar(255)"`
	Definitions []Definition
	Timestamp   time.Time
}

Root is root struct

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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