formats

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: Apache-2.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToIacOrSastTableRow

func ConvertToIacOrSastTableRow(rows []SourceCodeRow) (tableRows []iacOrSastTableRow)

func ConvertToLicenseScanTableRow

func ConvertToLicenseScanTableRow(rows []LicenseRow) (tableRows []licenseScanTableRow)

func ConvertToLicenseTableRow

func ConvertToLicenseTableRow(rows []LicenseRow) (tableRows []licenseTableRow)

func ConvertToLicenseViolationScanTableRow

func ConvertToLicenseViolationScanTableRow(rows []LicenseRow) (tableRows []licenseViolationScanTableRow)

func ConvertToLicenseViolationTableRow

func ConvertToLicenseViolationTableRow(rows []LicenseRow) (tableRows []licenseViolationTableRow)

func ConvertToOperationalRiskViolationScanTableRow

func ConvertToOperationalRiskViolationScanTableRow(rows []OperationalRiskViolationRow) (tableRows []operationalRiskViolationScanTableRow)

func ConvertToOperationalRiskViolationTableRow

func ConvertToOperationalRiskViolationTableRow(rows []OperationalRiskViolationRow) (tableRows []operationalRiskViolationTableRow)

func ConvertToSecretsTableRow

func ConvertToSecretsTableRow(rows []SourceCodeRow) (tableRows []secretsTableRow)

func ConvertToVulnerabilityScanTableRow

func ConvertToVulnerabilityScanTableRow(rows []VulnerabilityOrViolationRow) (tableRows []vulnerabilityScanTableRow)

func ConvertToVulnerabilityTableRow

func ConvertToVulnerabilityTableRow(rows []VulnerabilityOrViolationRow) (tableRows []vulnerabilityTableRow)

Types

type Applicability

type Applicability struct {
	Status             string     `json:"status"`
	ScannerDescription string     `json:"scannerDescription,omitempty"`
	Evidence           []Evidence `json:"evidence,omitempty"`
}

type ComponentRow

type ComponentRow struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

type CveRow

type CveRow struct {
	Id            string         `json:"id"`
	CvssV2        string         `json:"cvssV2"`
	CvssV3        string         `json:"cvssV3"`
	Applicability *Applicability `json:"applicability,omitempty"`
}

type Evidence

type Evidence struct {
	Location
	Reason string `json:"reason,omitempty"`
}

type ImpactedDependencyDetails

type ImpactedDependencyDetails struct {
	SeverityDetails
	ImpactedDependencyName    string         `json:"impactedPackageName"`
	ImpactedDependencyVersion string         `json:"impactedPackageVersion"`
	ImpactedDependencyType    string         `json:"impactedPackageType"`
	Components                []ComponentRow `json:"components"`
}

type JfrogResearchInformation

type JfrogResearchInformation struct {
	SeverityDetails
	Summary         string                        `json:"summary,omitempty"`
	Details         string                        `json:"details,omitempty"`
	SeverityReasons []JfrogResearchSeverityReason `json:"severityReasons,omitempty"`
	Remediation     string                        `json:"remediation,omitempty"`
}

type JfrogResearchSeverityReason

type JfrogResearchSeverityReason struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	IsPositive  bool   `json:"isPositive,omitempty"`
}

type LicenseRow

type LicenseRow struct {
	ImpactedDependencyDetails
	LicenseKey  string           `json:"licenseKey"`
	ImpactPaths [][]ComponentRow `json:"impactPaths"`
}

type Location

type Location struct {
	File        string `json:"file"`
	StartLine   int    `json:"startLine,omitempty"`
	StartColumn int    `json:"startColumn,omitempty"`
	EndLine     int    `json:"endLine,omitempty"`
	EndColumn   int    `json:"endColumn,omitempty"`
	Snippet     string `json:"snippet,omitempty"`
}

type OperationalRiskViolationRow

type OperationalRiskViolationRow struct {
	ImpactedDependencyDetails
	RiskReason    string `json:"riskReason"`
	IsEol         string `json:"isEndOfLife"`
	EolMessage    string `json:"endOfLifeMessage"`
	Cadence       string `json:"cadence"`
	Commits       string `json:"commits"`
	Committers    string `json:"committers"`
	NewerVersions string `json:"newerVersions"`
	LatestVersion string `json:"latestVersion"`
}

type ScaSummaryCount added in v1.2.0

type ScaSummaryCount map[string]SummaryCount

Severity -> Applicable status -> Count

