scan

package
v1.19.9 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ScanCommand is terrascan's scan command
	ScanCommand string = "scan"

	// ScanTimeout is default scan command execution timeout
	ScanTimeout int = 3

	// WebhookScanTimeout is default scan command webhook execution timeout
	WebhookScanTimeout int = 30

	// RemoteScanTimeout is default scan command remote execution timeout
	RemoteScanTimeout int = 30
)

Variables

This section is empty.

Functions

func RunScanAndAssertErrorMessage

func RunScanAndAssertErrorMessage(terrascanBinaryPath string, exitCode, timeOut int, errString string, outWriter, errWriter io.Writer, args ...string)

RunScanAndAssertErrorMessage runs the scan command with supplied parameters and checks of error string is present

func RunScanAndAssertGoldenOutput

func RunScanAndAssertGoldenOutput(terrascanBinaryPath, relGoldenFilePath string, exitCode int, isStdOut bool, outWriter, errWriter io.Writer, args ...string)

RunScanAndAssertGoldenOutput runs the scan command with supplied parameters and compares actual and golden output

func RunScanAndAssertGoldenOutputRegex

func RunScanAndAssertGoldenOutputRegex(terrascanBinaryPath, relGoldenFilePath string, exitCode int, isJunitXML, isStdOut bool, outWriter, errWriter io.Writer, args ...string)

RunScanAndAssertGoldenOutputRegex runs the scan command with supplied parameters and compares actual and golden output it replaces variable parts in output with regex eg: timestamp, file path

func RunScanAndAssertGoldenOutputRegexWithTimeout added in v1.18.2

func RunScanAndAssertGoldenOutputRegexWithTimeout(terrascanBinaryPath, relGoldenFilePath string, exitCode int, isJunitXML, isStdOut bool, outWriter, errWriter io.Writer, scanTimeout int, args ...string)

RunScanAndAssertGoldenOutputRegexWithTimeout runs the scan command with supplied paramters and compares actual and golden output it replaces variable parts in output with regex eg: timestamp, file path added to provide extra option for specifying timeout.

func RunScanAndAssertGoldenSarifOutputRegex

func RunScanAndAssertGoldenSarifOutputRegex(terrascanBinaryPath, relGoldenFilePath string, exitCode int, outWriter, errWriter io.Writer, args ...string)

RunScanAndAssertGoldenSarifOutputRegex runs the scan command with supplied parameters and compares actual and golden output it replaces variable parts in output with regex eg: uri, version path

func RunScanAndAssertJSONOutput

func RunScanAndAssertJSONOutput(terrascanBinaryPath, relGoldenFilePath string, exitCode int, isJunitXML, isStdOut bool, outWriter, errWriter io.Writer, args ...string)

RunScanAndAssertJSONOutput runs the scan command with supplied parameters and compares actual and golden output

func RunScanAndAssertJSONOutputString

func RunScanAndAssertJSONOutputString(terrascanBinaryPath, goldenString string, exitCode int, isStdOut bool, outWriter, errWriter io.Writer, args ...string)

RunScanAndAssertJSONOutputString runs the scan command with supplied parameters and compares actual and golden output

func RunScanAndAssertXMLOutput

func RunScanAndAssertXMLOutput(terrascanBinaryPath, relGoldenFilePath string, exitCode int, isJunitXML, isStdOut bool, outWriter, errWriter io.Writer, args ...string)

RunScanAndAssertXMLOutput runs the scan command with supplied parameters and compares actual and golden output

func RunScanAndAssertYAMLOutput

func RunScanAndAssertYAMLOutput(terrascanBinaryPath, relGoldenFilePath string, exitCode int, isJunitXML, isStdOut bool, outWriter, errWriter io.Writer, args ...string)

RunScanAndAssertYAMLOutput runs the scan command with supplied parameters and compares actual and golden output

func RunScanCommand

func RunScanCommand(terrascanBinaryPath, relGoldenFilePath string, exitCode int, outWriter, errWriter io.Writer, args ...string) (*gexec.Session, string)

RunScanCommand executes the scan command, validates exit code

func RunScanCommandWithTimeOut added in v1.18.2

func RunScanCommandWithTimeOut(terrascanBinaryPath, relGoldenFilePath string, exitCode int, outWriter, errWriter io.Writer, scanTimeout int, args ...string) (*gexec.Session, string)

RunScanCommandWithTimeOut executes the scan command, validates exit code added to provide extra option for specifying timeout.

Types

This section is empty.

Jump to

Keyboard shortcuts

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