audit

package
v1.20.2 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2025 License: Apache-2.0 Imports: 35 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAuditResultsContext added in v1.14.0

func CreateAuditResultsContext(serverDetails *config.ServerDetails, xrayVersion string, watches []string, artifactoryRepoPath, projectKey, gitRepoHttpsCloneUrl string, includeVulnerabilities, includeLicenses, includeSbom bool) (context results.ResultContext)

Create a results context based on the provided parameters. resolves conflicts between the parameters based on the retrieved platform watches.

func ProcessResultsAndOutput added in v1.15.0

func ProcessResultsAndOutput(auditResults *results.SecurityCommandResults, outputWriter *output.ResultsWriter, failBuild bool) (err error)

func RunAudit

func RunAudit(auditParams *AuditParams) (cmdResults *results.SecurityCommandResults)

Runs an audit scan based on the provided auditParams. Returns an audit Results object containing all the scan results. If the current server is entitled for JAS, the advanced security results will be included in the scan results.

Types

type AuditCommand

type AuditCommand struct {
	IncludeVulnerabilities bool
	IncludeLicenses        bool
	IncludeSbom            bool
	Fail                   bool
	PrintExtendedTable     bool
	Threads                int
	AuditParams
	// contains filtered or unexported fields
}

func NewGenericAuditCommand

func NewGenericAuditCommand() *AuditCommand

func (*AuditCommand) CommandName

func (auditCmd *AuditCommand) CommandName() string

func (*AuditCommand) Run

func (auditCmd *AuditCommand) Run() (err error)

func (*AuditCommand) SetFail

func (auditCmd *AuditCommand) SetFail(fail bool) *AuditCommand

func (*AuditCommand) SetGitRepoHttpsCloneUrl added in v1.14.0

func (auditCmd *AuditCommand) SetGitRepoHttpsCloneUrl(gitRepoHttpsCloneUrl string) *AuditCommand

func (*AuditCommand) SetIncludeLicenses

func (auditCmd *AuditCommand) SetIncludeLicenses(include bool) *AuditCommand

func (*AuditCommand) SetIncludeSbom added in v1.16.0

func (auditCmd *AuditCommand) SetIncludeSbom(include bool) *AuditCommand

func (*AuditCommand) SetIncludeVulnerabilities

func (auditCmd *AuditCommand) SetIncludeVulnerabilities(include bool) *AuditCommand

func (*AuditCommand) SetPrintExtendedTable

func (auditCmd *AuditCommand) SetPrintExtendedTable(printExtendedTable bool) *AuditCommand

func (*AuditCommand) SetProject

func (auditCmd *AuditCommand) SetProject(project string) *AuditCommand

func (*AuditCommand) SetTargetRepoPath

func (auditCmd *AuditCommand) SetTargetRepoPath(repoPath string) *AuditCommand

func (*AuditCommand) SetThreads added in v1.4.0

func (auditCmd *AuditCommand) SetThreads(threads int) *AuditCommand

func (*AuditCommand) SetWatches

func (auditCmd *AuditCommand) SetWatches(watches []string) *AuditCommand

type AuditParams

type AuditParams struct {
	*xrayutils.AuditBasicParams
	// contains filtered or unexported fields
}

func NewAuditParams

func NewAuditParams() *AuditParams

func (*AuditParams) BomGenerator added in v1.20.0

func (params *AuditParams) BomGenerator() bom.SbomGenerator

func (*AuditParams) CustomAnalyzerManagerBinaryPath added in v1.20.0

func (params *AuditParams) CustomAnalyzerManagerBinaryPath() string

func (*AuditParams) CustomBomGenBinaryPath added in v1.20.0

func (params *AuditParams) CustomBomGenBinaryPath() string

func (*AuditParams) DiffMode added in v1.18.0

func (params *AuditParams) DiffMode() bool

func (*AuditParams) FilesToScan added in v1.18.0

func (params *AuditParams) FilesToScan() []string

func (*AuditParams) FixableOnly

func (params *AuditParams) FixableOnly() bool

func (*AuditParams) GetMultiScanId added in v1.13.2

func (params *AuditParams) GetMultiScanId() string

func (*AuditParams) InstallFunc

func (params *AuditParams) InstallFunc() func(tech string) error

func (*AuditParams) MinSeverityFilter

func (params *AuditParams) MinSeverityFilter() severityutils.Severity

func (*AuditParams) ResultsToCompare added in v1.18.0

