db

package
v0.0.0-...-b3815d1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseProjectAssets

type DatabaseProjectAssets struct {
	gorm.Model
	Details   string `json:"details"`
	TypeAsset string `json:"type_asset"`
}

type DatabaseProjectCredentials

type DatabaseProjectCredentials struct {
	gorm.Model
	Label string `json:"label"`
	Value string `json:"value"`
}

type DatabaseProjectParameters

type DatabaseProjectParameters struct {
	gorm.Model
	Label string `json:"label"`
	Value string `json:"value"`
}

type DatabaseScanner

type DatabaseScanner struct {
	gorm.Model
	Name    string `json:"name"`
	Install string `json:"install"`
	Run     string `json:"run"`
	Report  string `json:"report"`
	Type    string `json:"type"`
}

type DatabaseScannerAnalysis

type DatabaseScannerAnalysis struct {
	gorm.Model
	ScannerID uint
	Scanner   DatabaseScanner `gorm:"foreignKey:ScannerID"`
	Cron      string          `json:"cron"`
	//Params     []string `json:"params"`
	Timeout int `json:"timeout"`
}

type DatabaseSecurityIssue

type DatabaseSecurityIssue struct {
	gorm.Model
	OriginalCvss float64 `json:"original_cvss"`
	RevisedCvss  float64 `json:"revised_cvss"`
	AnalysisDate string  `json:"analysis_date"`
	Scanner      string  `json:"scanner"`
	Cve          string  `json:"cve"`
	Cwe          string  `json:"cwe"`
	Vex          string  `json:"vex"`
	Infos        string  `json:"infos"`
	Status       string  `json:"status"`
	Origin       string  `json:"origin"`
}

type DatabaseSecurityProject

type DatabaseSecurityProject struct {
	gorm.Model
	Name            string                       `json:"name" gorm:"uniqueIndex"`
	Users           []DatabaseUserRole           `json:"users" gorm:"many2many:pj_user_roles;"`
	Analysis        []DatabaseScannerAnalysis    `json:"analysis" gorm:"many2many:pj_scanner_analysis;"`
	Vulnerabilities []DatabaseSecurityIssue      `json:"vulnerabilities" gorm:"many2many:pj_vulns"`
	ProjectAssets   []DatabaseProjectAssets      `json:"assets" gorm:"many2many:pj_assets"`
	Credentials     []DatabaseProjectCredentials `json:"credentials" gorm:"many2many:pj_creds"`
	Params          []DatabaseProjectParameters  `json:"params" gorm:"many2many:pj_params"`
}

type DatabaseUser

type DatabaseUser struct {
	gorm.Model
	Name string `json:"name"`
}

type DatabaseUserRole

type DatabaseUserRole struct {
	gorm.Model
	Role   string `json:"role"`
	UserID uint
	User   DatabaseUser `gorm:"foreignKey:UserID"`
}

type SecurityDatabase

type SecurityDatabase struct {
	Database *gorm.DB `json:"database"`
}

func (*SecurityDatabase) AddProjectAsset

func (source *SecurityDatabase) AddProjectAsset(project DatabaseSecurityProject, detail string, typeAsset string) error

func (*SecurityDatabase) AddProjectCredential

func (source *SecurityDatabase) AddProjectCredential(project DatabaseSecurityProject, name string, value string) error

func (*SecurityDatabase) AddProjectParam

func (source *SecurityDatabase) AddProjectParam(project DatabaseSecurityProject, name string, value string) error

func (*SecurityDatabase) AddScannerAnalysis

func (source *SecurityDatabase) AddScannerAnalysis(project DatabaseSecurityProject, name string, cron string, timeout int) error

func (*SecurityDatabase) AddUserRole

func (source *SecurityDatabase) AddUserRole(project DatabaseSecurityProject, name string, role string) error

func (*SecurityDatabase) AddVulnerability

func (source *SecurityDatabase) AddVulnerability(
	project DatabaseSecurityProject,
	cvss float64,
	date string,
	scanner string,
	cve string,
	cwe string,
	vex string,
	infos string,
	status string,
	origin string) error

func (*SecurityDatabase) CreateProject

func (source *SecurityDatabase) CreateProject(name string) error

func (*SecurityDatabase) CreateScanner

func (source *SecurityDatabase) CreateScanner(name string) error

func (*SecurityDatabase) CreateUser

func (source *SecurityDatabase) CreateUser(name string) error

func (*SecurityDatabase) DeleteProject

func (source *SecurityDatabase) DeleteProject(name string) error

func (*SecurityDatabase) DeleteProjectAsset

func (source *SecurityDatabase) DeleteProjectAsset(project DatabaseSecurityProject, asset DatabaseProjectAssets) error

func (*SecurityDatabase) DeleteProjectCredential

func (source *SecurityDatabase) DeleteProjectCredential(project DatabaseSecurityProject, cred DatabaseProjectCredentials) error

func (*SecurityDatabase) DeleteProjectParam

func (source *SecurityDatabase) DeleteProjectParam(project DatabaseSecurityProject, param DatabaseProjectParameters) error

func (*SecurityDatabase) DeleteScanner

func (source *SecurityDatabase) DeleteScanner(name string) error

func (*SecurityDatabase) DeleteScannerAnalysis

func (source *SecurityDatabase) DeleteScannerAnalysis(project DatabaseSecurityProject, analysis DatabaseScannerAnalysis) error

func (*SecurityDatabase) DeleteUser

func (source *SecurityDatabase) DeleteUser(name string) error

func (*SecurityDatabase) DeleteVulnerability

func (source *SecurityDatabase) DeleteVulnerability(project DatabaseSecurityProject, param DatabaseSecurityIssue) error

func (*SecurityDatabase) FindProject

func (source *SecurityDatabase) FindProject(name string) (DatabaseSecurityProject, error)

func (*SecurityDatabase) GetProject

func (source *SecurityDatabase) GetProject(id string) (DatabaseSecurityProject, error)

func (*SecurityDatabase) GetScanner

func (source *SecurityDatabase) GetScanner(name string) (DatabaseScanner, error)

func (*SecurityDatabase) GetUser

func (source *SecurityDatabase) GetUser(name string) (DatabaseUser, error)

func (*SecurityDatabase) Open

func (source *SecurityDatabase) Open() error

func (*SecurityDatabase) UpdateProject

func (source *SecurityDatabase) UpdateProject(name string, p DatabaseSecurityProject) error

func (*SecurityDatabase) UpdateScanner

func (source *SecurityDatabase) UpdateScanner(name string, s DatabaseScanner) error

func (*SecurityDatabase) UpdateUser

func (source *SecurityDatabase) UpdateUser(name string, p DatabaseUser) error

Jump to

Keyboard shortcuts

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