suse

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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToModel

func ConvertToModel(xmlName string, root *Root) (map[string][]models.Definition, error)

ConvertToModel Convert OVAL to models

Types

type Advisory

type Advisory struct {
	XMLName         xml.Name   `xml:"advisory"`
	Severity        string     `xml:"severity"`
	Cves            []Cve      `xml:"cve"`
	Bugzillas       []Bugzilla `xml:"bugzilla"`
	AffectedCPEList []string   `xml:"affected_cpe_list>cpe"`
	Issued          struct {
		Date string `xml:"date,attr"`
	} `xml:"issued"`
	Updated struct {
		Date string `xml:"date,attr"`
	} `xml:"updated"`
}

Advisory : >definitions>definition>metadata>advisory RedHat and Ubuntu OVAL

type Affected

type Affected struct {
	XMLName   xml.Name `xml:"affected"`
	Family    string   `xml:"family,attr"`
	Platforms []string `xml:"platform"`
}

Affected : >definitions>definition>metadata>affected

type Bugzilla

type Bugzilla struct {
	XMLName xml.Name `xml:"bugzilla"`
	URL     string   `xml:"href,attr"`
	Title   string   `xml:",chardata"`
}

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

type Criteria

type Criteria struct {
	XMLName    xml.Name    `xml:"criteria"`
	Operator   string      `xml:"operator,attr"`
	Criterias  []Criteria  `xml:"criteria"`
	Criterions []Criterion `xml:"criterion"`
}

Criteria : >definitions>definition>criteria

type Criterion

type Criterion struct {
	XMLName xml.Name `xml:"criterion"`
	TestRef string   `xml:"test_ref,attr"`
	Comment string   `xml:"comment,attr"`
}

Criterion : >definitions>definition>criteria>*>criterion

type Cve

type Cve struct {
	XMLName xml.Name `xml:"cve"`
	CveID   string   `xml:",chardata"`
	Cvss3   string   `xml:"cvss3,attr"`
	Impact  string   `xml:"impact,attr"`
	Href    string   `xml:"href,attr"`
}

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

type Definition

type Definition struct {
	XMLName     xml.Name    `xml:"definition"`
	ID          string      `xml:"id,attr"`
	Class       string      `xml:"class,attr"`
	Title       string      `xml:"metadata>title"`
	Affecteds   []Affected  `xml:"metadata>affected"`
	References  []Reference `xml:"metadata>reference"`
	Description string      `xml:"metadata>description"`
	Advisory    Advisory    `xml:"metadata>advisory"`
	Criteria    Criteria    `xml:"criteria"`
}

Definition : >definitions>definition

type Definitions

type Definitions struct {
	XMLName     xml.Name     `xml:"definitions"`
	Definitions []Definition `xml:"definition"`
}

Definitions : >definitions

type Generator

type Generator struct {
	XMLName       xml.Name `xml:"generator"`
	ProductName   string   `xml:"product_name"`
	SchemaVersion string   `xml:"schema_version"`
	Timestamp     string   `xml:"timestamp"`
}

Generator : >generator

type ObjectRef

type ObjectRef struct {
	XMLName   xml.Name `xml:"object"`
	Text      string   `xml:",chardata"`
	ObjectRef string   `xml:"object_ref,attr"`
}

ObjectRef : >tests>rpminfo_test>object-object_ref

type Objects

type Objects struct {
	XMLName       xml.Name        `xml:"objects"`
	RpminfoObject []RpminfoObject `xml:"rpminfo_object"`
}

Objects : >objects

type Reference

type Reference struct {
	XMLName xml.Name `xml:"reference"`
	Source  string   `xml:"source,attr"`
	RefID   string   `xml:"ref_id,attr"`
	RefURL  string   `xml:"ref_url,attr"`
}

Reference : >definitions>definition>metadata>reference

type Root

type Root struct {
	XMLName     xml.Name    `xml:"oval_definitions"`
	Generator   Generator   `xml:"generator"`
	Definitions Definitions `xml:"definitions"`
	Tests       Tests       `xml:"tests"`
	Objects     Objects     `xml:"objects"`
	States      States      `xml:"states"`
}

Root : root object

type RpminfoObject

type RpminfoObject struct {
	ID   string `xml:"id,attr"`
	Name string `xml:"name"`
}

RpminfoObject : >objects>rpminfo_object

type RpminfoState

type RpminfoState struct {
	ID             string         `xml:"id,attr"`
	SignatureKeyid SignatureKeyid `xml:"signature_keyid"`
	Version        struct {
		Text      string `xml:",chardata"`
		Operation string `xml:"operation,attr"`
	} `xml:"version"`
	Arch struct {
		Text      string `xml:",chardata"`
		Datatype  string `xml:"datatype,attr"`
		Operation string `xml:"operation,attr"`
	} `xml:"arch"`
	Evr struct {
		Text      string `xml:",chardata"`
		Datatype  string `xml:"datatype,attr"`
		Operation string `xml:"operation,attr"`
	} `xml:"evr"`
}

RpminfoState : >states>rpminfo_state

type RpminfoTest

type RpminfoTest struct {
	ID      string    `xml:"id,attr"`
	Comment string    `xml:"comment,attr"`
	Check   string    `xml:"check,attr"`
	Object  ObjectRef `xml:"object"`
	State   StateRef  `xml:"state"`
}

RpminfoTest : >tests>rpminfo_test

type SignatureKeyid

type SignatureKeyid struct {
	Text      string `xml:",chardata"`
	Operation string `xml:"operation,attr"`
}

SignatureKeyid : >states>rpminfo_state>signature_keyid

type StateRef

type StateRef struct {
	XMLName  xml.Name `xml:"state"`
	Text     string   `xml:",chardata"`
	StateRef string   `xml:"state_ref,attr"`
}

StateRef : >tests>rpminfo_test>state-state_ref

type States

type States struct {
	XMLName      xml.Name       `xml:"states"`
	RpminfoState []RpminfoState `xml:"rpminfo_state"`
}

States : >states

type Tests

type Tests struct {
	XMLName     xml.Name      `xml:"tests"`
	RpminfoTest []RpminfoTest `xml:"rpminfo_test"`
}

Tests : >tests

Jump to

Keyboard shortcuts

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