analyzer

package
v0.0.0-...-3473513 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2025 License: Apache-2.0 Imports: 59 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Analyzer

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

Analyzer is responsible to orchestrate the pipeline of an analysis.

Basically, an analysis has the following steps:

1 - Detect all languages on project path.
2 - Execute all tools to all languages founded.
3 - Send analysis to Horusuec Manager if access token is set.
4 - Print analysis results.

func New

func New(cfg *config.Config) *Analyzer

New create a new analyzer to a given config.

func (*Analyzer) Analyze

func (a *Analyzer) Analyze() (int, error)

Analyze start an analysis and return the total of vulnerabilities founded and an error if exists.

nolint: funlen

func (*Analyzer) SetFalsePositivesAndRiskAcceptInVulnerabilities

func (a *Analyzer) SetFalsePositivesAndRiskAcceptInVulnerabilities(falsePositive, riskAccept []string) *analysis.Analysis

SetFalsePositivesAndRiskAcceptInVulnerabilities set analysis vulnerabilities to false positive or risk accept if the hash exists on falsePositive and riskAccept params.

nolint:lll

type HorusecService

type HorusecService interface {
	SendAnalysis(*analysis.Analysis) error
	GetAnalysis(uuid.UUID) (*analysis.Analysis, error)
}

HorusecService is the interface that interacts with Horusec API

type LanguageDetect

type LanguageDetect interface {
	Detect(directory string) ([]languages.Language, error)
}

LanguageDetect is the interface that detect all languages in some directory.

type PrintResults

type PrintResults interface {
	Print() (int, error)
	SetAnalysis(analysis *analysis.Analysis)
}

PrintResults is the interface tha print the results to stdout

Print print the results to stdout and return the total vulnerabilities that was printed.

Jump to

Keyboard shortcuts

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