jas

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: Apache-2.0 Imports: 24 Imported by: 1

Documentation

Index

Constants

View Source
const (
	NodeModulesPattern = "**/*node_modules*/**"
)

Variables

View Source
var (
	DefaultExcludePatterns = []string{"**/.git/**", "**/*test*/**", "**/*venv*/**", NodeModulesPattern, "**/target/**"}
)
View Source
var FakeBasicXrayResults = []services.ScanResponse{
	{
		ScanId: "scanId_1",
		Vulnerabilities: []services.Vulnerability{
			{IssueId: "issueId_1", Technology: techutils.Pipenv.String(),
				Cves:       []services.Cve{{Id: "testCve1"}, {Id: "testCve2"}, {Id: "testCve3"}},
				Components: map[string]services.Component{"issueId_1_direct_dependency": {}, "issueId_3_direct_dependency": {}}},
		},
		Violations: []services.Violation{
			{IssueId: "issueId_2", Technology: techutils.Pipenv.String(),
				Cves:       []services.Cve{{Id: "testCve4"}, {Id: "testCve5"}},
				Components: map[string]services.Component{"issueId_2_direct_dependency": {}, "issueId_4_direct_dependency": {}}},
		},
	},
}
View Source
var FakeServerDetails = config.ServerDetails{
	Url:      "platformUrl",
	Password: "password",
	User:     "user",
}

Functions

func CreateJFrogAppsConfig added in v1.4.0

func CreateJFrogAppsConfig(workingDirs []string) (*jfrogappsconfig.JFrogAppsConfig, error)

func CreateScannerTempDirectory added in v1.4.0

func CreateScannerTempDirectory(scanner *JasScanner, scanType string) (string, error)

func CreateScannersConfigFile

func CreateScannersConfigFile(fileName string, fileContent interface{}, scanType utils.JasScanType) error

func GetExcludePatterns

func GetExcludePatterns(module jfrogappsconfig.Module, scanner *jfrogappsconfig.Scanner, exclusions ...string) []string

func GetSourceRoots

func GetSourceRoots(module jfrogappsconfig.Module, scanner *jfrogappsconfig.Scanner) ([]string, error)

func GetTestDataPath

func GetTestDataPath() string

func IsEntitledForJas

func IsEntitledForJas(xrayManager *xray.XrayServicesManager, xrayVersion string) (entitled bool, err error)

func ReadJasScanRunsFromFile

func ReadJasScanRunsFromFile(fileName, wd, informationUrlSuffix string) (sarifRuns []*sarif.Run, err error)

func SetAnalyticsMetricsDataForAnalyzerManager

func SetAnalyticsMetricsDataForAnalyzerManager(msi string, technologies []techutils.Technology) func()

func ShouldSkipScanner

func ShouldSkipScanner(module jfrogappsconfig.Module, scanType utils.JasScanType) bool

Types

type JasScanner

type JasScanner struct {
	TempDir               string
	AnalyzerManager       utils.AnalyzerManager
	ServerDetails         *config.ServerDetails
	JFrogAppsConfig       *jfrogappsconfig.JFrogAppsConfig
	ScannerDirCleanupFunc func() error
	Exclusions            []string
}

func CreateJasScanner added in v1.4.0

func CreateJasScanner(scanner *JasScanner, jfrogAppsConfig *jfrogappsconfig.JFrogAppsConfig, serverDetails *config.ServerDetails, exclusions ...string) (*JasScanner, error)

func InitJasTest

func InitJasTest(t *testing.T, workingDirs ...string) (*JasScanner, func())

func (*JasScanner) Run

func (a *JasScanner) Run(scannerCmd ScannerCmd, module jfrogappsconfig.Module) (err error)

type ScannerCmd

type ScannerCmd interface {
	Run(module jfrogappsconfig.Module) (err error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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