models

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advisory

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

	Severity        string
	Cves            []Cve
	Bugzillas       []Bugzilla
	AffectedCPEList []Cpe
	Issued          time.Time
	Updated         time.Time
}

Advisory : >definitions>definition>metadata>advisory

type AlpineSecDB

type AlpineSecDB struct {
	Distroversion string
	Reponame      string
	Urlprefix     string
	Apkurl        string
	Packages      []struct {
		Pkg struct {
			Name     string
			Secfixes map[string][]string
		}
	}
}

AlpineSecDB is a struct of alpine secdb

type Bugzilla

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

	BugzillaID string
	URL        string
	Title      string
}

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

type Cpe

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

	Cpe string
}

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

type Cve

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

	CveID  string
	Cvss2  string
	Cvss3  string
	Cwe    string
	Impact string
	Href   string
	Public string
}

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

type Debian

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

	CveID    string
	MoreInfo string `sql:"type:text"` // https://github.com/jinzhu/gorm/issues/510#issuecomment-180669092

	Date time.Time
}

Debian : >definitions>definition>metadata>debian

type Definition

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

	DefinitionID  string
	Title         string
	Description   string `sql:"type:text"`
	Advisory      Advisory
	Debian        Debian
	AffectedPacks []Package
	References    []Reference
}

Definition : >definitions>definition

func ConvertAlpineToModel

func ConvertAlpineToModel(data *AlpineSecDB) (defs []Definition)

ConvertAlpineToModel Convert OVAL to models

func ConvertAmazonToModel

func ConvertAmazonToModel(data *fetcher.UpdateInfo) (defs []Definition)

ConvertAmazonToModel Convert OVAL to models

func ConvertDebianToModel

func ConvertDebianToModel(root *oval.Root) (defs []Definition)

ConvertDebianToModel Convert OVAL to models

func ConvertRedHatToModel

func ConvertRedHatToModel(root *oval.Root) (defs []Definition)

ConvertRedHatToModel Convert OVAL to models

func ConvertUbuntuToModel

func ConvertUbuntuToModel(root *oval.Root) (defs []Definition)

ConvertUbuntuToModel Convert OVAL to models

type FetchMeta

type FetchMeta struct {
	ID uint `gorm:"primary_key"`

	FileName  string
	Timestamp time.Time
}

FetchMeta has metadata

type Package

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

	Name        string
	Version     string // affected earlier than this version
	Arch        string // Used for Amazon Linux
	NotFixedYet bool   // Ubuntu Only
}

Package affedted

type Reference

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

	Source string
	RefID  string
	RefURL string
}

Reference : >definitions>definition>metadata>reference

type Root

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

Root is root struct

func ConvertOracleToModel

func ConvertOracleToModel(root *oval.Root) (roots []Root)

ConvertOracleToModel Convert OVAL to models

func ConvertSUSEToModel

func ConvertSUSEToModel(root *oval.Root, suseType string) (roots []Root)

ConvertSUSEToModel Convert OVAL to models

Jump to

Keyboard shortcuts

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