models

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DebianCVE

type DebianCVE struct {
	ID          int64
	CveID       string
	Scope       string
	Description string `sql:"type:text"`
	Package     []DebianPackage
}

type DebianCveJSON

type DebianCveJSON struct {
	Scope       string                       `json:"scope"`
	Debianbug   int                          `json:"debianbug"`
	Description string                       `json:"description"`
	Releases    map[string]DebianReleaseJSON `json:"releases"`
}

type DebianCveMap

type DebianCveMap map[string]DebianCveJSON

type DebianJSON

type DebianJSON map[string]DebianCveMap

type DebianPackage

type DebianPackage struct {
	ID          int64
	DebianCVEID int64 `sql:"type:bigint REFERENCES debian_cves(id)"`
	PackageName string
	Release     []DebianRelease
}

type DebianRelease

type DebianRelease struct {
	ID              int64
	DebianPackageID int64 `sql:"type:bigint REFERENCES debian_packages(id)"`
	ProductName     string
	Status          string
	FixedVersion    string
	Urgency         string
	Version         string
}

type DebianReleaseJSON

type DebianReleaseJSON struct {
	Status       string            `json:"status"`
	Repositories map[string]string `json:"repositories"`
	FixedVersion string            `json:"fixed_version"`
	Urgency      string            `json:"urgency"`
}

type MicrosoftBulletinSearch added in v0.1.5

type MicrosoftBulletinSearch struct {
	DatePosted        string `xlsx:"0"`
	BulletinID        string `xlsx:"1"`
	BulletinKB        string `xlsx:"2"`
	Severity          string `xlsx:"3"`
	Impact            string `xlsx:"4"`
	Title             string `xlsx:"5"`
	AffectedProduct   string `xlsx:"6"`
	ComponentKB       string `xlsx:"7"`
	AffectedComponent string `xlsx:"8"`
	Supersedes        string `xlsx:"11"`
	Reboot            string `xlsx:"12"`
	CVEs              string `xlsx:"13"`
}

MicrosoftBulletinSearch :

type MicrosoftCVE added in v0.1.5

type MicrosoftCVE struct {
	ID                       int64                    `json:",omitempty"`
	Title                    string                   `json:"title"`
	Description              string                   `json:"description"`
	FAQ                      string                   `json:"faq"`
	CveID                    string                   `json:"cve_id"`
	CWE                      string                   `json:"cwe"`
	MicrosoftProductStatuses []MicrosoftProductStatus `json:"microsoft_product_statuses"`
	Impact                   []MicrosoftThreat        `json:"impact"`
	Severity                 []MicrosoftThreat        `json:"severity"`
	ExploitStatus            string                   `json:"exploit_status"`
	Mitigation               string                   `json:"mitigation"`
	Workaround               string                   `json:"workaround"`
	VendorFix                []MicrosoftRemediation   `json:"vendor_fix"`
	NoneAvailable            []MicrosoftRemediation   `json:"none_available"`
	WillNotFix               []MicrosoftRemediation   `json:"will_not_fix"`
	KBIDs                    []MicrosoftKBID          `json:"kb_ids"`
	References               []MicrosoftReference     `json:"references"`
	ScoreSets                []MicrosoftScoreSet      `json:"score_sets"`
	PublishDate              time.Time                `json:"publish_date"`
	LastUpdateDate           time.Time                `json:"last_update_date"`
}

MicrosoftCVE :

type MicrosoftCveID added in v0.1.5

type MicrosoftCveID struct {
	MicrosoftCVEID int64  `sql:"type:bigint REFERENCES microsoft_cves(id)" json:",omitempty"`
	CveID          string `json:"cve_id"`
}

MicrosoftCveID :

type MicrosoftKBID added in v0.1.5

type MicrosoftKBID struct {
	MicrosoftCVEID int64  `sql:"type:bigint REFERENCES microsoft_cves(id)" json:",omitempty"`
	KBID           string `json:"kb_id"`
}

MicrosoftKBID :

type MicrosoftProduct added in v0.1.5

type MicrosoftProduct struct {
	MicrosoftCVEID int64  `sql:"type:bigint REFERENCES microsoft_cves(id)" json:",omitempty"`
	ProductID      string `json:"product_id"`
	ProductName    string `json:"product_name"`
}

