Documentation ¶
Index ¶
- Constants
- func PollingAction(client *jfroghttpclient.JfrogHttpClient, endPoint string, ...) (action func() (shouldStop bool, responseBody []byte, err error))
- func UnpackWatchBody(watch *WatchParams, body *WatchBody)
- type AssignedPolicy
- type BinaryGraphNode
- type ExposuresCatagories
- type ExposuresFilterName
- type GraphNode
- type IgnoreFilterNameVersion
- type IgnoreFilterNameVersionPath
- type IgnoreFilters
- type IgnoreRuleBody
- type IgnoreRuleParams
- type OtherComponentIds
- type PolicyAction
- type PolicyBlockDownload
- type PolicyBody
- type PolicyCriteria
- type PolicyCvssRange
- type PolicyParams
- type PolicyRule
- type PolicyType
- type Severity
- type WatchBody
- type WatchBuildType
- type WatchBuildsAllParams
- type WatchBuildsByNameParams
- type WatchBuildsParams
- type WatchParams
- type WatchPathFilters
- type WatchRepositoriesParams
- type WatchRepositoriesType
- type WatchRepository
- type WatchRepositoryAll
- type WatchRepositoryType
Constants ¶
const ( // WatchBuildAll is the option where all builds are watched WatchBuildAll WatchBuildType = "all" // WatchBuildByName is the option where builds are selected by name to be watched WatchBuildByName WatchBuildType = "byname" // WatchRepositoryLocal is a local repository WatchRepositoryLocal WatchRepositoryType = "local" // WatchRepositoryRemote is a remote repository WatchRepositoryRemote WatchRepositoryType = "remote" // WatchRepositoriesAll is the option where all repositories are watched WatchRepositoriesAll WatchRepositoriesType = "all" // WatchRepositoriesByName is the option where repositories are selected by name to be watched WatchRepositoriesByName WatchRepositoriesType = "byname" )
Variables ¶
This section is empty.
Functions ¶
func PollingAction ¶ added in v1.42.0
func PollingAction(client *jfroghttpclient.JfrogHttpClient, endPoint string, httpClientDetails httputils.HttpClientDetails) (action func() (shouldStop bool, responseBody []byte, err error))
func UnpackWatchBody ¶
func UnpackWatchBody(watch *WatchParams, body *WatchBody)
UnpackWatchBody unpacks a payload response from Xray. It transforms the data into the params object so that a consumer can interact with a watch in a consistent way.
Types ¶
type AssignedPolicy ¶
AssignedPolicy struct is used to define a policy associated with a watch
type BinaryGraphNode ¶ added in v1.32.0
type BinaryGraphNode 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 subcomponents. Nodes []*BinaryGraphNode `json:"nodes,omitempty"` // Other component IDs field is populated by the Xray indexer to get a better accuracy in '.deb' files. OtherComponentIds []OtherComponentIds `json:"other_component_ids,omitempty"` }
Binary Scan Graph Node
type ExposuresCatagories ¶ added in v1.43.0
type ExposuresFilterName ¶ added in v1.43.0
type ExposuresFilterName struct { Catagories []ExposuresCatagories `json:"catagories,omitempty"` Scanners []string `json:"scanners,omitempty"` FilePath []string `json:"file_path,omitempty"` }
type GraphNode ¶ added in v1.28.4
type GraphNode struct { // Node parent (for internal use) Parent *GraphNode `json:"-"` // The "classifier" attribute in a Maven pom.xml specifies an additional qualifier for a dependency Classifier *string `json:"-"` // Node file types (tar, jar, zip, pom) Types *[]string `json:"-"` Id string `json:"component_id,omitempty"` // List of subcomponents. Nodes []*GraphNode `json:"nodes,omitempty"` }
Audit Graph Node
func (*GraphNode) NodeHasLoop ¶ added in v1.28.4
type IgnoreFilterNameVersion ¶ added in v1.43.0
type IgnoreFilterNameVersionPath ¶ added in v1.43.0
type IgnoreFilterNameVersionPath struct { IgnoreFilterNameVersion Path string `json:"path,omitempty"` }
type IgnoreFilters ¶ added in v1.43.0
type IgnoreFilters struct { Vulnerabilities []string `json:"vulnerabilities,omitempty"` Licenses []string `json:"licenses,omitempty"` CVEs []string `json:"cves,omitempty"` Policies []string `json:"policies,omitempty"` Watches []string `json:"watches,omitempty"` DockerLayers []string `json:"docker-layers,omitempty"` OperationalRisks []string `json:"operational_risk,omitempty"` Exposures []ExposuresFilterName `json:"exposures,omitempty"` ReleaseBundles []IgnoreFilterNameVersion `json:"release-bundles,omitempty"` Builds []IgnoreFilterNameVersion `json:"builds,omitempty"` Components []IgnoreFilterNameVersion `json:"components,omitempty"` Artifacts []IgnoreFilterNameVersionPath `json:"artifacts,omitempty"` }
type IgnoreRuleBody ¶ added in v1.43.0
type IgnoreRuleBody struct { Id string `json:"id,omitempty"` Author string `json:"author,omitempty"` Created time.Time `json:"created,omitempty"` IsExpired bool `json:"is_expired,omitempty"` IgnoreRuleParams }
func CreateIgnoreRuleBody ¶ added in v1.43.0
func CreateIgnoreRuleBody(ignoreRuleParams IgnoreRuleParams) IgnoreRuleBody
type IgnoreRuleParams ¶ added in v1.43.0
type IgnoreRuleParams struct { Notes string `json:"notes"` ExpiresAt time.Time `json:"expires_at,omitempty"` IgnoreFilters IgnoreFilters `json:"ignore_filters"` }
func NewIgnoreRuleParams ¶ added in v1.43.0
func NewIgnoreRuleParams() IgnoreRuleParams
type OtherComponentIds ¶ added in v1.28.4
type PolicyAction ¶ added in v0.20.1
type PolicyAction struct { Webhooks []string `json:"webhooks,omitempty"` BlockDownload PolicyBlockDownload `json:"block_download,omitempty"` BlockReleaseBundleDistribution *bool `json:"block_release_bundle_distribution,omitempty"` FailBuild *bool `json:"fail_build,omitempty"` NotifyDeployer *bool `json:"notify_deployer,omitempty"` NotifyWatchRecipients *bool `json:"notify_watch_recipients,omitempty"` CustomSeverity Severity `json:"custom_severity,omitempty"` }
type PolicyBlockDownload ¶ added in v0.20.1
type PolicyBody ¶ added in v0.20.1
type PolicyBody struct { Name string `json:"name,omitempty"` Type PolicyType `json:"type,omitempty"` Description string `json:"description,omitempty"` Author string `json:"author,omitempty"` Rules []PolicyRule `json:"rules,omitempty"` Created time.Time `json:"created,omitempty"` Modified time.Time `json:"modified,omitempty"` }
PolicyBody is the top level payload to be sent to Xray
func CreatePolicyBody ¶ added in v0.20.1
func CreatePolicyBody(policyParams PolicyParams) PolicyBody
type PolicyCriteria ¶ added in v0.20.1
type PolicyCriteria struct { // Security MinSeverity Severity `json:"min_severity,omitempty"` CvssRange *PolicyCvssRange `json:"cvss_range,omitempty"` // License AllowedLicenses []string `json:"allowed_licenses,omitempty"` BannedLicenses []string `json:"banned_licenses,omitempty"` AllowUnknown *bool `json:"allow_unknown,omitempty"` MultiLicensePermissive *bool `json:"multi_license_permissive,omitempty"` }
func CreateCvssRangePolicyCriteria ¶ added in v0.20.1
func CreateCvssRangePolicyCriteria(from float64, to float64) *PolicyCriteria
Create security policy criteria with range. from - CVSS range from 0.0 to 10.0 to - CVSS range from 0.0 to 10.0
func CreateLicensePolicyCriteria ¶ added in v0.20.1
func CreateLicensePolicyCriteria(allowedLicenses, allowUnknown, multiLicensePermissive bool, licenses ...string) *PolicyCriteria
Create license policy criteria allowedLicenses - true if the provided licenses are allowed, false if banned allowUnknown - true if should allow unknown licenses, otherwise a violation will be generated for artifacts with unknown licenses multiLicensePermissive - do not generate a violation if at least one license is valid in cases whereby multiple licenses were detected on the component licenses - the target licenses
func CreateSeverityPolicyCriteria ¶ added in v0.20.1
func CreateSeverityPolicyCriteria(minSeverity Severity) *PolicyCriteria
Create security policy criteria with min severity
type PolicyCvssRange ¶ added in v0.20.1
type PolicyParams ¶ added in v0.20.1
type PolicyParams struct { Name string Type PolicyType Description string Rules []PolicyRule }
func NewPolicyParams ¶ added in v0.20.1
func NewPolicyParams() PolicyParams
type PolicyRule ¶ added in v0.20.1
type PolicyRule struct { Name string `json:"name,omitempty"` Criteria PolicyCriteria `json:"criteria,omitempty"` Actions *PolicyAction `json:"actions,omitempty"` Priority int `json:"priority,omitempty"` }
type PolicyType ¶ added in v0.20.1
type PolicyType string
const ( Security PolicyType = "security" License PolicyType = "license" )
type WatchBody ¶
type WatchBody struct { GeneralData watchGeneralParams `json:"general_data"` ProjectResources watchProjectResources `json:"project_resources,omitempty"` AssignedPolicies []AssignedPolicy `json:"assigned_policies,omitempty"` }
WatchBody is the top level payload to be sent to Xray
func CreateBody ¶
func CreateBody(params WatchParams) (*WatchBody, error)
CreateBody creates a payload to configure a Watch in Xray This can configure repositories and builds However, bundles are not supported.
type WatchBuildType ¶
type WatchBuildType string
WatchBuildType defines the type of filter for a builds on a watch
type WatchBuildsAllParams ¶
type WatchBuildsAllParams struct { BinMgrID string WatchPathFilters }
WatchBuildsAllParams is used to define the parameters when a watch uses all builds
type WatchBuildsByNameParams ¶
WatchBuildsByNameParams is used to define a specific build in a watch
type WatchBuildsParams ¶
type WatchBuildsParams struct { Type WatchBuildType All WatchBuildsAllParams ByNames map[string]WatchBuildsByNameParams }
WatchBuildsParams is a struct that stores the build configuration for watch
type WatchParams ¶
type WatchParams struct { Name string Description string Active bool Repositories WatchRepositoriesParams Builds WatchBuildsParams Policies []AssignedPolicy }
WatchParams defines all the properties to create an Xray watch
func NewWatchParams ¶
func NewWatchParams() WatchParams
NewWatchParams creates a new struct to configure an Xray watch
type WatchPathFilters ¶
type WatchPathFilters struct { ExcludePatterns []string `json:"ExcludePatterns"` IncludePatterns []string `json:"IncludePatterns"` }
WatchPathFilters is used to define path filters on a repository or a build in a watch
type WatchRepositoriesParams ¶
type WatchRepositoriesParams struct { Type WatchRepositoriesType All WatchRepositoryAll Repositories map[string]WatchRepository WatchPathFilters }
WatchRepositoriesParams is a struct that stores the repository configuration for watch
type WatchRepositoriesType ¶
type WatchRepositoriesType string
WatchRepositoriesType defines the type of filter for a repositories on a watch
type WatchRepository ¶
type WatchRepository struct { Name string BinMgrID string RepoType WatchRepositoryType Filters watchFilters }
WatchRepository is used to define a specific repository in a watch
func NewWatchRepository ¶
func NewWatchRepository(name string, binMgrID string, repoType WatchRepositoryType) WatchRepository
NewWatchRepository creates a new repository struct to configure an Xray Watch
type WatchRepositoryAll ¶
type WatchRepositoryAll struct {
Filters watchFilters
}
WatchRepositoryAll is used to define the parameters when a watch uses all repositories
type WatchRepositoryType ¶ added in v0.17.0
type WatchRepositoryType string
WatchRepositoryType defines the type of Repository for a watch