horusec

package
v1.7.5 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Analysis

type Analysis struct {
	ID                      uuid.UUID                 `json:"id" gorm:"Column:analysis_id"`
	RepositoryID            uuid.UUID                 `json:"repositoryID" gorm:"Column:repository_id"`
	RepositoryName          string                    `json:"repositoryName" gorm:"Column:repository_name"`
	CompanyID               uuid.UUID                 `json:"companyID" gorm:"Column:company_id"`
	CompanyName             string                    `json:"companyName" gorm:"Column:company_name"`
	Status                  horusec.Status            `json:"status" gorm:"Column:status"`
	Errors                  string                    `json:"errors" gorm:"Column:errors"`
	CreatedAt               time.Time                 `json:"createdAt" gorm:"Column:created_at"`
	FinishedAt              time.Time                 `json:"finishedAt" gorm:"Column:finished_at"`
	AnalysisVulnerabilities []AnalysisVulnerabilities `json:"analysisVulnerabilities" gorm:"foreignkey:AnalysisID;association_foreignkey:ID"` //nolint:lll gorm usage
}

func (*Analysis) GetAnalysisWithoutAnalysisVulnerabilities added in v1.1.0

func (a *Analysis) GetAnalysisWithoutAnalysisVulnerabilities() *Analysis

func (*Analysis) GetID

func (a *Analysis) GetID() uuid.UUID

func (*Analysis) GetIDString

func (a *Analysis) GetIDString() string

func (*Analysis) GetTable

func (a *Analysis) GetTable() string

func (*Analysis) GetTotalVulnerabilities

func (a *Analysis) GetTotalVulnerabilities() int

func (*Analysis) GetTotalVulnerabilitiesBySeverity

func (a *Analysis) GetTotalVulnerabilitiesBySeverity() (total map[horusec.VulnerabilityType]map[severity.Severity]int)

func (*Analysis) HasErrors

func (a *Analysis) HasErrors() bool

func (*Analysis) Map

func (a *Analysis) Map() map[string]interface{}

func (*Analysis) ParseResponseBytesToAnalysis added in v1.1.0

func (a *Analysis) ParseResponseBytesToAnalysis(body []byte) (analysis *Analysis, err error)

func (*Analysis) RemoveInfoVulnerabilities added in v1.5.0

func (a *Analysis) RemoveInfoVulnerabilities() *Analysis

func (*Analysis) SetAnalysisError

func (a *Analysis) SetAnalysisError(err error)

func (*Analysis) SetAnalysisFinishedData

func (a *Analysis) SetAnalysisFinishedData() *Analysis

func (*Analysis) SetCompanyName

func (a *Analysis) SetCompanyName(companyName string) *Analysis

func (*Analysis) SetDefaultVulnerabilityType added in v1.1.0

func (a *Analysis) SetDefaultVulnerabilityType() *Analysis

func (*Analysis) SetFalsePositivesAndRiskAcceptInVulnerabilities added in v1.1.0

func (a *Analysis) SetFalsePositivesAndRiskAcceptInVulnerabilities(
	listFalsePositive, listRiskAccept []string) *Analysis

func (*Analysis) SetFindOneFilter

func (a *Analysis) SetFindOneFilter() map[string]interface{}

func (*Analysis) SetRepositoryID added in v1.0.1

func (a *Analysis) SetRepositoryID(repositoryID uuid.UUID) *Analysis

func (*Analysis) SetRepositoryName

func (a *Analysis) SetRepositoryName(repositoryName string) *Analysis

func (*Analysis) SetupIDInAnalysisContents added in v1.1.0

func (a *Analysis) SetupIDInAnalysisContents() *Analysis

func (*Analysis) SortVulnerabilitiesByCriticality

func (a *Analysis) SortVulnerabilitiesByCriticality() *Analysis

func (*Analysis) SortVulnerabilitiesByType added in v1.1.0

func (a *Analysis) SortVulnerabilitiesByType() *Analysis

func (*Analysis) ToBytes

func (a *Analysis) ToBytes() []byte

func (*Analysis) ToString

func (a *Analysis) ToString() string

type AnalysisVulnerabilities added in v1.1.0