MicrosoftProduct :

type MicrosoftProductStatus added in v0.1.5

type MicrosoftProductStatus struct {
	MicrosoftCVEID int64              `sql:"type:bigint REFERENCES microsoft_cves(id)" json:",omitempty"`
	Products       []MicrosoftProduct `json:"products"`
	ProductStatus  string             `json:"product_status"`
}

MicrosoftProductStatus :

type MicrosoftReference added in v0.1.5

type MicrosoftReference struct {
	MicrosoftCVEID int64 `sql:"type:bigint REFERENCES microsoft_cves(id)" json:",omitempty"`
	// External, Self
	AttrType    string `json:"type"`
	URL         string `json:"url"`
	Description string `json:"description"`
}

MicrosoftReference :

type MicrosoftRemediation added in v0.1.5

type MicrosoftRemediation struct {
	MicrosoftCVEID  int64              `sql:"type:bigint REFERENCES microsoft_cves(id)" json:",omitempty"`
	Description     string             `json:"description"`
	Products        []MicrosoftProduct `json:"products"`
	Entitlement     string             `json:"entitlement"`
	RestartRequired string             `json:"restart_required"`
	SubType         string             `json:"sub_type"`
	Supercedence    string             `json:"supercedence"`
	URL             string             `json:"url"`
}

MicrosoftRemediation :

type MicrosoftScoreSet added in v0.1.5

type MicrosoftScoreSet struct {
	MicrosoftCVEID     int64              `sql:"type:bigint REFERENCES microsoft_cves(id)" json:",omitempty"`
	BaseScore          float64            `json:"base_score"`
	TemporalScore      float64            `json:"temporal_score"`
	EnvironmentalScore float64            `json:"environmental_score"`
	Vector             string             `json:"vector"`
	Products           []MicrosoftProduct `json:"products"`
}

MicrosoftScoreSet :

type MicrosoftThreat added in v0.1.5

type MicrosoftThreat struct {
	MicrosoftCVEID int64              `sql:"type:bigint REFERENCES microsoft_cves(id)" json:",omitempty"`
	Description    string             `json:"description"`
	Products       []MicrosoftProduct `json:"products"`
}

MicrosoftThreat :

type MicrosoftXML added in v0.1.5

