target

package
v0.0.0-...-b5b2af5 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsProto

func IsProto(t string) bool

Types

type Option

type Option func(*Options)

func WithConfigPath

func WithConfigPath(path string) Option

func WithFilterRegex

func WithFilterRegex(regex string) Option

func WithIacFileType

func WithIacFileType(fileType string) Option

func WithIacKubeConfig

func WithIacKubeConfig(configPath string) Option

func WithIacKubeNameSpace

func WithIacKubeNameSpace(namespace string) Option

func WithIacLimitSize

func WithIacLimitSize(iacSize int64) Option

func WithIacProxy

func WithIacProxy(proxy string) Option

func WithIacSshPath

func WithIacSshPath(path string) Option

func WithInsecure

func WithInsecure(insecure bool) Option

func WithParallelContainerMode

func WithParallelContainerMode(mode bool) Option

func WithResourcePath

func WithResourcePath(path string) Option

func WithSpecFlags

func WithSpecFlags(flags []string) Option

func WithTempPath

func WithTempPath(path string) Option

func WithThread

func WithThread(thread int) Option

type Options

type Options struct {
	Thread                int
	TempPath              string
	ConfigPath            string
	ResourcePath          string
	ParallelContainerMode bool
	Insecure              bool
	SpecFlags             []string

	// For Iac Scan
	IacFileType      string
	IacLimitSize     int64
	IacSshPath       string
	IacProxy         string
	IacKubeConfig    string
	IacKubeNameSpace string

	// For Registry Scan
	CatalogFilterRegex string
}

type Proto

type Proto string
const (
	UNKNOWN Proto = "unknown"
	// DOCKERD CONTAINERD: container protol
	// DOCKERD CONTAINERD REGISTRY TARBALL: image protol
	DOCKERD        Proto = "dockerd"
	CONTAINERD     Proto = "containerd"
	REGISTRY       Proto = "registry"
	REGISTRY_IMAGE Proto = "registry-image"
	TARBALL        Proto = "tarball"

	// LOCAL GIT KUBERNETES: iac protol
	LOCAL      Proto = "host"
	GIT        Proto = "git"
	KUBERNETES Proto = "kubernetes"
)

func ParseProto

func ParseProto(cmd string, arg string) (Proto, string)

func (Proto) String

func (p Proto) String() string

type Target

type Target struct {
	Proto          Proto
	Value          string
	Opts           *Options
	Plugins        []*plugin.Plugin
	ServiceManager *plugind.Manager
	ReportService  *report.Service
}

func NewTargets

func NewTargets(cmd *cmd.Command, args []string, plugins []*plugin.Plugin, serviceManager *plugind.Manager, reportService *report.Service, opts ...Option) []*Target

NewTargets parse arg to Target docker: || "" -> scan all with docker runtime docker:imageRef || imageRef -> scan imageRef with docker runtime containerd: -> scan all with containerd runtime containerd:imageRef -> scan imageRef with containerd runtime registry: -> scan all with remote runtime(do not support docker.io) registry: imageRef -> scan imageRef with remote runtime

func (*Target) WithDefaultOptions

func (t *Target) WithDefaultOptions(opts ...Option) []plugin.ExecOption

WithDefaultOptions Transfer Target.Options to plugin.ExecOption

Jump to

Keyboard shortcuts

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