tools

package
v0.4.43 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCommand added in v0.4.28

func CreateCommand(tool Interface) *cobra.Command

func MustRel added in v0.4.39

func MustRel(base, target string) string

func PassFormatter added in v0.4.39

func PassFormatter(n *jnode.Node) string

func TempFile added in v0.4.35

func TempFile(pattern string) (name string, err error)

Types

type Config added in v0.4.39

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

func ReadConfig added in v0.4.39

func ReadConfig(dir string) *Config

func (*Config) IsIgnored added in v0.4.39

func (c *Config) IsIgnored(path string) bool

type DirectoryBasedToolOpts added in v0.4.28

type DirectoryBasedToolOpts struct {
	ToolOpts
	Directory         string
	Exclude           []string
	PrintFingerprints bool
	// contains filtered or unexported fields
}

func (*DirectoryBasedToolOpts) GetDirectory added in v0.4.28

func (o *DirectoryBasedToolOpts) GetDirectory() string

func (*DirectoryBasedToolOpts) GetDirectoryBasedToolOptions added in v0.4.34

func (o *DirectoryBasedToolOpts) GetDirectoryBasedToolOptions() *DirectoryBasedToolOpts

func (*DirectoryBasedToolOpts) GetFilesInDirectory added in v0.4.34

func (o *DirectoryBasedToolOpts) GetFilesInDirectory(files []string) ([]string, error)

func (*DirectoryBasedToolOpts) GetInventory added in v0.4.34

func (o *DirectoryBasedToolOpts) GetInventory() *inventory.Manifest

func (*DirectoryBasedToolOpts) IsExcluded added in v0.4.34

func (o *DirectoryBasedToolOpts) IsExcluded(file string) bool

func (*DirectoryBasedToolOpts) Register added in v0.4.28

func (o *DirectoryBasedToolOpts) Register(cmd *cobra.Command)

func (*DirectoryBasedToolOpts) RemoveExcluded added in v0.4.34

func (o *DirectoryBasedToolOpts) RemoveExcluded(files []string) []string

func (*DirectoryBasedToolOpts) Validate added in v0.4.34

func (o *DirectoryBasedToolOpts) Validate() error

type DockerTool added in v0.4.29

type DockerTool struct {
	Name             string
	Image            string
	Directory        string
	DockerArgs       []string
	Args             []string
	DefaultLocalPath string
	PolicyDirectory  string
	Stdout           io.Writer
}

type HasCommandTemplate added in v0.4.31

type HasCommandTemplate interface {
	CommandTemplate() *cobra.Command
}

type Interface

type Interface interface {
	options.Interface
	GetToolOptions() *ToolOpts
	GetDirectoryBasedToolOptions() *DirectoryBasedToolOpts
	Validate() error
	Run() (*Result, error)
	Name() string
}

type Result

type Result struct {
	Data         *jnode.Node
	Findings     assessments.Findings
	Values       map[string]string
	Directory    string
	Files        *util.StringSet
	PrintPath    []string
	PrintColumns []string

	Assessment *assessments.Assessment
}

func (*Result) AddFile added in v0.4.21

func (r *Result) AddFile(path string) *Result

func (*Result) AddValue added in v0.4.21

func (r *Result) AddValue(name, value string) *Result

func (*Result) Report added in v0.4.30

func (r *Result) Report(tool Interface) error

type RunOpts added in v0.4.39

type RunOpts struct {
	options.PrintClientOpts
	ToolVersion     string
	ToolPath        string
	SkipDockerPull  bool
	ExtraDockerArgs []string
	NoDocker        bool
	Internal        bool
}

func (*RunOpts) InstallTool added in v0.4.39

func (o *RunOpts) InstallTool(spec *download.Spec) (*download.Download, error)

func (*RunOpts) Register added in v0.4.39

func (o *RunOpts) Register(cmd *cobra.Command)

func (*RunOpts) RunDocker added in v0.4.39

func (o *RunOpts) RunDocker(d *DockerTool) ([]byte, error)

type ToolOpts

type ToolOpts struct {
	RunOpts
	Tool                  Interface
	UploadEnabled         bool
	UpdatePR              bool
	FailThresholds        []string
	PrintAsessment        bool
	PrintResultOpt        bool
	PrintResultValues     bool
	DisableCustomPolicies bool
	ParsedFailThresholds  map[string]int
	RepoRoot              string
	// contains filtered or unexported fields
}

func (*ToolOpts) GetConfig added in v0.4.39

func (o *ToolOpts) GetConfig() *Config

func (*ToolOpts) GetCustomPoliciesDir added in v0.4.39

func (o *ToolOpts) GetCustomPoliciesDir() (string, error)

func (*ToolOpts) GetDirectoryBasedToolOptions added in v0.4.34

func (o *ToolOpts) GetDirectoryBasedToolOptions() *DirectoryBasedToolOpts

func (*ToolOpts) GetToolOptions added in v0.4.28

func (o *ToolOpts) GetToolOptions() *ToolOpts

func (*ToolOpts) InstallAPIServerArtifact added in v0.4.28

func (o *ToolOpts) InstallAPIServerArtifact(name, urlPath string) (*download.Download, error)

func (*ToolOpts) PrintToolResult added in v0.4.36

func (o *ToolOpts) PrintToolResult(result *Result)

func (*ToolOpts) Register

func (o *ToolOpts) Register(c *cobra.Command)

func (*ToolOpts) RunTool

func (o *ToolOpts) RunTool(printResult bool) (*Result, error)

func (*ToolOpts) Validate added in v0.4.32

func (o *ToolOpts) Validate() error

Jump to

Keyboard shortcuts

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