type MicrosoftXML struct {
	XMLName             xml.Name `xml:"cvrfdoc"`
	AttrXmlnsCpeLang    string   `xml:"xmlns cpe-lang,attr"`
	AttrXmlnsCvrf       string   `xml:"xmlns cvrf,attr"`
	AttrXmlnsCvrfCommon string   `xml:"xmlns cvrf-common,attr"`
	AttrXmlnsCvssv2     string   `xml:"xmlns cvssv2,attr"`
	AttrXmlnsDc         string   `xml:"xmlns dc,attr"`
	AttrXmlnsProd       string   `xml:"xmlns prod,attr"`
	AttrXmlnsScapCore   string   `xml:"xmlns scap-core,attr"`
	AttrXmlnsSch        string   `xml:"xmlns sch,attr"`
	AttrXmlnsVuln       string   `xml:"xmlns vuln,attr"`
	DocumentTitle       string   `xml:"DocumentTitle"`
	DocumentType        string   `xml:"DocumentType"`
	DocumentPublisher   *struct {
		AttrType         string `xml:"Type,attr"`
		ContactDetails   string `xml:"ContactDetails"`
		IssuingAuthority string `xml:"IssuingAuthority"`
	} `xml:"DocumentPublisher"`
	DocumentTracking *struct {
		ID    string `xml:"Identification>ID"`
		Alias string `xml:"Identification>Alias"`
		// Draft, Interim, Final
		Status string `xml:"Status"`
		// (0|[1-9][0-9]*)(\.(0|[1-9][0-9]*)){0,3}.
		Version         string `xml:"Version"`
		RevisionHistory []struct {
			Number      float64 `xml:"Number"`
			Date        Mstime  `xml:"Date"`
			Description string  `xml:"Description"`
		} `xml:"RevisionHistory>Revision"`
		InitialReleaseDate Mstime `xml:"InitialReleaseDate"`
		CurrentReleaseDate Mstime `xml:"CurrentReleaseDate"`
		Generator          struct {
			Engine string `xml:"Engine"`
			Date   Mstime `xml:"Date"`
		} `xml:"Generator"`
	} `xml:"DocumentTracking"`
	DocumentNotes []struct {
		Value        string `xml:",chardata"`
		AttrAudience string `xml:"Audience,attr"`
		AttrOrdinal  string `xml:"Ordinal,attr"`
		AttrTitle    string `xml:"Title,attr"`
		AttrType     string `xml:"Type,attr"`
	} `xml:"DocumentNotes>Note"`
	DocumentDistribution string `xml:"DocumentDistribution"`
	AggregateSeverity    string `xml:"AggregateSeverity"`
	DocumentReferences   []struct {
		AttrType    string `xml:"Type,attr"`
		URL         string `xml:"URL"`
		Description string `xml:"Description"`
	} `xml:"DocumentReferences>Reference"`
	Acknowledgments []struct {
		Name         string `xml:"Name"`
		Organization string `xml:"Organization"`
		URL          string `xml:"URL"`
		Description  string `xml:"Description"`
	} `xml:"Acknowledgments>Acknowledgment"`
	ProductTree *struct {
		Branch *struct {
			AttrName        string `xml:"Name,attr"`
			AttrType        string `xml:"Type,attr"`
			FullProductName []struct {
				Value         string `xml:",chardata"`
				AttrProductID string `xml:"ProductID,attr"`
				AttrCpe       string `xml:"CPE,attr"`
			} `xml:"FullProductName"`
		} `xml:"Branch"`
		FullProductName []struct {
			Value         string `xml:",chardata"`
			AttrProductID string `xml:"ProductID,attr"`
			AttrCpe       string `xml:"CPE,attr"`
		} `xml:"FullProductName"`
		Relationship struct {
			AttrProductReference          string `xml:"ProductReference,attr"`
			AttrRelationshipType          string `xml:"RelationshipType,attr"`
			AttrRelatesToProductReference string `xml:"RelatesToProductReference,attr"`
			FullProductName               []struct {
				Value         string `xml:",chardata"`
				AttrProductID string `xml:"ProductID,attr"`
				AttrCpe       string `xml:"CPE,attr"`
			} `xml:"FullProductName"`
		} `xml:"Relationship"`
		ProductGroups []struct {
			Description string   `xml:"Description"`
			ProductID   []string `xml:"ProductID"`
		} `xml:"ProductGroups>Group"`
	} `xml:"ProductTree"`
	Vulnerability []struct {
		AttrOrdinal string `xml:"Ordinal,attr"`
		Title       string `xml:"Title"`
		ID          string `xml:"ID"`
		Notes       []struct {
			Value       string `xml:",chardata"`
			AttrOrdinal string `xml:"Ordinal,attr"`
			AttrTitle   string `xml:"Title,attr"`
			// General, Details, Description, Summary, FAQ, Legal Disclaimer, Other,
			AttrType     string `xml:"Type,attr"`
			AttrAudience string `xml:"Audience,attr"`
		} `xml:"Notes>Note"`
		DiscoveryDate Mstime `xml:"DiscoveryDate"`
		ReleaseDate   Mstime `xml:"ReleaseDate"`
		Involvements  []struct {
			// Vendor, Discoverer, Coordinator, User, Other
			Party string `xml:"Party,attr"`
			// Open, Disputed, In Progress, Completed, Contact Attempted, Not Contacted
			Status      string `xml:"Status,attr"`
			Description string `xml:"Description"`
		} `xml:"Involvements>Involvement"`
		Description     string `xml:"Description"`
		CVE             string `xml:"CVE"`
		CWE             string `xml:"CWE"`
		ProductStatuses []struct {
			// First Affected, Known Affected, Known Not Affected, First Fixed, Fixed, Recommended, Last Affected,
			AttrType  string   `xml:"Type,attr"`
			ProductID []string `xml:"ProductID"`
		} `xml:"ProductStatuses>Status"`
		Threats []struct {
			// Impact, Exploit Status, Target Set
			AttrType    string   `xml:"Type,attr"`
			AttrDate    Mstime   `xml:"Date,attr"`
			Description string   `xml:"Description"`
			GroupID     string   `xml:"GroupID"`
			ProductID   []string `xml:"ProductID"`
		} `xml:"Threats>Threat"`
		CVSSScoreSets []struct {
			// 0.0 – 10.0
			BaseScore float64 `xml:"BaseScore"`
			// 0.0 – 10.0
			TemporalScore float64 `xml:"TemporalScore"`
			// 0.0 – 10.0
			EnvironmentalScore float64 `xml:"EnvironmentalScore"`
			// 76 characters
			Vector    string   `xml:"Vector"`
			ProductID []string `xml:"ProductID"`
		} `xml:"CVSSScoreSets>ScoreSet"`
		Remediations []struct {
			// Workaround, Mitigation, Vendor Fix, None Available, Will Not Fix
			AttrType        string   `xml:"Type,attr"`
			AffectedFiles   []string `xml:"AffectedFiles>AffectedFile"`
			Description     string   `xml:"Description"`
			ProductID       []string `xml:"ProductID"`
			Entitlement     string   `xml:"Entitlement"`
			GroupID         string   `xml:"GroupID"`
			RestartRequired string   `xml:"RestartRequired"`
			SubType         string   `xml:"SubType"`
			Supercedence    string   `xml:"Supercedence"`
			URL             string   `xml:"URL"`
		} `xml:"Remediations>Remediation"`
		References []struct {
			// External, Self
			AttrType    string `xml:"Type,attr"`
			URL         string `xml:"URL"`
			Description string `xml:"Description"`
		} `xml:"References>Reference"`
		Acknowledgments []struct {
			Name         string `xml:"Name"`
			Organization string `xml:"Organization"`
			URL          string `xml:"URL"`
			Description  string `xml:"Description"`
		} `xml:"Acknowledgments>Acknowledgment"`
		RevisionHistory []struct {
			Date        Mstime  `xml:"Date"`
			Description string  `xml:"Description"`
			Number      float64 `xml:"Number"`
		} `xml:"RevisionHistory>Revision"`
	} `xml:"Vulnerability"`
}

