Documentation
¶
Index ¶
- Variables
- func CheckIfFailBuild(results []services.ScanResponse) bool
- func CreateJsonLicensesTable(licenses []services.License, multipleRoots bool) ([]map[string]interface{}, error)
- func CreateJsonViolationsTable(violations []services.Violation, multipleRoots bool) ([]map[string]interface{}, []map[string]interface{}, []map[string]interface{}, ...)
- func CreateJsonVulnerabilitiesTable(vulnerabilities []services.Vulnerability, multipleRoots bool) ([]map[string]interface{}, error)
- func DownloadIndexerIfNeeded(xrayManager *xray.XrayServicesManager, xrayVersionStr string) (indexerPath string, err error)
- func NewFailBuildError() error
- func PrepareViolationsTable(violations []services.Violation, multipleRoots, coloredOutput bool) ([]VulnerabilityRow, []LicenseViolationRow, []operationalRiskViolationRow, ...)
- func PrintLicensesTable(licenses []services.License, multipleRoots, printExtended bool) error
- func PrintScanResults(results []services.ScanResponse, format OutputFormat, ...) error
- func PrintViolationsTable(violations []services.Violation, multipleRoots, printExtended bool) error
- func PrintVulnerabilitiesTable(vulnerabilities []services.Vulnerability, multipleRoots, printExtended bool) error
- type ComponentRow
- type CveRow
- type LicenseRow
- type LicenseViolationRow
- type OutputFormat
- type ResultsSimpleJson
- type VulnerabilityRow
Constants ¶
This section is empty.
Variables ¶
var OutputFormats = []string{string(Table), string(Json), string(SimpleJson)}
Functions ¶
func CheckIfFailBuild ¶ added in v2.7.0
func CheckIfFailBuild(results []services.ScanResponse) bool
func CreateJsonLicensesTable ¶ added in v2.11.3
func CreateJsonLicensesTable(licenses []services.License, multipleRoots bool) ([]map[string]interface{}, error)
Same as PrintLicensesTable, but table is returned as a json map array.
func CreateJsonViolationsTable ¶ added in v2.11.3
func CreateJsonViolationsTable(violations []services.Violation, multipleRoots bool) ([]map[string]interface{}, []map[string]interface{}, []map[string]interface{}, error)
Same as PrintViolationsTable, but table is returned as a json map array.
func CreateJsonVulnerabilitiesTable ¶ added in v2.11.3
func CreateJsonVulnerabilitiesTable(vulnerabilities []services.Vulnerability, multipleRoots bool) ([]map[string]interface{}, error)
Same as PrintVulnerabilitiesTable, but table is returned as a json map array.
func DownloadIndexerIfNeeded ¶
func DownloadIndexerIfNeeded(xrayManager *xray.XrayServicesManager, xrayVersionStr string) (indexerPath string, err error)
func NewFailBuildError ¶ added in v2.7.0
func NewFailBuildError() error
func PrepareViolationsTable ¶ added in v2.11.3
func PrepareViolationsTable(violations []services.Violation, multipleRoots, coloredOutput bool) ([]VulnerabilityRow, []LicenseViolationRow, []operationalRiskViolationRow, error)
func PrintLicensesTable ¶ added in v2.1.0
PrintLicensesTable prints the licenses in a table. Set multipleRoots to true in case the given licenses array contains (or may contain) results of several projects or files (like in binary scan). In case multipleRoots is true, the field Component will show the root of each impact path, otherwise it will show the root's child. Set printExtended to true to print fields with 'extended' tag.
func PrintScanResults ¶ added in v2.4.0
func PrintScanResults(results []services.ScanResponse, format OutputFormat, includeVulnerabilities, includeLicenses, isMultipleRoots, printExtended bool) error
func PrintViolationsTable ¶
PrintViolationsTable prints the violations in 4 tables: security violations, license compliance violations, operational risk violations and ignore rule URLs. Set multipleRoots to true in case the given violations array contains (or may contain) results of several projects or files (like in binary scan). In case multipleRoots is true, the field Component will show the root of each impact path, otherwise it will show the root's child. In case one (or more) of the violations contains the field FailBuild set to true, CliError with exit code 3 will be returned. Set printExtended to true to print fields with 'extended' tag.
func PrintVulnerabilitiesTable ¶
func PrintVulnerabilitiesTable(vulnerabilities []services.Vulnerability, multipleRoots, printExtended bool) error
PrintVulnerabilitiesTable prints the vulnerabilities in a table. Set multipleRoots to true in case the given vulnerabilities array contains (or may contain) results of several projects or files (like in binary scan). In case multipleRoots is true, the field Component will show the root of each impact path, otherwise it will show the root's child. Set printExtended to true to print fields with 'extended' tag.
Types ¶
type ComponentRow ¶ added in v2.12.0
type LicenseRow ¶ added in v2.12.0
type LicenseRow struct { LicenseKey string `col-name:"License"` ImpactedPackageName string `col-name:"Impacted\nPackage"` ImpactedPackageVersion string `col-name:"Impacted\nPackage\nVersion"` ImpactedPackageType string `col-name:"Type"` Components []ComponentRow `embed-table:"true"` }
func PrepareJsonLicensesTable ¶ added in v2.11.3
func PrepareJsonLicensesTable(licenses []services.License, multipleRoots bool) ([]LicenseRow, error)
type LicenseViolationRow ¶ added in v2.12.0
type LicenseViolationRow struct { LicenseKey string `col-name:"License"` Severity string `col-name:"Severity"` SeverityNumValue int // For sorting ImpactedPackageName string `col-name:"Impacted\nPackage"` ImpactedPackageVersion string `col-name:"Impacted\nPackage\nVersion"` ImpactedPackageType string `col-name:"Type"` Components []ComponentRow `embed-table:"true"` }
type OutputFormat ¶ added in v2.7.0
type OutputFormat string
const ( // OutputFormat values Table OutputFormat = "table" Json OutputFormat = "json" SimpleJson OutputFormat = "simple-json" )
type ResultsSimpleJson ¶ added in v2.11.3
type ResultsSimpleJson struct { Vulnerabilities []map[string]interface{} SecurityViolations []map[string]interface{} LicensesViolations []map[string]interface{} OperationalRiskViolations []map[string]interface{} Licenses []map[string]interface{} }
This struct holds the sorted results of the simple-json output.
type VulnerabilityRow ¶ added in v2.12.0
type VulnerabilityRow struct { Severity string `col-name:"Severity"` SeverityNumValue int // For sorting ImpactedPackageName string `col-name:"Impacted\nPackage"` ImpactedPackageVersion string `col-name:"Impacted\nPackage\nVersion"` ImpactedPackageType string `col-name:"Type"` FixedVersions string `col-name:"Fixed\nVersions"` Components []ComponentRow `embed-table:"true"` Cves []CveRow `embed-table:"true"` IssueId string `col-name:"Issue ID" extended:"true"` }
Used for vulnerabilities and security violations
func PrepareVulnerabilitiesTable ¶ added in v2.11.3
func PrepareVulnerabilitiesTable(vulnerabilities []services.Vulnerability, multipleRoots, coloredOutput bool) ([]VulnerabilityRow, error)