func (params *AuditParams) ResultsToCompare() *results.SecurityCommandResults

func (*AuditParams) ScaScanStrategy added in v1.20.0

func (params *AuditParams) ScaScanStrategy() scan.SbomScanStrategy

func (*AuditParams) SetBomGenerator added in v1.20.0

func (params *AuditParams) SetBomGenerator(bomGenerator bom.SbomGenerator) *AuditParams

func (*AuditParams) SetCustomAnalyzerManagerBinaryPath added in v1.20.0

func (params *AuditParams) SetCustomAnalyzerManagerBinaryPath(customAnalyzerManagerBinaryPath string) *AuditParams

func (*AuditParams) SetCustomBomGenBinaryPath added in v1.20.0

func (params *AuditParams) SetCustomBomGenBinaryPath(customBomGenBinaryPath string) *AuditParams

func (*AuditParams) SetDepsRepo

func (params *AuditParams) SetDepsRepo(depsRepo string) *AuditParams

func (*AuditParams) SetDiffMode added in v1.18.0

func (params *AuditParams) SetDiffMode(diffMode bool) *AuditParams

func (*AuditParams) SetFilesToScan added in v1.18.0

func (params *AuditParams) SetFilesToScan(filesToScan []string) *AuditParams

func (*AuditParams) SetFixableOnly

func (params *AuditParams) SetFixableOnly(fixable bool) *AuditParams

func (*AuditParams) SetGraphBasicParams

func (params *AuditParams) SetGraphBasicParams(gbp *xrayutils.AuditBasicParams) *AuditParams

func (*AuditParams) SetInstallFunc

func (params *AuditParams) SetInstallFunc(installFunc func(tech string) error) *AuditParams

func (*AuditParams) SetMinSeverityFilter

func (params *AuditParams) SetMinSeverityFilter(minSeverityFilter severityutils.Severity) *AuditParams

func (*AuditParams) SetMultiScanId added in v1.13.2

func (params *AuditParams) SetMultiScanId(msi string) *AuditParams

func (*AuditParams) SetResultsContext added in v1.14.0

func (params *AuditParams) SetResultsContext(resultsContext results.ResultContext) *AuditParams

func (*AuditParams) SetResultsToCompare added in v1.18.0

func (params *AuditParams) SetResultsToCompare(resultsToCompare *results.SecurityCommandResults) *AuditParams

func (*AuditParams) SetScaScanStrategy added in v1.20.0

func (params *AuditParams) SetScaScanStrategy(scaScanStrategy scan.SbomScanStrategy) *AuditParams

func (*AuditParams) SetScansResultsOutputDir added in v1.9.0

func (params *AuditParams) SetScansResultsOutputDir(outputDir string) *AuditParams

func (*AuditParams) SetStartTime added in v1.13.2

func (params *AuditParams) SetStartTime(startTime time.Time) *AuditParams

func (*AuditParams) SetThirdPartyApplicabilityScan

func (params *AuditParams) SetThirdPartyApplicabilityScan(includeThirdPartyDeps bool) *AuditParams

func (*AuditParams) SetThreads added in v1.4.0

func (params *AuditParams) SetThreads(threads int) *AuditParams

func (*AuditParams) SetWorkingDirs

func (params *AuditParams) SetWorkingDirs(workingDirs []string) *AuditParams

func (*AuditParams) ShouldGetFlatTreeForApplicableScan added in v1.20.0

func (params *AuditParams) ShouldGetFlatTreeForApplicableScan(tech techutils.Technology) bool

When building pip dependency tree using pipdeptree, some of the direct dependencies are recognized as transitive and missed by the CA scanner. Our solution for this case is to send all dependencies to the CA scanner. When thirdPartyApplicabilityScan is true, use flatten graph to include all the dependencies in applicability scanning. Only npm is supported for this flag.

func (*AuditParams) StartTime added in v1.13.2

func (params *AuditParams) StartTime() time.Time

func (*AuditParams) ToBuildInfoBomGenParams added in v1.20.0

func (params *AuditParams) ToBuildInfoBomGenParams() (bomParams technologies.BuildInfoBomGeneratorParams, err error)

func (*AuditParams) ToXrayScanGraphParams added in v1.20.0

func (params *AuditParams) ToXrayScanGraphParams() (scanGraphParams scangraph.ScanGraphParams, err error)

func (*AuditParams) WorkingDirs

func (params *AuditParams) WorkingDirs() []string

Jump to

Keyboard shortcuts

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