MicrosoftXML : http://www.icasi.org/cvrf-v1-1-dictionary-of-elements/

type Mstime added in v0.1.5

type Mstime struct {
	time.Time
}

Mstime :

func (*Mstime) UnmarshalXML added in v0.1.5

func (m *Mstime) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML :

type RedhatAffectedRelease

type RedhatAffectedRelease struct {
	RedhatCVEID int64  `sql:"type:bigint REFERENCES redhat_cves(id)" json:",omitempty"`
	ProductName string `json:"product_name"`
	ReleaseDate string `json:"release_date"`
	Advisory    string `json:"advisory"`
	Package     string `json:"package"`
	Cpe         string `json:"cpe"`
}

type RedhatBugzilla

type RedhatBugzilla struct {
	RedhatCVEID int64  `sql:"type:bigint REFERENCES redhat_cves(id)" json:",omitempty"`
	Description string `json:"description" sql:"type:text"`

	BugzillaID string `json:"id"`
	URL        string `json:"url"`
}

type RedhatCVE

type RedhatCVE struct {
	ID int64 `json:",omitempty"`

	// gorm can't handle embedded struct
	ThreatSeverity       string
	PublicDate           time.Time
	Bugzilla             RedhatBugzilla
	Cvss                 RedhatCvss
	Cvss3                RedhatCvss3
	Iava                 string
	Cwe                  string
	Statement            string `sql:"type:text"`
	Acknowledgement      string `sql:"type:text"`
	Mitigation           string `sql:"type:text"`
	AffectedRelease      []RedhatAffectedRelease
	PackageState         []RedhatPackageState
	Name                 string
	DocumentDistribution string `sql:"type:text"`

	Details    []RedhatDetail    `json:",omitempty"`
	References []RedhatReference `json:",omitempty"`
}

func (RedhatCVE) GetDetail

func (r RedhatCVE) GetDetail(sep string) string

func (RedhatCVE) GetPackages

func (r RedhatCVE) GetPackages(sep string) (result string)

type RedhatCVEJSON

