postgresmodels

package
v0.0.210 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttackChainNode added in v0.0.205

type AttackChainNode struct {
	gorm.Model            // ID, CreatedAt, UpdatedAt, DeletedAt - ID is required for linking nodes
	Name          string  `gorm:"not null"`
	Description   *string `gorm:"type:varchar(255)" `
	AttackChainID string  `gorm:"not null"` // hash of cluster/resourceID
	CustomerGUID  string  `gorm:"not null"`
	IsRoot        bool    `gorm:"not null"`
}

func (AttackChainNode) TableName added in v0.0.205

func (AttackChainNode) TableName() string

type AttackChainNodeControlsRelation added in v0.0.205

type AttackChainNodeControlsRelation struct {
	BaseModel
	NodeID uint            `gorm:"primaryKey; not null"`
	Node   AttackChainNode `gorm:"foreignKey:NodeID"`

	// ControlID = failed or ignored control ID that is associated with the node.
	ControlID string `gorm:"primaryKey; type:varchar(255);not null"`
}

func (AttackChainNodeControlsRelation) TableName added in v0.0.205

type AttackChainNodeImageScanRelation added in v0.0.205

type AttackChainNodeImageScanRelation struct {
	BaseModel
	NodeID uint            `gorm:"primaryKey; not null"`
	Node   AttackChainNode `gorm:"foreignKey:NodeID"`

	// ImageScanId = ContainerScanId (required for attack chain.)
	ImageScanId string `gorm:"primaryKey; not null"`
}

func (AttackChainNodeImageScanRelation) TableName added in v0.0.205

type AttackChainNodeRelatedResourcesRelation added in v0.0.205

type AttackChainNodeRelatedResourcesRelation struct {
	BaseModel
	NodeID     uint            `gorm:"primaryKey; not null"`
	Node       AttackChainNode `gorm:"foreignKey:NodeID"`
	ResourceID string          `gorm:"primaryKey; not null"`
}

func (AttackChainNodeRelatedResourcesRelation) TableName added in v0.0.205

type AttackChainNodeRelation added in v0.0.205

type AttackChainNodeRelation struct {
	BaseModel
	ParentNode   AttackChainNode `gorm:"foreignKey:ParentNodeID"`
	ParentNodeID uint            `gorm:"primaryKey; not null"`
	ChildNode    AttackChainNode `gorm:"foreignKey:ChildNodeID"`
	ChildNodeID  uint            `gorm:"primaryKey; not null"`
}

func (AttackChainNodeRelation) TableName added in v0.0.205

func (AttackChainNodeRelation) TableName() string

type BaseModel

type BaseModel struct {
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
}

type ContextualVulnerabilityFinding added in v0.0.182

type ContextualVulnerabilityFinding struct {
	VulnerabilityFinding     `gorm:"embedded"`
	VulnerabilityScanSummary VulnerabilityScanSummary `gorm:"foreignKey:ImageScanId"`
}

ContextualVulnerabilityFinding is a VulnerabilityFinding with a VulnerabilityScanSummary, do not auto-migrate it uses only for retreiving data from db

func (ContextualVulnerabilityFinding) TableName added in v0.0.182

type Vulnerability

type Vulnerability struct {
	BaseModel
	Name          string `gorm:"primaryKey"`
	Severity      string
	SeverityScore int
	IsRCE         bool
	Links         pq.StringArray `gorm:"type:text[]"`
	Description   string
}

type VulnerabilityFinding

type VulnerabilityFinding struct {
	BaseModel
	VulnerabilityName string        `gorm:"primaryKey"`
	Vulnerability     Vulnerability `gorm:"foreignKey:VulnerabilityName"`
	ImageScanId       string        `gorm:"primaryKey"`
	Component         string        `gorm:"primaryKey"`
	ComponentVersion  string        `gorm:"primaryKey"`
	LayerHash         string        `gorm:"primaryKey"`
	FixAvailable      *bool
	FixedInVersion    string
	LayerIndex        *int
	LayerCommand      string
	IsRelevant        *bool
	RelevantLabel     string
	IsIgnored         *bool
	IgnoreRuleIds     pq.StringArray `gorm:"type:text[]"`
}

type VulnerabilityScanSummary

type VulnerabilityScanSummary struct {
	BaseModel
	ScanKind                   string
	ImageScanId                string `gorm:"primaryKey"`
	ContainerSpecId            string
	Timestamp                  time.Time
	CustomerGuid               string
	Wlid                       string
	Designators                datatypes.JSON
	ImageRegistry              string
	ImageRepository            string
	ImageTag                   string
	ImageHash                  string
	JobIds                     pq.StringArray `gorm:"type:text[]"`
	Status                     string
	Errors                     pq.StringArray               `gorm:"type:text[]"`
	Findings                   []VulnerabilityFinding       `gorm:"foreignKey:ImageScanId"`
	VulnerabilitySeverityStats []VulnerabilitySeverityStats `gorm:"foreignKey:ImageScanId"`
	IsStub                     *bool                        // if true, this is a stub scan summary, and the actual scan summary is not yet available. Should be deleted once we have the real one.
}

type VulnerabilitySeverityStats added in v0.0.179

type VulnerabilitySeverityStats struct {
	BaseModel
	ImageScanId                  string         `gorm:"primaryKey"`
	Severity                     string         `gorm:"primaryKey"`
	DayDate                      datatypes.Date `gorm:"primaryKey"`
	SeverityScore                int
	TotalCount                   int64
	RCEFixCount                  int64
	FixAvailableOfTotalCount     int64
	RelevantCount                int64
	FixAvailableForRelevantCount int64
	RCECount                     int64
	UrgentCount                  int64
	NeglectedCount               int64
	HealthStatus                 string
}

Jump to

Keyboard shortcuts

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