type AnalysisVulnerabilities struct {
	VulnerabilityID uuid.UUID     `json:"vulnerabilityID" gorm:"Column:vulnerability_id"`
	AnalysisID      uuid.UUID     `json:"analysisID" gorm:"Column:analysis_id"`
	CreatedAt       time.Time     `json:"createdAt" gorm:"Column:created_at"`
	Vulnerability   Vulnerability `json:"vulnerabilities" gorm:"foreignkey:VulnerabilityID;association_foreignkey:VulnerabilityID"` //nolint:lll gorm usage
}

func (*AnalysisVulnerabilities) GetAnalysisVulnerabilitiesWithoutVulnerability added in v1.1.0

func (a *AnalysisVulnerabilities) GetAnalysisVulnerabilitiesWithoutVulnerability() *AnalysisVulnerabilities

func (*AnalysisVulnerabilities) GetTable added in v1.1.0

func (a *AnalysisVulnerabilities) GetTable() string

func (*AnalysisVulnerabilities) SetAnalysisID added in v1.1.0

func (a *AnalysisVulnerabilities) SetAnalysisID(id uuid.UUID)

func (*AnalysisVulnerabilities) SetCreatedAt added in v1.1.0

func (a *AnalysisVulnerabilities) SetCreatedAt()

func (*AnalysisVulnerabilities) SetVulnerabilityID added in v1.1.0

func (a *AnalysisVulnerabilities) SetVulnerabilityID(id uuid.UUID)

type CommitAuthor

type CommitAuthor struct {
	Author     string `json:"author"`
	Email      string `json:"email"`
	CommitHash string `json:"commitHash"`
	Message    string `json:"message"`
	Date       string `json:"date"`
}

type ConfigFile

type ConfigFile struct {
	WorkDir string `json:"work_dir"`
}

type Monitor

type Monitor struct {
	// contains filtered or unexported fields
}

func NewMonitor

func NewMonitor() *Monitor

func (*Monitor) AddProcess

func (m *Monitor) AddProcess(n int)

func (*Monitor) GetProcess

func (m *Monitor) GetProcess() int

func (*Monitor) IsFinished

func (m *Monitor) IsFinished() bool

func (*Monitor) IsRunning

func (m *Monitor) IsRunning() bool

func (*Monitor) RemoveProcess

func (m *Monitor) RemoveProcess(n int)

type Vulnerability

type Vulnerability struct {
	VulnerabilityID uuid.UUID                 `json:"vulnerabilityID" gorm:"Column:vulnerability_id"`
	Line            string                    `json:"line" gorm:"Column:line"`
	Column          string                    `json:"column" gorm:"Column:column"`
	Confidence      string                    `json:"confidence" gorm:"Column:confidence"`
	File            string                    `json:"file" gorm:"Column:file"`
	Code            string                    `json:"code" gorm:"Column:code"`
	Details         string                    `json:"details" gorm:"Column:details"`
	SecurityTool    tools.Tool                `json:"securityTool" gorm:"Column:security_tool"`
	Language        languages.Language        `json:"language" gorm:"Column:language"`
	Severity        severity.Severity         `json:"severity" gorm:"Column:severity"`
	VulnHash        string                    `json:"vulnHash" gorm:"Column:vuln_hash"`
	Type            horusec.VulnerabilityType `json:"type" gorm:"Column:type"`
	CommitAuthor    string                    `json:"commitAuthor" gorm:"Column:commit_author"`
	CommitEmail     string                    `json:"commitEmail" gorm:"Column:commit_email"`
	CommitHash      string                    `json:"commitHash" gorm:"Column:commit_hash"`
	CommitMessage   string                    `json:"commitMessage" gorm:"Column:commit_message"`
	CommitDate      string                    `json:"commitDate" gorm:"Column:commit_date"`
}

func (*Vulnerability) GenerateID added in v1.1.0

func (v *Vulnerability) GenerateID()

func (*Vulnerability) GetTable

func (v *Vulnerability) GetTable() string

func (*Vulnerability) SetType added in v1.1.0

func (v *Vulnerability) SetType(vulnType horusec.VulnerabilityType)

Jump to

Keyboard shortcuts

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