type RedhatCVEJSON struct {
	ThreatSeverity       string         `json:"threat_severity"`
	PublicDate           string         `json:"public_date"`
	Bugzilla             RedhatBugzilla `json:"bugzilla"`
	Cvss                 RedhatCvss     `json:"cvss"`
	Cvss3                RedhatCvss3    `json:"cvss3"`
	Iava                 string         `json:"iava"`
	Cwe                  string         `json:"cwe"`
	Statement            string         `json:"statement"`
	Acknowledgement      string         `json:"acknowledgement"`
	Mitigation           string         `json:"mitigation"`
	TempAffectedRelease  interface{}    `json:"affected_release"` // affected_release is array or object
	AffectedRelease      []RedhatAffectedRelease
	TempPackageState     interface{} `json:"package_state"` // package_state is array or object
	PackageState         []RedhatPackageState
	Name                 string `json:"name"`
	DocumentDistribution string `json:"document_distribution"`

	Details    []string `json:"details" gorm:"-"`
	References []string `json:"references" gorm:"-"`
}

type RedhatCVEJSONAffectedReleaseArray

type RedhatCVEJSONAffectedReleaseArray struct {
	AffectedRelease []RedhatAffectedRelease `json:"affected_release"`
}

type RedhatCVEJSONAffectedReleaseObject

type RedhatCVEJSONAffectedReleaseObject struct {
	AffectedRelease RedhatAffectedRelease `json:"affected_release"`
}

type RedhatCVEJSONPackageStateArray

type RedhatCVEJSONPackageStateArray struct {
	PackageState []RedhatPackageState `json:"package_state"`
}

type RedhatCVEJSONPackageStateObject

type RedhatCVEJSONPackageStateObject struct {
	PackageState RedhatPackageState `json:"package_state"`
}

type RedhatCvss

type RedhatCvss struct {
	RedhatCVEID       int64  `sql:"type:bigint REFERENCES redhat_cves(id)" json:",omitempty"`
	CvssBaseScore     string `json:"cvss_base_score"`
	CvssScoringVector string `json:"cvss_scoring_vector"`
	Status            string `json:"status"`
}

type RedhatCvss3

type RedhatCvss3 struct {
	RedhatCVEID        int64  `sql:"type:bigint REFERENCES redhat_cves(id)" json:",omitempty"`
	Cvss3BaseScore     string `json:"cvss3_base_score"`
	Cvss3ScoringVector string `json:"cvss3_scoring_vector"`
	Status             string `json:"status"`
}

type RedhatDetail

type RedhatDetail struct {
	RedhatCVEID int64  `sql:"type:bigint REFERENCES redhat_cves(id)" json:",omitempty"`
	Detail      string `sql:"type:text"`
}

type RedhatEntry

type RedhatEntry struct {
	CveID             string        `json:"CVE"`
	Severity          string        `json:"severity"`
	PublicDate        time.Time     `json:"public_date"`
	Advisories        []interface{} `json:"advisories"`
	Bugzilla          string        `json:"bugzilla"`
	CvssScore         interface{}   `json:"cvss_score"`
	CvssScoringVector interface{}   `json:"cvss_scoring_vector"`
	CWE               string        `json:"CWE"`
	AffectedPackages  []interface{} `json:"affected_packages"`
	ResourceURL       string        `json:"resource_url"`
	Cvss3Score        float64       `json:"cvss3_score"`
}

type RedhatPackageState

type RedhatPackageState struct {
	RedhatCVEID int64  `sql:"type:bigint REFERENCES redhat_cves(id)" json:",omitempty"`
	ProductName string `json:"product_name"`
	FixState    string `json:"fix_state"`
	PackageName string `json:"package_name"`
	Cpe         string `json:"cpe"`
}

type RedhatReference

type RedhatReference struct {
	RedhatCVEID int64  `sql:"type:bigint REFERENCES redhat_cves(id)" json:",omitempty"`
	Reference   string `sql:"type:text"`
}

type Updatelist added in v0.1.5

type Updatelist struct {
	Value []struct {
		ID                 string    `json:"ID"`
		Alias              string    `json:"Alias"`
		DocumentTitle      string    `json:"DocumentTitle"`
		Severity           string    `json:"Severity"`
		InitialReleaseDate time.Time `json:"InitialReleaseDate"`
		CurrentReleaseDate time.Time `json:"CurrentReleaseDate"`
		CvrfURL            string    `json:"CvrfUrl"`
	} `json:"value"`
}

Updatelist :

Jump to

Keyboard shortcuts

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