Documentation ¶
Index ¶
- Constants
- type Artifact
- type ArtifactSummaryParams
- type ArtifactSummaryResponse
- type BinMgrService
- type BuildScanResponse
- type BuildScanService
- type Component
- type Cve
- type CvssScore
- type Error
- type Filter
- type General
- type GraphNode
- type ImpactPathNode
- type Issue
- type License
- type PolicyAlreadyExistsError
- type PolicyService
- func (xps *PolicyService) Create(params utils.PolicyParams) error
- func (xps *PolicyService) Delete(policyName string) error
- func (xps *PolicyService) Get(policyName string) (policyResp *utils.PolicyParams, err error)
- func (xps *PolicyService) GetJfrogHttpClient() *jfroghttpclient.JfrogHttpClient
- func (xps *PolicyService) GetXrayDetails() auth.ServiceDetails
- func (xps *PolicyService) Update(params utils.PolicyParams) error
- type ReportContent
- type ReportContentRequestParams
- type ReportCve
- type ReportDetails
- type ReportRequestParams
- type ReportResponse
- type ReportService
- func (rs *ReportService) Content(request ReportContentRequestParams) (*ReportContent, error)
- func (rs *ReportService) Delete(reportId string) error
- func (rs *ReportService) Details(reportId string) (*ReportDetails, error)
- func (rs *ReportService) Vulnerabilities(req ReportRequestParams) (*ReportResponse, error)
- type Repository
- type RequestBuildScanResponse
- type RequestScanResponse
- type Resource
- type Row
- type ScanResponse
- type ScanService
- type ScanType
- type SummaryResponse
- type SummaryService
- type SummeryComponent
- type SummeryCve
- type VersionService
- type Violation
- type Vulnerability
- type WatchAlreadyExistsError
- type WatchService
- func (xws *WatchService) Create(params utils.WatchParams) error
- func (xws *WatchService) Delete(watchName string) error
- func (xws *WatchService) Get(watchName string) (watchResp *utils.WatchParams, err error)
- func (xws *WatchService) GetJfrogHttpClient() *jfroghttpclient.JfrogHttpClient
- func (xws *WatchService) GetXrayDetails() auth.ServiceDetails
- func (xws *WatchService) Update(params utils.WatchParams) error
- type XrayBuildParams
- type XrayGraphScanParams
Constants ¶
const ( // ReportsAPI refer to: https://www.jfrog.com/confluence/display/JFROG/Xray+REST+API#XrayRESTAPI-REPORTS ReportsAPI = "api/v1/reports" VulnerabilitiesAPI = ReportsAPI + "/vulnerabilities" )
const (
XrayScanBuildNoFailBuildPolicy = "No Xray “Fail build in case of a violation” policy rule has been defined on this build"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArtifactSummaryParams ¶
type ArtifactSummaryResponse ¶
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) GetBuildScanResults ¶
func (bs *BuildScanService) GetBuildScanResults(params XrayBuildParams, includeVulnerabilities bool) (*BuildScanResponse, error)
func (*BuildScanService) Scan ¶
func (bs *BuildScanService) Scan(params XrayBuildParams) error
type Component ¶
type Component struct { FixedVersions []string `json:"fixed_versions,omitempty"` ImpactPaths [][]ImpactPathNode `json:"impact_paths,omitempty"` }
type GraphNode ¶
type GraphNode struct { // Component Id in the JFrog standard. // For instance, for maven: gav://<groupId>:<artifactId>:<version> // For detailed format examples please see: // https://www.jfrog.com/confluence/display/JFROG/Xray+REST+API#XrayRESTAPI-ComponentIdentifiers Id string `json:"component_id,omitempty"` // Sha of the binary representing the component. Sha256 string `json:"sha256,omitempty"` Sha1 string `json:"sha1,omitempty"` // For root file shall be the file name. // For internal components shall be the internal path. (Relevant only for binary scan). Path string `json:"path,omitempty"` // List of license names Licenses []string `json:"licenses,omitempty"` // Component properties Properties map[string]string `json:"properties,omitempty"` // List of sub components. Nodes []*GraphNode `json:"nodes,omitempty"` // Node parent (for internal use) Parent *GraphNode `json:"-"` }
func (*GraphNode) NodeHasLoop ¶
type ImpactPathNode ¶
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 []SummeryCve `json:"cves,omitempty"` Created string `json:"created,omitempty"` ImpactPath []string `json:"impact_path,omitempty"` Components []SummeryComponent `json:"components,omitempty"` }
type PolicyAlreadyExistsError ¶
type PolicyAlreadyExistsError struct {
InnerError error
}
func (*PolicyAlreadyExistsError) Error ¶
func (*PolicyAlreadyExistsError) Error() string
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 ¶
ReportContent defines a report content response
type ReportContentRequestParams ¶
type ReportContentRequestParams struct { ReportId string Direction string PageNum int NumRows int OrderBy string }
ReportContentRequestParams defines a report content request
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 ReportRequestParams ¶
type ReportRequestParams struct { Name string `json:"name,omitempty"` Filters Filter `json:"filters,omitempty"` Resources Resource `json:"resources,omitempty"` }
ReportRequestParams defines a report request
type ReportResponse ¶
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 ¶
func (rs *ReportService) Content(request ReportContentRequestParams) (*ReportContent, error)
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) Vulnerabilities ¶
func (rs *ReportService) Vulnerabilities(req ReportRequestParams) (*ReportResponse, error)
Vulnerabilities requests a new Xray scan for vulnerabilities
type Repository ¶
type Repository struct {
Name string `json:"name,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 { IncludePathPatterns []string `json:"include_path_patterns,omitempty"` Repositories []Repository `json:"repositories,omitempty"` }
type Row ¶
type Row struct { 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"` Path string `json:"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"` References []string `json:"references,omitempty"` ExternalAdvisorySource string `json:"external_advisory_source,omitempty"` ExternalAdvisorySeverity string `json:"external_advisory_severity,omitempty"` }
Row defines an entry of the report content
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 bool) (*ScanResponse, error)
func (*ScanService) ScanGraph ¶
func (ss *ScanService) ScanGraph(scanParams XrayGraphScanParams) (string, error)
type SummaryResponse ¶
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 SummeryComponent ¶
type SummeryCve ¶
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"` }
type Vulnerability ¶
type Vulnerability struct { Cves []Cve `json:"cves,omitempty"` Summary string `json:"summary,omitempty"` Severity string `json:"severity,omitempty"` VulnerableComponents []string `json:"vulnerable_components,omitempty"` Components map[string]Component `json:"components,omitempty"` IssueId string `json:"issue_id,omitempty"` }
type WatchAlreadyExistsError ¶
type WatchAlreadyExistsError struct {
InnerError error
}
func (*WatchAlreadyExistsError) Error ¶
func (*WatchAlreadyExistsError) Error() string
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 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 Graph *GraphNode }
func (*XrayGraphScanParams) GetProjectKey ¶
func (gp *XrayGraphScanParams) GetProjectKey() string