sca

package
v1.3.3-rc4 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Exports = map[string]interface{}{
	"ScanImageFromContext":     ScanDockerImageFromContext,
	"ScanContainerFromContext": ScanDockerContainerFromContext,
	"ScanImageFromFile":        ScanDockerImageFromFile,
	"ScanGitRepo":              ScanGitRepo,
	"ScanFilesystem":           ScanFilesystem,

	"endpoint":   _withEndPoint,
	"scanMode":   _withScanMode,
	"concurrent": _withConcurrent,
	"analyzers":  _withAnalayzers,

	"MODE_ALL":      analyzer.AllMode,
	"MODE_PKG":      analyzer.PkgMode,
	"MODE_LANGUAGE": analyzer.LanguageMode,

	"ANALYZER_TYPE_DPKG":             analyzer.TypDPKG,
	"ANALYZER_TYPE_RPM":              analyzer.TypRPM,
	"ANALYZER_TYPE_APK":              analyzer.TypAPK,
	"ANALYZER_TYPE_RUBY_BUNDLER":     analyzer.TypRubyBundler,
	"ANALYZER_TYPE_RUST_CARGO":       analyzer.TypRustCargo,
	"ANALYZER_TYPE_RUBY_GEMSPEC":     analyzer.TypRubyGemSpec,
	"ANALYZER_TYPE_PYTHON_POETRY":    analyzer.TypPythonPoetry,
	"ANALYZER_TYPE_PYTHON_PIPENV":    analyzer.TypPythonPIPEnv,
	"ANALYZER_TYPE_PYTHON_PIP":       analyzer.TypPythonPIP,
	"ANALYZER_TYPE_PYTHON_PACKAGING": analyzer.TypPythonPackaging,
	"ANALYZER_TYPE_PHP_COMPOSER":     analyzer.TypPHPComposer,
	"ANALYZER_TYPE_NODE_YARN":        analyzer.TypNodeYarn,
	"ANALYZER_TYPE_NODE_PNPM":        analyzer.TypNodePnpm,
	"ANALYZER_TYPE_NODE_NPM":         analyzer.TypNodeNpm,
	"ANALYZER_TYPE_JAVA_POM":         analyzer.TypJavaPom,
	"ANALYZER_TYPE_JAVA_GRADLE":      analyzer.TypJavaGradle,
	"ANALYZER_TYPE_JAVA_JAR":         analyzer.TypJavaJar,
	"ANALYZER_TYPE_GO_MOD":           analyzer.TypGoMod,
	"ANALYZER_TYPE_GO_BINARY":        analyzer.TypGoBinary,
	"ANALYZER_TYPE_CLANG_CONAN":      analyzer.TypClangConan,
}

Functions

func NewDockerClient

func NewDockerClient(host string) (*client.Client, error)

func ScanDockerContainerFromContext

func ScanDockerContainerFromContext(containerID string, opts ...ScanOption) (pkgs []*dxtypes.Package, err error)

func ScanDockerImageFromContext

func ScanDockerImageFromContext(imageID string, opts ...ScanOption) ([]*dxtypes.Package, error)

func ScanDockerImageFromFile

func ScanDockerImageFromFile(path string, opts ...ScanOption) ([]*dxtypes.Package, error)

func ScanFilesystem added in v1.2.6

func ScanFilesystem(p string, opts ...ScanOption) ([]*dxtypes.Package, error)

func ScanGitRepo added in v1.3.2

func ScanGitRepo(repoDir string, opts ...ScanOption) ([]*dxtypes.Package, error)

Types

type SCAConfig

type SCAConfig struct {
	EnableDocker     bool
	DockerEndpoint   string
	DockerNumWorkers int

	/*
		include inspect by Image Names n Image LocalFiles
	*/
	DockerImages               []string
	DockerImageLocalFile       []string
	DockerSaveImageDirectories string // default to use os.CreateTemp

	/*
		Source Code / Repository FS Open Mount INTO CONTAINERS
		Try to Analyze the Source Code / Repository:

		1. Use Docker API Inspect Container Mounts Config
		2. Use FS Analyzer to make it
		3. Build Deps / SBOM
	*/
	DockerContainers []string

	FileSystemPath   string
	DisableLanguages []string
}

type SCAConfigOption

type SCAConfigOption func(*SCAConfig)

func WithDisableLanguages

func WithDisableLanguages(languages ...string) SCAConfigOption

func WithDocker

func WithDocker(b bool) SCAConfigOption

func WithDockerEndpoint

func WithDockerEndpoint(endpoint string) SCAConfigOption

func WithDockerImages

func WithDockerImages(images ...string) SCAConfigOption

func WithDockerNumWorkers

func WithDockerNumWorkers(n int) SCAConfigOption

func WithFileSystemPath

func WithFileSystemPath(path string) SCAConfigOption

type ScanConfig added in v1.2.6

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

func NewConfig added in v1.2.6

func NewConfig() *ScanConfig

type ScanOption added in v1.2.6

type ScanOption func(*ScanConfig)

Jump to

Keyboard shortcuts

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