services

package
v1.41.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BuildScanAPI = "api/v2/ci/build"

	XrayScanBuildNoFailBuildPolicy = "No Xray “Fail build in case of a violation” policy rule has been defined on this build"
)
View Source
const (
	// ReportsAPI refer to: https://www.jfrog.com/confluence/display/JFROG/Xray+REST+API#XrayRESTAPI-REPORTS
	ReportsAPI      = "api/v1/reports"
	Vulnerabilities = "vulnerabilities"
	Licenses        = "licenses"
	Violations      = "violations"
)
View Source
const (

	// ScanType values
	Dependency ScanType = "dependency"
	Binary     ScanType = "binary"

	XscGraphAPI = "api/v1/sca/scan/graph"

	XscVersionAPI = "api/v1/system/version"

	XraySuffix = "/xray/"

	XscSuffix = "/xsc/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifact

type Artifact struct {
	General  General          `json:"general,omitempty"`
	Issues   []Issue          `json:"issues,omitempty"`
	Licenses []SummaryLicense `json:"licenses,omitempty"`
}

type ArtifactDescriptor

type ArtifactDescriptor struct {
	NameVersion
	Path string `json:"path"`
}

ArtifactDescriptor struct representing each item in the "artifacts" array

type ArtifactSummaryParams

type ArtifactSummaryParams struct {
	Checksums []string `json:"checksums,omitempty"`
	Paths     []string `json:"paths,omitempty"`
}

type ArtifactSummaryResponse

type ArtifactSummaryResponse struct {
	Artifacts []Artifact `json:"artifacts,omitempty"`
	Errors    []Error    `json:"errors,omitempty"`
}

type BinMgrService

type BinMgrService struct {
	XrayDetails auth.ServiceDetails
	// contains filtered or unexported fields
}

BinMgrService defines the http client and Xray details

func NewBinMgrService

func NewBinMgrService(client *jfroghttpclient.JfrogHttpClient) *BinMgrService

NewBinMgrService creates a new Xray Binary Manager Service

func (*BinMgrService) AddBuildsToIndexing

func (xbms *BinMgrService) AddBuildsToIndexing(buildNames []string) error

AddBuildsToIndexing will add builds to indexing configuration

func (*BinMgrService) GetJfrogHttpClient

func (xbms *BinMgrService) GetJfrogHttpClient() *jfroghttpclient.JfrogHttpClient

GetJfrogHttpClient returns the http client

func (*BinMgrService) GetXrayDetails

func (xbms *BinMgrService) GetXrayDetails() auth.ServiceDetails

GetXrayDetails returns the Xray details

type BuildScanResponse

type BuildScanResponse struct {
	Status          string          `json:"status,omitempty"`
	MoreDetailsUrl  string          `json:"more_details_url,omitempty"`
	FailBuild       bool            `json:"fail_build,omitempty"`
	Violations      []Violation     `json:"violations,omitempty"`
	Vulnerabilities []Vulnerability `json:"vulnerabilities,omitempty"`
	Info            string          `json:"info,omitempty"`
}

type BuildScanService

type BuildScanService struct {
	XrayDetails auth.ServiceDetails
	// contains filtered or unexported fields
}

func NewBuildScanService

func NewBuildScanService(client *jfroghttpclient.JfrogHttpClient) *BuildScanService

NewBuildScanService creates a new service to scan build dependencies.

func (*BuildScanService) ScanBuild

func (bs *BuildScanService) ScanBuild(params XrayBuildParams, includeVulnerabilities bool) (scanResponse *BuildScanResponse, noFailBuildPolicy bool, err error)

type Component

type Component struct {
	FixedVersions []string           `json:"fixed_versions,omitempty"`
	ImpactPaths   [][]ImpactPathNode `json:"impact_paths,omitempty"`
	Cpes          []string           `json:"cpes,omitempty"`
}

type Cve

type Cve struct {
	Id           string         `json:"cve,omitempty"`
	CvssV2Score  string         `json:"cvss_v2_score,omitempty"`
	CvssV2Vector string         `json:"cvss_v2_vector,omitempty"`
	CvssV3Score  string         `json:"cvss_v3_score,omitempty"`
	CvssV3Vector string         `json:"cvss_v3_vector,omitempty"`
	Cwe          []string       `json:"cwe,omitempty"`
	CweDetails   map[string]Cwe `json:"cwe_details,omitempty"`
}

type CvssScore

type CvssScore struct {
	MinScore float32 `json:"min_score,omitempty"`
	MaxScore float32 `json:"max_score,omitempty"`
}

type Cwe

type Cwe struct {
	Name        string        `json:"name,omitempty"`
	Description string        `json:"description,omitempty"`
	Categories  []CweCategory `json:"categories,omitempty"`
}

type CweCategory

type CweCategory struct {
	Category string `json:"category,omitempty"`
	Rank     string `json:"rank,omitempty"`
}

type DateTimeRange

type DateTimeRange struct {
	Start string `json:"start,omitempty"`
	End   string `json:"end,omitempty"`
}

type EntitlementsService

type EntitlementsService struct {
	XrayDetails auth.ServiceDetails
	// contains filtered or unexported fields
}

func NewEntitlementsService

func NewEntitlementsService(client *jfroghttpclient.JfrogHttpClient) *EntitlementsService

NewEntitlementsService creates a new service to retrieve the entitlement data from Xray

func (*EntitlementsService) GetXrayDetails

func (es *EntitlementsService) GetXrayDetails() auth.ServiceDetails

GetXrayDetails returns the Xray details

func (*EntitlementsService) IsEntitled

func (es *EntitlementsService) IsEntitled(featureId string) (entitled bool, err error)

IsEntitled returns true if the user is entitled for the requested feature ID

type Error

type Error struct {
	Error      string `json:"error,omitempty"`
	Identifier string `json:"identifier,omitempty"`
}

type ExtendedInformation

type ExtendedInformation struct {
	ShortDescription             string                        `json:"short_description,omitempty"`
	FullDescription              string                        `json:"full_description,omitempty"`
	JfrogResearchSeverity        string                        `json:"jfrog_research_severity,omitempty"`
	JfrogResearchSeverityReasons []JfrogResearchSeverityReason `json:"jfrog_research_severity_reasons,omitempty"`
	Remediation                  string                        `json:"remediation,omitempty"`
}

type Filter

type Filter VulnerabilitiesFilter

For backwork compatibility keeping old struct name

type General

type General struct {
	ComponentId string `json:"component_id,omitempty"`
	Name        string `json:"name,omitempty"`
	Path        string `json:"path,omitempty"`
	PkgType     string `json:"pkg_type,omitempty"`
	Sha256      string `json:"sha256,omitempty"`
}

type IgnoreFilters

type IgnoreFilters struct {
	ReleaseBundles  []NameVersion        `json:"release_bundles,omitempty"`
	Builds          []NameVersion        `json:"builds,omitempty"`
	Components      []NameVersion        `json:"components,omitempty"`
	Artifacts       []ArtifactDescriptor `json:"artifacts,omitempty"`
	Policies        []string             `json:"policies,omitempty"`
	DockerLayers    []string             `json:"docker_layers,omitempty"`
	Vulnerabilities []string             `json:"vulnerabilities,omitempty"`
	Licenses        []string             `json:"licenses,omitempty"`
	CVEs            []string             `json:"cves,omitempty"`
	Watches         []string             `json:"watches,omitempty"`
	OperationalRisk []string             `json:"operational_risk,omitempty"`
}

IgnoreFilters struct representing the "ignore_filters" object

type IgnoreRule

type IgnoreRule struct {
	Notes     string        `json:"notes"`
	ExpiresAt *time.Time    `json:"expires_at,omitempty"`
	Filters   IgnoreFilters `json:"ignore_filters"`
}

IgnoreRule struct representing an Ignore Rule

type IgnoreRuleDetail

type IgnoreRuleDetail struct {
	IgnoreRule
	ID        string    `json:"id"`
	Author    string    `json:"author"`
	Created   time.Time `json:"created"`
	IsExpired bool      `json:"is_expired"`
}

IgnoreRuleDetail struct representing an Ignore Rule as returned by the API

type IgnoreRuleNotFoundError

type IgnoreRuleNotFoundError struct {
	InnerError error
}

func (IgnoreRuleNotFoundError) Error

func (e IgnoreRuleNotFoundError) Error() string

type IgnoreRuleResponse

type IgnoreRuleResponse struct {
	Data       []IgnoreRuleDetail `json:"data"`
	TotalCount int                `json:"total_count"`
}

IgnoreRuleResponse struct representing the entire JSON

type IgnoreRulesGetAllParams

type IgnoreRulesGetAllParams struct {
	Vulnerability        string    `json:"vulnerability"`
	License              string    `json:"license"`
	Policy               string    `json:"policy"`
	Watch                string    `json:"watch"`
	ComponentName        string    `json:"component_name"`
	ComponentVersion     string    `json:"component_version"`
	ArtifactName         string    `json:"artifact_name"`
	ArtifactVersion      string    `json:"artifact_version"`
	BuildName            string    `json:"build_name"`
	BuildVersion         string    `json:"build_version"`
	ReleaseBundleName    string    `json:"release_bundle_name"`
	ReleaseBundleVersion string    `json:"release_bundle_version"`
	DockerLayer          string    `json:"docker_layer"`
	ExpiresBefore        time.Time `json:"expires_before"`
	ExpiresAfter         time.Time `json:"expires_after"`
	ProjectKey           string    `json:"project_key"`
	OrderBy              string    `json:"order_by"`
	Direction            string    `json:"direction"`
	PageNum              int       `json:"page_num"`
	NumOfRows            int       `json:"num_of_rows"`
}

type IgnoreRulesService

type IgnoreRulesService struct {
	XrayDetails auth.ServiceDetails
	// contains filtered or unexported fields
}

IgnoreRulesService defines the http client and Xray details

func NewIgnoreRulesService

func NewIgnoreRulesService(client *jfroghttpclient.JfrogHttpClient) *IgnoreRulesService

NewIgnoreRulesService creates a new Xray Policy Service

func (*IgnoreRulesService) CheckMinimumVersion

func (irs *IgnoreRulesService) CheckMinimumVersion() error

func (*IgnoreRulesService) Create

func (irs *IgnoreRulesService) Create(ignoreRule IgnoreRule) (string, error)

Create will create a new Xray ignore rule

func (*IgnoreRulesService) Delete

func (irs *IgnoreRulesService) Delete(ruleId string) error

Delete will delete an existing ignore rule by ruleId It will error if no ignore rule can be found by that ruleId.

func (*IgnoreRulesService) Get

func (irs *IgnoreRulesService) Get(ruleId string) (ignoreRule *IgnoreRuleDetail, err error)

Get retrieves the details about an Xray ignore rule by its id It will error if no policy can be found by that name.

func (*IgnoreRulesService) GetAll

func (irs *IgnoreRulesService) GetAll(params *IgnoreRulesGetAllParams) (ignoreRules *IgnoreRuleResponse, err error)

GetAll retrieves the details about all Xray ignore rules that match the given parameters

func (*IgnoreRulesService) GetJfrogHttpClient

func (irs *IgnoreRulesService) GetJfrogHttpClient() *jfroghttpclient.JfrogHttpClient

GetJfrogHttpClient returns the http client

func (*IgnoreRulesService) GetXrayDetails

func (irs *IgnoreRulesService) GetXrayDetails() auth.ServiceDetails

GetXrayDetails returns the Xray details

type ImpactPathNode

type ImpactPathNode struct {
	ComponentId string `json:"component_id,omitempty"`
	FullPath    string `json:"full_path,omitempty"`
}

type Issue

type Issue struct {
	IssueId                string             `json:"issue_id,omitempty"`
	Summary                string             `json:"summary,omitempty"`
	Description            string             `json:"description,omitempty"`
	IssueType              string             `json:"issue_type,omitempty"`
	Severity               string             `json:"severity,omitempty"`
	Provider               string             `json:"provider,omitempty"`
	Cves                   []SummaryCve       `json:"cves,omitempty"`
	Created                string             `json:"created,omitempty"`
	ImpactPath             []string           `json:"impact_path,omitempty"`
	Components             []SummaryComponent `json:"components,omitempty"`
	ComponentPhysicalPaths []string           `json:"component_physical_paths,omitempty"`
}

type JfrogResearchSeverityReason

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

type License

type License struct {
	Key        string               `json:"license_key,omitempty"`
	Name       string               `json:"name,omitempty"`
	Components map[string]Component `json:"components,omitempty"`
	Custom     bool                 `json:"custom,omitempty"`
	References []string             `json:"references,omitempty"`
}

type LicensesFilter

type LicensesFilter struct {
	Component       string        `json:"component,omitempty"`
	Artifact        string        `json:"artifact,omitempty"`
	Unknown         *bool         `json:"unknown,omitempty"`
	Unrecognized    *bool         `json:"unrecognized,omitempty"`
	LicenseNames    []string      `json:"license_names,omitempty"`
	LicensePatterns []string      `json:"license_patterns,omitempty"`
	ScanDate        DateTimeRange `json:"scan_date,omitempty"`
}

type LicensesReportRequestParams

type LicensesReportRequestParams struct {
	Name      string         `json:"name,omitempty"`
	Filters   LicensesFilter `json:"filters,omitempty"`
	Resources Resource       `json:"resources,omitempty"`
}

LicensesReportRequestParams defines a report request

type NameVersion

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

NameVersion struct representing items with a Name / Version combo

type PolicyAlreadyExistsError

type PolicyAlreadyExistsError struct {
	InnerError error
}

func (*PolicyAlreadyExistsError) Error

type PolicyService

type PolicyService struct {
	XrayDetails auth.ServiceDetails
	// contains filtered or unexported fields
}

PolicyService defines the http client and Xray details

func NewPolicyService

func NewPolicyService(client *jfroghttpclient.JfrogHttpClient) *PolicyService

NewPolicyService creates a new Xray Policy Service

func (*PolicyService) Create

func (xps *PolicyService) Create(params utils.PolicyParams) error

Create will create a new Xray policy

func (*PolicyService) Delete

func (xps *PolicyService) Delete(policyName string) error

Delete will delete an existing policy by name It will error if no policy can be found by that name.

func (*PolicyService) Get

func (xps *PolicyService) Get(policyName string) (policyResp *utils.PolicyParams, err error)

Get retrieves the details about an Xray policy by its name It will error if no policy can be found by that name.

func (*PolicyService) GetJfrogHttpClient

func (xps *PolicyService) GetJfrogHttpClient() *jfroghttpclient.JfrogHttpClient

GetJfrogHttpClient returns the http client

func (*PolicyService) GetXrayDetails

func (xps *PolicyService) GetXrayDetails() auth.ServiceDetails

GetXrayDetails returns the Xray details

func (*PolicyService) Update

func (xps *PolicyService) Update(params utils.PolicyParams) error

Update will update an existing Xray policy by name It will error if no policy can be found by that name.

type ReportContent

type ReportContent struct {
	TotalRows int   `json:"total_rows"`
	Rows      []Row `json:"rows"`
}

ReportContent defines a report content response

type ReportContentRequestParams

type ReportContentRequestParams struct {
	ReportType string
	ReportId   string
	Direction  string
	PageNum    int
	NumRows    int
	OrderBy    string
}

ReportContentRequestParams defines a report content request

type ReportCve

type ReportCve struct {
	Id           string  `json:"cve,omitempty"`
	CvssV2Score  float64 `json:"cvss_v2_score,omitempty"`
	CvssV2Vector string  `json:"cvss_v2_vector,omitempty"`
	CvssV3Score  float64 `json:"cvss_v3_score,omitempty"`
	CvssV3Vector string  `json:"cvss_v3_vector,omitempty"`
}

type ReportDetails

type ReportDetails struct {
	Id                 int    `json:"id,omitempty"`
	Name               string `json:"name,omitempty"`
	Type               string `json:"report_type,omitempty"`
	Status             string `json:"status,omitempty"`
	TotalArtifacts     int    `json:"total_artifacts,omitempty"`
	ProcessedArtifacts int    `json:"num_of_processed_artifacts,omitempty"`
	Progress           int    `json:"progress,omitempty"`
	RowCount           int    `json:"number_of_rows,omitempty"`
	StartTime          string `json:"start_time,omitempty"`
	EndTime            string `json:"end_time,omitempty"`
	Author             string `json:"author,omitempty"`
}

ReportDetails defines the detail response for an Xray report

type ReportResponse

type ReportResponse struct {
	ReportId int    `json:"report_id"`
	Status   string `json:"status"`
}

ReportResponse defines a report request response

type ReportService

type ReportService struct {
	XrayDetails auth.ServiceDetails
	// contains filtered or unexported fields
}

ReportService defines the Http client and Xray details

func NewReportService

func NewReportService(client *jfroghttpclient.JfrogHttpClient) *ReportService

NewReportService creates a new Xray Report Service

func (*ReportService) Content

Content retrieves the report content for the provided request

func (*ReportService) Delete

func (rs *ReportService) Delete(reportId string) error

Delete deletes the report that has an id matching reportId

func (*ReportService) Details

func (rs *ReportService) Details(reportId string) (*ReportDetails, error)

Details retrieves the details for a report

func (*ReportService) Licenses

Licenses requests a new Xray scan for licenses

func (*ReportService) Violations

Violations requests a new Xray scan for violations

func (*ReportService) Vulnerabilities

Vulnerabilities requests a new Xray scan for vulnerabilities

type Repository

type Repository struct {
	Name                string   `json:"name,omitempty"`
	IncludePathPatterns []string `json:"include_path_patterns,omitempty"`
}

type RequestBuildScanResponse

type RequestBuildScanResponse struct {
	Info string `json:"info,omitempty"`
}

type RequestScanResponse

type RequestScanResponse struct {
	ScanId string `json:"scan_id,omitempty"`
}

type Resource

type Resource struct {
	Repositories []Repository `json:"repositories,omitempty"`
}

type Row

type Row struct {
	// Vulnerability Report field
	Cves                     []ReportCve `json:"cves,omitempty"`
	Cvsv2MaxScore            float64     `json:"cvss2_max_score,omitempty"`
	Cvsv3MaxScore            float64     `json:"cvss3_max_score,omitempty"`
	Summary                  string      `json:"summary,omitempty"`
	Severity                 string      `json:"severity,omitempty"`
	SeveritySource           string      `json:"severity_source,omitempty"`
	VulnerableComponent      string      `json:"vulnerable_component,omitempty"`
	ImpactedArtifact         string      `json:"impacted_artifact,omitempty"`
	ImpactPath               []string    `json:"impact_path,omitempty"`
	FixedVersions            []string    `json:"fixed_versions,omitempty"`
	Published                string      `json:"published,omitempty"`
	IssueId                  string      `json:"issue_id,omitempty"`
	PackageType              string      `json:"package_type,omitempty"`
	Provider                 string      `json:"provider,omitempty"`
	Description              string      `json:"description,omitempty"`
	ExternalAdvisorySource   string      `json:"external_advisory_source,omitempty"`
	ExternalAdvisorySeverity string      `json:"external_advisory_severity,omitempty"`
	// Licenses Report field
	License          string `json:"license,omitempty"`
	LicenseName      string `json:"license_name,omitempty"`
	Component        string `json:"component,omitempty"`
	Artifact         string `json:"artifact,omitempty"`
	ArtifactScanTime string `json:"artifact_scan_time,omitempty"`
	Unknown          *bool  `json:"unknown,omitempty"`
	Unrecognized     *bool  `json:"unrecognized,omitempty"`
	Custom           *bool  `json:"custom,omitempty"`
	// Common field
	Path       string   `json:"path,omitempty"`
	References []string `json:"references,omitempty"`
}

Row defines an entry of the report content

type ScanErrorJson

type ScanErrorJson struct {
	Error string `json:"error"`
}

type ScanResponse

type ScanResponse struct {
	ScanId             string          `json:"scan_id,omitempty"`
	XrayDataUrl        string          `json:"xray_data_url,omitempty"`
	Violations         []Violation     `json:"violations,omitempty"`
	Vulnerabilities    []Vulnerability `json:"vulnerabilities,omitempty"`
	Licenses           []License       `json:"licenses,omitempty"`
	ScannedComponentId string          `json:"component_id,omitempty"`
	ScannedPackageType string          `json:"package_type,omitempty"`
	ScannedStatus      string          `json:"status,omitempty"`
}

type ScanService

type ScanService struct {
	XrayDetails auth.ServiceDetails
	// contains filtered or unexported fields
}

func NewScanService

func NewScanService(client *jfroghttpclient.JfrogHttpClient) *ScanService

NewScanService creates a new service to scan binaries and audit code projects' dependencies.

func (*ScanService) GetScanGraphResults

func (ss *ScanService) GetScanGraphResults(scanId string, includeVulnerabilities, includeLicenses, xscEnabled bool) (*ScanResponse, error)

func (*ScanService) IsXscEnabled

func (ss *ScanService) IsXscEnabled() (xsxVersion string, err error)

IsXscEnabled will try to get XSC version. If route is not available, user is not entitled for XSC.

func (*ScanService) ScanGraph

func (ss *ScanService) ScanGraph(scanParams XrayGraphScanParams) (string, error)

func (*ScanService) SendScanGitInfoContext

func (ss *ScanService) SendScanGitInfoContext(details *XscGitInfoContext) (multiScanId string, err error)

type ScanType

type ScanType string

type SummaryComponent

type SummaryComponent struct {
	ComponentId   string   `json:"component_id,omitempty"`
	FixedVersions []string `json:"fixed_versions,omitempty"`
}

type SummaryCve

type SummaryCve struct {
	Id          string   `json:"cve,omitempty"`
	CvssV2Score string   `json:"cvss_v2,omitempty"`
	CvssV3Score string   `json:"cvss_v3,omitempty"`
	Cwe         []string `json:"cwe,omitempty"`
}

type SummaryLicense

type SummaryLicense struct {
	Components  []string `json:"components,omitempty"`
	FullName    string   `json:"full_name,omitempty"`
	MoreInfoUrl []string `json:"more_info_url,omitempty"`
	Name        string   `json:"name,omitempty"`
}

type SummaryResponse

type SummaryResponse struct {
	Issues []Issue
	Errors []Error
}

type SummaryService

type SummaryService struct {
	XrayDetails auth.ServiceDetails
	// contains filtered or unexported fields
}

SummaryService returns the https client and Xray details

func NewSummaryService

func NewSummaryService(client *jfroghttpclient.JfrogHttpClient) *SummaryService

NewSummaryService creates a new service to retrieve the version of Xray

func (*SummaryService) GetArtifactSummary

func (ss *SummaryService) GetArtifactSummary(params ArtifactSummaryParams) (*ArtifactSummaryResponse, error)

func (*SummaryService) GetBuildSummary

func (ss *SummaryService) GetBuildSummary(params XrayBuildParams) (*SummaryResponse, error)

type VersionService

type VersionService struct {
	XrayDetails auth.ServiceDetails
	// contains filtered or unexported fields
}

VersionService returns the https client and Xray details

func NewVersionService

func NewVersionService(client *jfroghttpclient.JfrogHttpClient) *VersionService

NewVersionService creates a new service to retrieve the version of Xray

func (*VersionService) GetVersion

func (vs *VersionService) GetVersion() (string, error)

GetVersion returns the version of Xray

func (*VersionService) GetXrayDetails

func (vs *VersionService) GetXrayDetails() auth.ServiceDetails

GetXrayDetails returns the Xray details

type Violation

type Violation struct {
	Summary             string               `json:"summary,omitempty"`
	Severity            string               `json:"severity,omitempty"`
	ViolationType       string               `json:"type,omitempty"`
	Components          map[string]Component `json:"components,omitempty"`
	WatchName           string               `json:"watch_name,omitempty"`
	IssueId             string               `json:"issue_id,omitempty"`
	Cves                []Cve                `json:"cves,omitempty"`
	References          []string             `json:"references,omitempty"`
	FailBuild           bool                 `json:"fail_build,omitempty"`
	LicenseKey          string               `json:"license_key,omitempty"`
	LicenseName         string               `json:"license_name,omitempty"`
	IgnoreUrl           string               `json:"ignore_url,omitempty"`
	RiskReason          string               `json:"risk_reason,omitempty"`
	IsEol               *bool                `json:"is_eol,omitempty"`
	EolMessage          string               `json:"eol_message,omitempty"`
	LatestVersion       string               `json:"latest_version,omitempty"`
	NewerVersions       *int                 `json:"newer_versions,omitempty"`
	Cadence             *float64             `json:"cadence,omitempty"`
	Commits             *int64               `json:"commits,omitempty"`
	Committers          *int                 `json:"committers,omitempty"`
	ExtendedInformation *ExtendedInformation `json:"extended_information,omitempty"`
	Technology          string               `json:"-"`
}

type ViolationsFilter

type ViolationsFilter struct {
	Type            string                `json:"type,omitempty"`
	WatchNames      []string              `json:"watch_names,omitempty"`
	WatchPatterns   []string              `json:"watch_patterns,omitempty"`
	Component       string                `json:"component,omitempty"`
	Artifact        string                `json:"artifact,omitempty"`
	PolicyNames     []string              `json:"policy_names,omitempty"`
	Severities      []string              `json:"severities,omitempty"`
	Updated         DateTimeRange         `json:"updated,omitempty"`
	SecurityFilters VulnerabilitiesFilter `json:"security_filters,omitempty"`
	LicenseFilters  LicensesFilter        `json:"license_filters,omitempty"`
}

type ViolationsReportRequestParams

type ViolationsReportRequestParams struct {
	Name      string           `json:"name,omitempty"`
	Filters   ViolationsFilter `json:"filters,omitempty"`
	Resources Resource         `json:"resources,omitempty"`
}

ViolationsReportRequestParams defines a report request

type VulnerabilitiesFilter

type VulnerabilitiesFilter struct {
	VulnerableComponent string        `json:"vulnerable_component,omitempty"`
	ImpactedArtifact    string        `json:"impacted_artifact,omitempty"`
	SummaryContains     string        `json:"summary_contains,omitempty"`
	HasRemediation      *bool         `json:"has_remediation,omitempty"`
	Cve                 string        `json:"cve,omitempty"`
	IssueId             string        `json:"issue_id,omitempty"`
	Severity            []string      `json:"severities,omitempty"`
	CvssScore           CvssScore     `json:"cvss_score,omitempty"`
	Published           DateTimeRange `json:"published,omitempty"`
	ScanDate            DateTimeRange `json:"scan_date,omitempty"`
}

type VulnerabilitiesReportRequestParams

type VulnerabilitiesReportRequestParams struct {
	Name      string                `json:"name,omitempty"`
	Filters   VulnerabilitiesFilter `json:"filters,omitempty"`
	Resources Resource              `json:"resources,omitempty"`
}

VulnerabilitiesReportRequestParams defines a report request

type Vulnerability

type Vulnerability struct {
	Cves                []Cve                `json:"cves,omitempty"`
	Summary             string               `json:"summary,omitempty"`
	Severity            string               `json:"severity,omitempty"`
	Components          map[string]Component `json:"components,omitempty"`
	IssueId             string               `json:"issue_id,omitempty"`
	References          []string             `json:"references,omitempty"`
	ExtendedInformation *ExtendedInformation `json:"extended_information,omitempty"`
	Technology          string               `json:"-"`
}

type WatchAlreadyExistsError

type WatchAlreadyExistsError struct {
	InnerError error
}

func (*WatchAlreadyExistsError) Error

type WatchService

type WatchService struct {
	XrayDetails auth.ServiceDetails
	// contains filtered or unexported fields
}

WatchService defines the http client and Xray details

func NewWatchService

func NewWatchService(client *jfroghttpclient.JfrogHttpClient) *WatchService

NewWatchService creates a new Xray Watch Service

func (*WatchService) Create

func (xws *WatchService) Create(params utils.WatchParams) error

Create will create a new Xray watch

func (*WatchService) Delete

func (xws *WatchService) Delete(watchName string) error

Delete will delete an existing watch by name It will error if no watch can be found by that name.

func (*WatchService) Get

func (xws *WatchService) Get(watchName string) (watchResp *utils.WatchParams, err error)

Get retrieves the details about an Xray watch by its name It will error if no watch can be found by that name.

func (*WatchService) GetJfrogHttpClient

func (xws *WatchService) GetJfrogHttpClient() *jfroghttpclient.JfrogHttpClient

GetJfrogHttpClient returns the http client

func (*WatchService) GetXrayDetails

func (xws *WatchService) GetXrayDetails() auth.ServiceDetails

GetXrayDetails returns the Xray details

func (*WatchService) Update

func (xws *WatchService) Update(params utils.WatchParams) error

Update will update an existing Xray watch by name It will error if no watch can be found by that name.

type XrayBuildParams

type XrayBuildParams struct {
	BuildName   string `json:"build_name,omitempty"`
	BuildNumber string `json:"build_number,omitempty"`
	Project     string `json:"project,omitempty"`
	Rescan      bool   `json:"rescan,omitempty"`
}

type XrayGraphScanParams

type XrayGraphScanParams struct {
	// A path in Artifactory that this Artifact is intended to be deployed to.
	// This will provide a way to extract the watches that should be applied on this graph
	RepoPath   string
	ProjectKey string
	Watches    []string
	ScanType   ScanType
	// Dependencies Tree
	DependenciesGraph *xrayUtils.GraphNode
	// Binary tree received from indexer-app
	BinaryGraph            *xrayUtils.BinaryGraphNode
	IncludeVulnerabilities bool
	IncludeLicenses        bool
	XscGitInfoContext      *XscGitInfoContext
	XscVersion             string
	MultiScanId            string
}

func (*XrayGraphScanParams) GetProjectKey

func (gp *XrayGraphScanParams) GetProjectKey() string

type XscGitInfoContext

type XscGitInfoContext struct {
	GitRepoUrl    string   `json:"git_repo_url"`
	GitRepoName   string   `json:"git_repo_name,omitempty"`
	GitProject    string   `json:"git_project,omitempty"`
	GitProvider   string   `json:"git_provider,omitempty"`
	Technologies  []string `json:"technologies,omitempty"`
	BranchName    string   `json:"branch_name"`
	LastCommit    string   `json:"last_commit,omitempty"`
	CommitHash    string   `json:"commit_hash"`
	CommitMessage string   `json:"commit_message,omitempty"`
	CommitAuthor  string   `json:"commit_author,omitempty"`
}

type XscPostContextResponse

type XscPostContextResponse struct {
	MultiScanId string `json:"multi_scan_id,omitempty"`
}

type XscVersionResponse

type XscVersionResponse struct {
	Version string `json:"xsc_version"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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