func (ScaSummaryCount) GetSeverityCountsWithoutStatus added in v1.2.0

func (sc ScaSummaryCount) GetSeverityCountsWithoutStatus() (severityCounts SummaryCount)

func (ScaSummaryCount) GetTotal added in v1.2.0

func (sc ScaSummaryCount) GetTotal() (total int)

type ScanSummaryResult added in v1.2.0

type ScanSummaryResult struct {
	Target             string           `json:"target,omitempty"`
	ScaScanResults     *ScaSummaryCount `json:"sca,omitempty"`
	IacScanResults     *SummaryCount    `json:"iac,omitempty"`
	SecretsScanResults *SummaryCount    `json:"secrets,omitempty"`
	SastScanResults    *SummaryCount    `json:"sast,omitempty"`
}

func (*ScanSummaryResult) GetSubScanTotalIssueCount added in v1.2.0

func (s *ScanSummaryResult) GetSubScanTotalIssueCount(subScanType SummarySubScanType) (count int)

func (*ScanSummaryResult) GetSubScansWithIssues added in v1.2.0

func (s *ScanSummaryResult) GetSubScansWithIssues() []SummarySubScanType

func (*ScanSummaryResult) GetTotalIssueCount added in v1.2.0

func (s *ScanSummaryResult) GetTotalIssueCount() (total int)

func (*ScanSummaryResult) HasIssues added in v1.2.0

func (s *ScanSummaryResult) HasIssues() bool

type SeverityDetails

type SeverityDetails struct {
	Severity         string `json:"severity"`
	SeverityNumValue int    `json:"-"` // For sorting
}

type SimpleJsonError

type SimpleJsonError struct {
	FilePath     string `json:"filePath"`
	ErrorMessage string `json:"errorMessage"`
}

type SimpleJsonResults

type SimpleJsonResults struct {
	Vulnerabilities           []VulnerabilityOrViolationRow `json:"vulnerabilities"`
	SecurityViolations        []VulnerabilityOrViolationRow `json:"securityViolations"`
	LicensesViolations        []LicenseRow                  `json:"licensesViolations"`
	Licenses                  []LicenseRow                  `json:"licenses"`
	OperationalRiskViolations []OperationalRiskViolationRow `json:"operationalRiskViolations"`
	Secrets                   []SourceCodeRow               `json:"secrets"`
	Iacs                      []SourceCodeRow               `json:"iacViolations"`
	Sast                      []SourceCodeRow               `json:"sastViolations"`
	Errors                    []SimpleJsonError             `json:"errors"`
	MultiScanId               string                        `json:"multiScanId,omitempty"`
}

This struct holds the sorted results of the simple-json output.

type SourceCodeRow

type SourceCodeRow struct {
	SeverityDetails
	Location
	Finding            string       `json:"finding,omitempty"`
	ScannerDescription string       `json:"scannerDescription,omitempty"`
	CodeFlow           [][]Location `json:"codeFlow,omitempty"`
}

type SummaryCount added in v1.2.0

type SummaryCount map[string]int

Severity -> Count

func (SummaryCount) GetTotal added in v1.2.0

func (sc SummaryCount) GetTotal() int

type SummaryResults added in v1.2.0

type SummaryResults struct {
	Scans []ScanSummaryResult `json:"scans"`
}

func (SummaryResults) GetTotalIssueCount added in v1.2.0

func (sr SummaryResults) GetTotalIssueCount() (total int)

type SummarySubScanType added in v1.2.0

type SummarySubScanType string
const (
	ScaScan     SummarySubScanType = "SCA"
	IacScan     SummarySubScanType = "IAC"
	SecretsScan SummarySubScanType = "Secrets"
	SastScan    SummarySubScanType = "SAST"
)

type VulnerabilityOrViolationRow

type VulnerabilityOrViolationRow struct {
	ImpactedDependencyDetails
	Summary                  string                    `json:"summary"`
	Applicable               string                    `json:"applicable"`
	FixedVersions            []string                  `json:"fixedVersions"`
	Cves                     []CveRow                  `json:"cves"`
	IssueId                  string                    `json:"issueId"`
	References               []string                  `json:"references"`
	ImpactPaths              [][]ComponentRow          `json:"impactPaths"`
	JfrogResearchInformation *JfrogResearchInformation `json:"jfrogResearchInformation"`
	Technology               coreutils.Technology      `json:"-"`
}

Used for vulnerabilities and security violations

Jump to

Keyboard shortcuts

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