xray

package
v3.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PoliciesEndpoint = "xray/api/v2/policies"
	PolicyEndpoint   = "xray/api/v2/policies/{name}"
)
View Source
const (
	ReportsEndpoint = "xray/api/v1/reports/{reportType}"
	ReportEndpoint  = "xray/api/v1/reports/{reportId}"
)
View Source
const (
	CustomIssuesEndpoint  = "xray/api/v1/events"
	CustomIssueEndpoint   = "xray/api/v1/events/{id}"
	CustomIssueEndpointV2 = "xray/api/v2/events/{id}"
)
View Source
const (
	IgnoreRulesEndpoint = "xray/api/v1/ignore_rules"
	IgnoreRuleEndpoint  = "xray/api/v1/ignore_rules/{id}"
)
View Source
const (
	DBSyncEndPoint              = "xray/api/v1/configuration/dbsync/time"
	BasicSettingsUpdateEndpoint = "artifactory/api/xrayRepo/updateXrayBasicSettings"
)
View Source
const (
	WatchesEndpoint = "xray/api/v2/watches"
	WatchEndpoint   = "xray/api/v2/watches/{name}"
)
View Source
const (
	WebhooksEndpoint = "xray/api/v1/webhooks"
	WebhookEndpoint  = "xray/api/v1/webhooks/{name}"
)
View Source
const BinaryManagerBuildsEndpoint = "xray/api/v1/binMgr/{id}/builds"
View Source
const BinaryManagerReleaseBundleV2Endpoint = "xray/api/v1/binMgr/{id}/release_bundle_v2"
View Source
const BinaryManagerReposEndpoint = "xray/api/v1/binMgr/{id}/repos"
View Source
const WorkersCountEndpoint = "xray/api/v1/configuration/workersCount"

Variables

This section is empty.

Functions

func NewBinaryManagerBuildsResource

func NewBinaryManagerBuildsResource() resource.Resource

func NewBinaryManagerReleaseBundlesV2Resource

func NewBinaryManagerReleaseBundlesV2Resource() resource.Resource

func NewBinaryManagerReposResource

func NewBinaryManagerReposResource() resource.Resource

func NewCustomIssueResource

func NewCustomIssueResource() resource.Resource

func NewIgnoreRuleResource

func NewIgnoreRuleResource() resource.Resource

func NewLicensePolicyResource

func NewLicensePolicyResource() resource.Resource

func NewLicensesReportResource

func NewLicensesReportResource() resource.Resource

func NewOperationalRiskPolicyResource

func NewOperationalRiskPolicyResource() resource.Resource

func NewOperationalRisksReportResource

func NewOperationalRisksReportResource() resource.Resource

func NewRepositoryConfigResource

func NewRepositoryConfigResource() resource.Resource

func NewSecurityPolicyResource

func NewSecurityPolicyResource() resource.Resource

func NewSettingsResource

func NewSettingsResource() resource.Resource

func NewViolationsReportResource

func NewViolationsReportResource() resource.Resource

func NewVulnerabilitiesReportResource

func NewVulnerabilitiesReportResource() resource.Resource

func NewWatchResource

func NewWatchResource() resource.Resource

func NewWebhookResource

func NewWebhookResource() resource.Resource

func NewWorkersCountResource

func NewWorkersCountResource() resource.Resource

Types

type AllOtherArtifactsAPIModel

type AllOtherArtifactsAPIModel struct {
	IndexNewArtifacts bool  `json:"index_new_artifacts"`
	RetentionInDays   int64 `json:"retention_in_days"`
}

type BasicSettingsRequestAPIModel

type BasicSettingsRequestAPIModel struct {
	Enabled                     bool  `json:"xrayEnabled"`
	AllowBlocked                bool  `json:"allowBlockedArtifactsDownload"`
	AllowWhenUnavailable        bool  `json:"allowDownloadsXrayUnavailable"`
	BlockUnscannedTimeout       int64 `json:"blockUnscannedTimeoutSeconds"`
	BlockUnfinishedScansTimeout int64 `json:"blockUnfinishedScansTimeoutSeconds"`
}

the API doc is wrong and schemas for request and response are not identical!

type BasicSettingsResponseAPIModel

type BasicSettingsResponseAPIModel struct {
	Enabled                     bool  `json:"xrayEnabled"`
	AllowBlocked                bool  `json:"xrayAllowBlocked"`
	AllowWhenUnavailable        bool  `json:"xrayAllowWhenUnavailable"`
	BlockUnscannedTimeout       int64 `json:"blockUnscannedTimeoutSeconds"`
	BlockUnfinishedScansTimeout int64 `json:"blockUnfinishedScansTimeoutSeconds"`
}

type BinaryManagerBuildsAPIModel

type BinaryManagerBuildsAPIModel struct {
	BinManagerID     string   `json:"bin_mgr_id"`
	IndexedBuilds    []string `json:"indexed_builds"`
	NonIndexedBuilds []string `json:"non_indexed_builds"`
}

type BinaryManagerBuildsResource

type BinaryManagerBuildsResource struct {
	ProviderData util.ProviderMetadata
	TypeName     string
}

func (*BinaryManagerBuildsResource) Configure

func (*BinaryManagerBuildsResource) Create

func (*BinaryManagerBuildsResource) Delete

func (*BinaryManagerBuildsResource) ImportState

ImportState imports the resource into the Terraform state.

func (*BinaryManagerBuildsResource) Metadata

func (*BinaryManagerBuildsResource) Read

func (*BinaryManagerBuildsResource) Schema

func (*BinaryManagerBuildsResource) Update

type BinaryManagerBuildsResourceModel

type BinaryManagerBuildsResourceModel struct {
	ID               types.String `tfsdk:"id"`
	ProjectKey       types.String `tfsdk:"project_key"`
	IndexedBuilds    types.Set    `tfsdk:"indexed_builds"`
	NonIndexedBuilds types.Set    `tfsdk:"non_indexed_builds"`
}

type BinaryManagerReleaseBundlesV2APIModel

type BinaryManagerReleaseBundlesV2APIModel struct {
	BinManagerID               string   `json:"bin_mgr_id"`
	IndexedReleaseBundlesV2    []string `json:"indexed_release_bundle_v2"`
	NonIndexedReleaseBundlesV2 []string `json:"non_indexed_release_bundle_v2"`
}

type BinaryManagerReleaseBundlesV2Resource

type BinaryManagerReleaseBundlesV2Resource struct {
	ProviderData util.ProviderMetadata
	TypeName     string
}

func (*BinaryManagerReleaseBundlesV2Resource) Configure

func (*BinaryManagerReleaseBundlesV2Resource) Create

func (*BinaryManagerReleaseBundlesV2Resource) Delete

func (*BinaryManagerReleaseBundlesV2Resource) ImportState

ImportState imports the resource into the Terraform state.

func (*BinaryManagerReleaseBundlesV2Resource) Metadata

func (*BinaryManagerReleaseBundlesV2Resource) Read

func (*BinaryManagerReleaseBundlesV2Resource) Schema

func (*BinaryManagerReleaseBundlesV2Resource) Update

type BinaryManagerReleaseBundlesV2ResourceModel

type BinaryManagerReleaseBundlesV2ResourceModel struct {
	ID                         types.String `tfsdk:"id"`
	ProjectKey                 types.String `tfsdk:"project_key"`
	IndexedReleaseBundlesV2    types.Set    `tfsdk:"indexed_release_bundle_v2"`
	NonIndexedReleaseBundlesV2 types.Set    `tfsdk:"non_indexed_release_bundle_v2"`
}

type BinaryManagerRepoAPIModel

type BinaryManagerRepoAPIModel struct {
	Name        string `json:"name"`
	Type        string `json:"type"`
	PackageType string `json:"pkg_type"`
}

type BinaryManagerReposAPIModel

type BinaryManagerReposAPIModel struct {
	BinManagerID    string                      `json:"bin_mgr_id"`
	IndexedRepos    []BinaryManagerRepoAPIModel `json:"indexed_repos"`
	NonIndexedRepos []BinaryManagerRepoAPIModel `json:"non_indexed_repos"`
}

type BinaryManagerReposResource

type BinaryManagerReposResource struct {
	ProviderData util.ProviderMetadata
	TypeName     string
}

func (*BinaryManagerReposResource) Configure

func (*BinaryManagerReposResource) Create

func (*BinaryManagerReposResource) Delete

func (*BinaryManagerReposResource) ImportState

ImportState imports the resource into the Terraform state.

func (*BinaryManagerReposResource) Metadata

func (*BinaryManagerReposResource) Read

func (*BinaryManagerReposResource) Schema

func (*BinaryManagerReposResource) Update

type BinaryManagerReposResourceModel

type BinaryManagerReposResourceModel struct {
	ID              types.String `tfsdk:"id"`
	ProjectKey      types.String `tfsdk:"project_key"`
	IndexedRepos    types.Set    `tfsdk:"indexed_repos"`
	NonIndexedRepos types.Set    `tfsdk:"non_indexed_repos"`
}

type BlockDownloadSettingsAPIModel

type BlockDownloadSettingsAPIModel struct {
	Unscanned bool `json:"unscanned"`
	Active    bool `json:"active"`
}

type BuildsAPIModel

type BuildsAPIModel struct {
	Names                  []string `json:"names,omitempty"`
	IncludePatterns        []string `json:"include_patterns,omitempty"`
	ExcludePatterns        []string `json:"exclude_patterns,omitempty"`
	NumberOfLatestVersions int64    `json:"number_of_latest_versions,omitempty"`
}

type CVEAPIModel

type CVEAPIModel struct {
	CVE    string `json:"cve"`
	CVSSv2 string `json:"cvss_v2"`
	CVSSv3 string `json:"cvss_v3"`
}

type CVSSScoreAPIModel

type CVSSScoreAPIModel struct {
	MinScore float64 `json:"min_score,omitempty"`
	MaxScore float64 `json:"max_score,omitempty"`
}

type ComponentAPIModel

type ComponentAPIModel struct {
	ID                 string                    `json:"id"`
	VulnerableVersions []string                  `json:"vulnerable_versions"`
	FixedVersions      []string                  `json:"fixed_versions"`
	VulnerableRanges   []VulnerableRangeAPIModel `json:"vulnerable_ranges"`
}

type CustomIssueAPIModel

type CustomIssueAPIModel struct {
	ID          string              `json:"id"`
	Description string              `json:"description"`
	Summary     string              `json:"summary"`
	Type        string              `json:"type"`
	Provider    string              `json:"provider"`
	PackageType string              `json:"package_type"`
	Severity    string              `json:"severity"`
	Components  []ComponentAPIModel `json:"components"`
	CVEs        []CVEAPIModel       `json:"cves"`
	Sources     []SourceAPIModel    `json:"sources"`
}

type CustomIssueResource

type CustomIssueResource struct {
	ProviderData util.ProviderMetadata
	TypeName     string
}

func (*CustomIssueResource) Configure

func (*CustomIssueResource) Create

func (*CustomIssueResource) Delete

func (*CustomIssueResource) ImportState

ImportState imports the resource into the Terraform state.

func (*CustomIssueResource) Metadata

func (*CustomIssueResource) Read

func (*CustomIssueResource) Schema

func (*CustomIssueResource) Update

type CustomIssueResourceModel

type CustomIssueResourceModel struct {
	ID           types.String `tfsdk:"id"`
	Name         types.String `tfsdk:"name"`
	Description  types.String `tfsdk:"description"`
	Summary      types.String `tfsdk:"summary"`
	Type         types.String `tfsdk:"type"`
	ProviderName types.String `tfsdk:"provider_name"`
	PackageType  types.String `tfsdk:"package_type"`
	Severity     types.String `tfsdk:"severity"`
	Component    types.Set    `tfsdk:"component"`
	CVE          types.Set    `tfsdk:"cve"`
	Source       types.Set    `tfsdk:"source"`
}

type DbSyncDailyUpdatesTimeAPIModel

type DbSyncDailyUpdatesTimeAPIModel struct {
	DbSyncTime string `json:"db_sync_updates_time"`
}

type DbSyncDailyUpdatesTimeErrorAPIModel

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

type ExposuresAPIModel

type ExposuresAPIModel struct {
	ScannersCategory map[string]bool `json:"scanners_category"`
}

type FiltersAPIModel

type FiltersAPIModel struct {
	VulnerableComponent string                   `json:"vulnerable_component,omitempty"` // Vulnerability report filter
	ImpactedArtifact    string                   `json:"impacted_artifact,omitempty"`
	HasRemediation      bool                     `json:"has_remediation,omitempty"`
	CVE                 string                   `json:"cve,omitempty"`
	IssueId             string                   `json:"issue_id,omitempty"`
	CVSSScore           *CVSSScoreAPIModel       `json:"cvss_score,omitempty"`
	Published           *StartAndEndDateAPIModel `json:"published,omitempty"`
	Unknown             bool                     `json:"unknown"` // Licenses report filter
	Unrecognized        bool                     `json:"unrecognized"`
	LicenseNames        []string                 `json:"license_names,omitempty"`
	LicensePatterns     []string                 `json:"license_patterns,omitempty"`
	Type                string                   `json:"type,omitempty"` // Violations report filter
	WatchNames          []string                 `json:"watch_names,omitempty"`
	WatchPatterns       []string                 `json:"watch_patterns,omitempty"`
	PolicyNames         []string                 `json:"policy_names,omitempty"`
	Updated             *StartAndEndDateAPIModel `json:"updated"`
	SecurityFilters     *SecurityFilterAPIModel  `json:"security_filters,omitempty"`
	LicenseFilters      *LicenseFilterAPIModel   `json:"license_filters,omitempty"`
	Risks               []string                 `json:"risks,omitempty"`     // Operational risks filter
	ScanDate            *StartAndEndDateAPIModel `json:"scan_date,omitempty"` // Common attributes
	Component           string                   `json:"component,omitempty"`
	Artifact            string                   `json:"artifact,omitempty"`
	Severities          []string                 `json:"severities,omitempty"`
}

type IgnoreFilterNameVersionAPIModel

type IgnoreFilterNameVersionAPIModel struct {
	Name    string `json:"name"`
	Version string `json:"version,omitempty"`
}

type IgnoreFilterNameVersionPathAPIModel

type IgnoreFilterNameVersionPathAPIModel struct {
	IgnoreFilterNameVersionAPIModel
	Path string `json:"path,omitempty"`
}

type IgnoreFilterNameVersionProjectAPIModel

type IgnoreFilterNameVersionProjectAPIModel struct {
	IgnoreFilterNameVersionAPIModel
	Project string `json:"project,omitempty"`
}

type IgnoreFiltersAPIModel

type IgnoreFiltersAPIModel 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"`
	ReleaseBundles   []IgnoreFilterNameVersionAPIModel        `json:"release-bundles,omitempty"`
	Builds           []IgnoreFilterNameVersionProjectAPIModel `json:"builds,omitempty"`
	Components       []IgnoreFilterNameVersionAPIModel        `json:"components,omitempty"`
	Artifacts        []IgnoreFilterNameVersionPathAPIModel    `json:"artifacts,omitempty"`
}

type IgnoreRuleAPIModel

type IgnoreRuleAPIModel struct {
	ID            string                `json:"id,omitempty"`
	Author        string                `json:"author,omitempty"`
	Created       *time.Time            `json:"created,omitempty"`
	IsExpired     bool                  `json:"is_expired,omitempty"`
	Notes         string                `json:"notes"`
	ExpiresAt     *time.Time            `json:"expires_at,omitempty"`
	IgnoreFilters IgnoreFiltersAPIModel `json:"ignore_filters"`
}

type IgnoreRuleResource

type IgnoreRuleResource struct {
	ProviderData util.ProviderMetadata
	TypeName     string
}

func (*IgnoreRuleResource) Configure

func (*IgnoreRuleResource) Create

func (*IgnoreRuleResource) Delete

func (*IgnoreRuleResource) ImportState

ImportState imports the resource into the Terraform state.

func (*IgnoreRuleResource) Metadata

func (*IgnoreRuleResource) Read

func (*IgnoreRuleResource) Schema

func (*IgnoreRuleResource) Update

type IgnoreRuleResourceModel

type IgnoreRuleResourceModel struct {
	ID               types.String `tfsdk:"id"`
	ProjectKey       types.String `tfsdk:"project_key"`
	Notes            types.String `tfsdk:"notes"`
	ExpiredAt        types.String `tfsdk:"expiration_date"`
	Author           types.String `tfsdk:"author"`
	Created          types.String `tfsdk:"created"`
	IsExpired        types.Bool   `tfsdk:"is_expired"`
	Vulnerabilities  types.Set    `tfsdk:"vulnerabilities"`
	CVEs             types.Set    `tfsdk:"cves"`
	Licenses         types.Set    `tfsdk:"licenses"`
	OperationalRisks types.Set    `tfsdk:"operational_risk"`
	Policies         types.Set    `tfsdk:"policies"`
	Watches          types.Set    `tfsdk:"watches"`
	DockerLayers     types.Set    `tfsdk:"docker_layers"`
	ReleaseBundles   types.Set    `tfsdk:"release_bundle"`
	Builds           types.Set    `tfsdk:"build"`
	Components       types.Set    `tfsdk:"component"`
	Artifacts        types.Set    `tfsdk:"artifact"`
}

type IsRFC3339TimeValidator

type IsRFC3339TimeValidator struct{}

func IsRFC3339Time

func IsRFC3339Time() IsRFC3339TimeValidator

func (IsRFC3339TimeValidator) Description

func (v IsRFC3339TimeValidator) Description(ctx context.Context) string

Description returns a plain text description of the validator's behavior, suitable for a practitioner to understand its impact.

func (IsRFC3339TimeValidator) MarkdownDescription

func (v IsRFC3339TimeValidator) MarkdownDescription(ctx context.Context) string

MarkdownDescription returns a markdown formatted description of the validator's behavior, suitable for a practitioner to understand its impact.

func (IsRFC3339TimeValidator) ValidateString

Validate runs the main validation logic of the validator, reading configuration data out of `req` and updating `resp` with diagnostics.

type LicenseFilterAPIModel

type LicenseFilterAPIModel struct {
	Unknown         bool     `json:"unknown"`
	Unrecognized    bool     `json:"unrecognized"`
	LicenseNames    []string `json:"license_names,omitempty"`
	LicensePatterns []string `json:"license_patterns,omitempty"`
}

type LicensePolicyResource

type LicensePolicyResource struct {
	PolicyResource
}

func (*LicensePolicyResource) Configure

func (*LicensePolicyResource) Create

func (*LicensePolicyResource) Delete

func (*LicensePolicyResource) ImportState

ImportState imports the resource into the Terraform state.

func (*LicensePolicyResource) Metadata

func (*LicensePolicyResource) Read

func (*LicensePolicyResource) Schema

func (*LicensePolicyResource) Update

type LicensesReportResource

type LicensesReportResource struct {
	ReportResource
}

func (*LicensesReportResource) Configure

func (*LicensesReportResource) Create

func (*LicensesReportResource) Delete

func (*LicensesReportResource) Metadata

func (*LicensesReportResource) Read

func (*LicensesReportResource) Schema

func (*LicensesReportResource) Update

type OperationalRiskCriteriaAPIModel

type OperationalRiskCriteriaAPIModel struct {
	UseAndCondition               bool   `json:"use_and_condition"`
	IsEOL                         bool   `json:"is_eol"`
	ReleaseDateGreaterThanMonths  *int64 `json:"release_date_greater_than_months,omitempty"`
	NewerVersionsGreaterThan      *int64 `json:"newer_versions_greater_than,omitempty"`
	ReleaseCadencePerYearLessThan *int64 `json:"release_cadence_per_year_less_than,omitempty"`
	CommitsLessThan               *int64 `json:"commits_less_than,omitempty"`
	CommittersLessThan            *int64 `json:"committers_less_than,omitempty"`
	Risk                          string `json:"risk,omitempty"`
}

type OperationalRiskPolicyResource

type OperationalRiskPolicyResource struct {
	PolicyResource
}

func (*OperationalRiskPolicyResource) Configure

func (*OperationalRiskPolicyResource) Create

func (*OperationalRiskPolicyResource) Delete

func (*OperationalRiskPolicyResource) ImportState

ImportState imports the resource into the Terraform state.

func (*OperationalRiskPolicyResource) Metadata

func (*OperationalRiskPolicyResource) Read

func (*OperationalRiskPolicyResource) Schema

func (*OperationalRiskPolicyResource) Update

type OperationalRisksReportResource

type OperationalRisksReportResource struct {
	ReportResource
}

func (*OperationalRisksReportResource) Configure

func (*OperationalRisksReportResource) Create

func (*OperationalRisksReportResource) Delete

func (*OperationalRisksReportResource) Metadata

func (*OperationalRisksReportResource) Read

func (*OperationalRisksReportResource) Schema

func (*OperationalRisksReportResource) Update

type PathsConfigurationAPIModel

type PathsConfigurationAPIModel struct {
	Patterns       []PatternAPIModel         `json:"patterns,omitempty"`
	OtherArtifacts AllOtherArtifactsAPIModel `json:"all_other_artifacts,omitempty"`
}

type PatternAPIModel

type PatternAPIModel struct {
	Include           string `json:"include"`
	Exclude           string `json:"exclude"`
	IndexNewArtifacts bool   `json:"index_new_artifacts"`
	RetentionInDays   int64  `json:"retention_in_days"`
}

type PolicyAPIModel

type PolicyAPIModel struct {
	Name        string                `json:"name"`
	Type        string                `json:"type"`
	ProjectKey  string                `json:"-"`
	Author      string                `json:"author,omitempty"` // Omitempty is used because the field is computed
	Description string                `json:"description"`
	Rules       *[]PolicyRuleAPIModel `json:"rules"`
	Created     string                `json:"created,omitempty"`  // Omitempty is used because the field is computed
	Modified    string                `json:"modified,omitempty"` // Omitempty is used because the field is computed
}

type PolicyCVSSRangeAPIModel

type PolicyCVSSRangeAPIModel struct {
	To   *float64 `json:"to,omitempty"`
	From *float64 `json:"from,omitempty"`
}

type PolicyError

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

type PolicyExposuresAPIModel

type PolicyExposuresAPIModel struct {
	MinSeverity  *string `json:"min_severity,omitempty"`
	Secrets      *bool   `json:"secrets,omitempty"`
	Applications *bool   `json:"applications,omitempty"`
	Services     *bool   `json:"services,omitempty"`
	Iac          *bool   `json:"iac,omitempty"`
}

type PolicyResource

type PolicyResource struct {
	ProviderData util.ProviderMetadata
	TypeName     string
}

func (*PolicyResource) Delete

func (*PolicyResource) ImportState

ImportState imports the resource into the Terraform state.

func (*PolicyResource) Read

type PolicyResourceModel

type PolicyResourceModel struct {
	ID          types.String `tfsdk:"id"`
	Name        types.String `tfsdk:"name"`
	Description types.String `tfsdk:"description"`
	ProjectKey  types.String `tfsdk:"project_key"`
	Type        types.String `tfsdk:"type"`
	Rules       types.Set    `tfsdk:"rule"`
	Author      types.String `tfsdk:"author"`
	Created     types.String `tfsdk:"created"`
	Modified    types.String `tfsdk:"modified"`
}

type PolicyRuleAPIModel

type PolicyRuleAPIModel struct {
	Name     string                      `json:"name"`
	Priority int64                       `json:"priority"`
	Criteria *PolicyRuleCriteriaAPIModel `json:"criteria"`
	Actions  PolicyRuleActionsAPIModel   `json:"actions"`
}

type PolicyRuleActionsAPIModel

type PolicyRuleActionsAPIModel struct {
	Webhooks                       []string                      `json:"webhooks,omitempty"`
	Mails                          []string                      `json:"mails,omitempty"`
	FailBuild                      bool                          `json:"fail_build"`
	BlockDownload                  BlockDownloadSettingsAPIModel `json:"block_download"`
	BlockReleaseBundleDistribution bool                          `json:"block_release_bundle_distribution"`
	BlockReleaseBundlePromotion    bool                          `json:"block_release_bundle_promotion"`
	NotifyWatchRecipients          bool                          `json:"notify_watch_recipients"`
	NotifyDeployer                 bool                          `json:"notify_deployer"`
	CreateJiraTicketEnabled        bool                          `json:"create_ticket_enabled"`
	FailureGracePeriodDays         int64                         `json:"build_failure_grace_period_in_days"`
	// License Actions
	CustomSeverity string `json:"custom_severity,omitempty"`
}

type PolicyRuleCriteriaAPIModel

type PolicyRuleCriteriaAPIModel struct {
	// Security Criteria
	MinimumSeverity string                   `json:"min_severity,omitempty"` // Omitempty is used because the empty field is conflicting with CVSSRange
	CVSSRange       *PolicyCVSSRangeAPIModel `json:"cvss_range,omitempty"`
	// Omitempty is used in FixVersionDependant because an empty field throws an error in Xray below 3.44.3
	FixVersionDependant *bool                    `json:"fix_version_dependant,omitempty"`
	ApplicableCVEsOnly  *bool                    `json:"applicable_cves_only,omitempty"`
	MaliciousPackage    *bool                    `json:"malicious_package,omitempty"`
	VulnerabilityIds    []string                 `json:"vulnerability_ids,omitempty"`
	Exposures           *PolicyExposuresAPIModel `json:"exposures,omitempty"`
	PackageName         string                   `json:"package_name,omitempty"`
	PackageType         string                   `json:"package_type,omitempty"`
	PackageVersions     []string                 `json:"package_versions,omitempty"`

	// License Criteria
	AllowUnknown           *bool    `json:"allow_unknown,omitempty"`            // Omitempty is used because the empty field is conflicting with MultiLicensePermissive
	MultiLicensePermissive *bool    `json:"multi_license_permissive,omitempty"` // Omitempty is used because the empty field is conflicting with AllowUnknown
	BannedLicenses         []string `json:"banned_licenses,omitempty"`
	AllowedLicenses        []string `json:"allowed_licenses,omitempty"`

	// Operational Risk custom criteria
	OperationalRiskCustom  *OperationalRiskCriteriaAPIModel `json:"op_risk_custom,omitempty"`
	OperationalRiskMinRisk string                           `json:"op_risk_min_risk,omitempty"`
}

type ProjectsAPIModel

type ProjectsAPIModel struct {
	Names                  []string `json:"names,omitempty"`
	IncludeKeyPatterns     []string `json:"include_key_patterns,omitempty"`
	NumberOfLatestVersions int64    `json:"number_of_latest_versions,omitempty"`
}

type ReleaseBundlesAPIModel

type ReleaseBundlesAPIModel struct {
	Names                  []string `json:"names,omitempty"`
	IncludePatterns        []string `json:"include_patterns,omitempty"`
	ExcludePatterns        []string `json:"exclude_patterns,omitempty"`
	NumberOfLatestVersions int64    `json:"number_of_latest_versions,omitempty"`
}

type RepoConfigResource

type RepoConfigResource struct {
	ProviderData util.ProviderMetadata
	TypeName     string
}

func (*RepoConfigResource) Configure

func (*RepoConfigResource) Create

func (*RepoConfigResource) Delete

func (*RepoConfigResource) ImportState

ImportState imports the resource into the Terraform state.

func (*RepoConfigResource) Metadata

func (*RepoConfigResource) Read

func (*RepoConfigResource) Schema

func (*RepoConfigResource) Update

func (*RepoConfigResource) UpgradeState

func (r *RepoConfigResource) UpgradeState(ctx context.Context) map[int64]resource.StateUpgrader

func (RepoConfigResource) ValidateConfig

type RepoConfigResourceModel

type RepoConfigResourceModel struct {
	RepoName    types.String `tfsdk:"repo_name"`
	JASEnabled  types.Bool   `tfsdk:"jas_enabled"`
	Config      types.Set    `tfsdk:"config"`
	PathsConfig types.Set    `tfsdk:"paths_config"`
}

type RepoConfigurationAPIModel

type RepoConfigurationAPIModel struct {
	// Omitempty is used because 'vuln_contextual_analysis' is not supported by self-hosted Xray installation.
	VulnContextualAnalysis *bool              `json:"vuln_contextual_analysis,omitempty"`
	RetentionInDays        *int64             `json:"retention_in_days,omitempty"`
	Exposures              *ExposuresAPIModel `json:"exposures,omitempty"`
}

type ReportAPIModel

type ReportAPIModel struct {
	ReportId   int64              `json:"report_id,omitempty"`
	Name       string             `json:"name"`
	ProjectKey string             `json:"-"`
	Resources  *ResourcesAPIModel `json:"resources,omitempty"`
	Filters    *FiltersAPIModel   `json:"filters"`
}

type ReportResource

type ReportResource struct {
	ProviderData util.ProviderMetadata
	TypeName     string
}

func (*ReportResource) Create

func (*ReportResource) Delete

func (*ReportResource) Read

func (*ReportResource) Update

type ReportResourceModel

type ReportResourceModel struct {
	ID         types.String `tfsdk:"id"`
	ReportID   types.Int64  `tfsdk:"report_id"`
	Name       types.String `tfsdk:"name"`
	ProjectKey types.String `tfsdk:"project_key"`
	Resources  types.Set    `tfsdk:"resources"`
	Filters    types.Set    `tfsdk:"filters"`
}

type RepositoryAPIModel

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

type RepositoryConfigurationAPIModel

type RepositoryConfigurationAPIModel struct {
	RepoName string `json:"repo_name"`
	// Pointer is used to be able to verify if the RepoConfig or PathsConfiguration struct is nil
	RepoConfig      *RepoConfigurationAPIModel  `json:"repo_config,omitempty"`
	RepoPathsConfig *PathsConfigurationAPIModel `json:"repo_paths_config,omitempty"`
}

type ResourcesAPIModel

type ResourcesAPIModel struct {
	Repositories   *[]RepositoryAPIModel   `json:"repositories,omitempty"`
	Builds         *BuildsAPIModel         `json:"builds,omitempty"`
	ReleaseBundles *ReleaseBundlesAPIModel `json:"release_bundles,omitempty"`
	Projects       *ProjectsAPIModel       `json:"projects,omitempty"`
}

type SecurityFilterAPIModel

type SecurityFilterAPIModel struct {
	Cve             string                   `json:"cve,omitempty"`
	IssueId         string                   `json:"issue_id,omitempty"`
	CVSSScore       *CVSSScoreAPIModel       `json:"cvss_score,omitempty"`
	SummaryContains string                   `json:"summary_contains"`
	HasRemediation  bool                     `json:"has_remediation,omitempty"`
	Published       *StartAndEndDateAPIModel `json:"published,omitempty"`
}

type SecurityPolicyResource

type SecurityPolicyResource struct {
	PolicyResource
}

func (*SecurityPolicyResource) Configure

func (*SecurityPolicyResource) Create

func (*SecurityPolicyResource) Delete

func (*SecurityPolicyResource) ImportState

ImportState imports the resource into the Terraform state.

func (*SecurityPolicyResource) Metadata

func (*SecurityPolicyResource) Read

func (*SecurityPolicyResource) Schema

func (*SecurityPolicyResource) Update

func (SecurityPolicyResource) ValidateConfig

type SettingsResource

type SettingsResource struct {
	ProviderData util.ProviderMetadata
	TypeName     string
}

func (*SettingsResource) Configure

func (*SettingsResource) Create

func (*SettingsResource) Delete

Delete No delete functionality provided by API for the settings or DB sync call. This function will remove the object from the Terraform state

func (*SettingsResource) ImportState

ImportState imports the resource into the Terraform state.

func (*SettingsResource) Metadata

func (*SettingsResource) Read

func (*SettingsResource) Schema

func (*SettingsResource) Update

type SettingsResourceModel

type SettingsResourceModel struct {
	ID                          types.String `tfsdk:"id"`
	DBSyncUpdateTime            types.String `tfsdk:"db_sync_updates_time"`
	Enabled                     types.Bool   `tfsdk:"enabled"`
	AllowBlocked                types.Bool   `tfsdk:"allow_blocked"`
	AllowWhenUnavailable        types.Bool   `tfsdk:"allow_when_unavailable"`
	BlockUnscannedTimeout       types.Int64  `tfsdk:"block_unscanned_timeout"`
	BlockUnfinishedScansTimeout types.Int64  `tfsdk:"block_unfinished_scans_timeout"`
}

type SourceAPIModel

type SourceAPIModel struct {
	ID   string `json:"source_id"`
	Name string `json:"name,omitempty"`
	URL  string `json:"url,omitempty"`
}

type StartAndEndDateAPIModel

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

type ViolationsReportResource

type ViolationsReportResource struct {
	ReportResource
}

func (*ViolationsReportResource) Configure

func (*ViolationsReportResource) Create

func (*ViolationsReportResource) Delete

func (*ViolationsReportResource) Metadata

func (*ViolationsReportResource) Read

func (*ViolationsReportResource) Schema

func (*ViolationsReportResource) Update

type VulnerabilitiesReportResource

type VulnerabilitiesReportResource struct {
	ReportResource
}

func (*VulnerabilitiesReportResource) Configure

func (*VulnerabilitiesReportResource) Create

func (*VulnerabilitiesReportResource) Delete

func (*VulnerabilitiesReportResource) Metadata

func (*VulnerabilitiesReportResource) Read

func (*VulnerabilitiesReportResource) Schema

func (*VulnerabilitiesReportResource) Update

type VulnerableRangeAPIModel

type VulnerableRangeAPIModel struct {
	VulnerableVersions []string `json:"vulnerable_versions"`
	FixedVersions      []string `json:"fixed_versions"`
}

type WatchAPIModel

type WatchAPIModel struct {
	GeneralData      WatchGeneralDataAPIModel      `json:"general_data"`
	ProjectResources WatchProjectResourcesAPIModel `json:"project_resources"`
	AssignedPolicies []WatchAssignedPolicyAPIModel `json:"assigned_policies"`
	WatchRecipients  []string                      `json:"watch_recipients"`
}

type WatchAssignedPolicyAPIModel

type WatchAssignedPolicyAPIModel struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

type WatchFilterAPIModel

type WatchFilterAPIModel struct {
	Type  string          `json:"type"`
	Value json.RawMessage `json:"value"`
}

type WatchFilterAntValueAPIModel

type WatchFilterAntValueAPIModel struct {
	ExcludePatterns []string `json:"ExcludePatterns,omitempty"`
	IncludePatterns []string `json:"IncludePatterns,omitempty"`
}

type WatchFilterKvValueAPIModel

type WatchFilterKvValueAPIModel struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type WatchGeneralDataAPIModel

type WatchGeneralDataAPIModel struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Active      bool   `json:"active"`
}

type WatchProjectResourceAPIModel

type WatchProjectResourceAPIModel struct {
	Type            string                `json:"type"`
	BinaryManagerId string                `json:"bin_mgr_id"`
	Filters         []WatchFilterAPIModel `json:"filters,omitempty"`
	Name            string                `json:"name,omitempty"`
	BuildRepo       string                `json:"build_repo,omitempty"`
	RepoType        string                `json:"repo_type,omitempty"`
}

type WatchProjectResourcesAPIModel

type WatchProjectResourcesAPIModel struct {
	Resources []WatchProjectResourceAPIModel `json:"resources"`
}

type WatchResource

type WatchResource struct {
	ProviderData util.ProviderMetadata
	TypeName     string
}

func (*WatchResource) Configure

func (*WatchResource) Create

func (*WatchResource) Delete

func (*WatchResource) ImportState

ImportState imports the resource into the Terraform state.

func (*WatchResource) Metadata

func (*WatchResource) Read

func (*WatchResource) Schema

func (*WatchResource) Update

func (WatchResource) ValidateConfig

type WatchResourceModel

type WatchResourceModel struct {
	Name             types.String `tfsdk:"name"`
	ProjectKey       types.String `tfsdk:"project_key"`
	Description      types.String `tfsdk:"description"`
	Active           types.Bool   `tfsdk:"active"`
	WatchResource    types.Set    `tfsdk:"watch_resource"`
	AssignedPolicies types.Set    `tfsdk:"assigned_policy"`
	WatchRecipients  types.Set    `tfsdk:"watch_recipients"`
}

type WebhookAPIModel

type WebhookAPIModel struct {
	Name        string            `json:"name"`
	URL         string            `json:"url"`
	Description string            `json:"description"`
	UseProxy    bool              `json:"use_proxy"`
	UserName    string            `json:"user_name"`
	Password    string            `json:"password"`
	Headers     map[string]string `json:"headers"`
}

type WebhookResource

type WebhookResource struct {
	ProviderData util.ProviderMetadata
	TypeName     string
}

func (*WebhookResource) Configure

func (*WebhookResource) Create

func (*WebhookResource) Delete

func (*WebhookResource) ImportState

ImportState imports the resource into the Terraform state.

func (*WebhookResource) Metadata

func (*WebhookResource) Read

func (*WebhookResource) Schema

func (*WebhookResource) Update

type WebhookResourceModel

type WebhookResourceModel struct {
	Name        types.String `tfsdk:"name"`
	URL         types.String `tfsdk:"url"`
	Description types.String `tfsdk:"description"`
	UseProxy    types.Bool   `tfsdk:"use_proxy"`
	UserName    types.String `tfsdk:"user_name"`
	Password    types.String `tfsdk:"password"`
	Headers     types.Map    `tfsdk:"headers"`
}

type WorkersCountAPIModel

type WorkersCountAPIModel struct {
	Index              WorkersCountNewExistingContentAPIModel `json:"index"`
	Persist            WorkersCountNewExistingContentAPIModel `json:"persist"`
	Analysis           WorkersCountNewExistingContentAPIModel `json:"analysis"`
	PolicyEnforcer     WorkersCountNewExistingContentAPIModel `json:"policy_enforcer"`
	SBOM               WorkersCountNewExistingContentAPIModel `json:"sbom"`
	UserCatalog        WorkersCountNewExistingContentAPIModel `json:"usercatalog"`
	SBOMImpactAnalysis WorkersCountNewExistingContentAPIModel `json:"sbomimpactanalysis"`
	MigrationSBOM      WorkersCountNewExistingContentAPIModel `json:"migrationsbom"`
	ImpactAnalysis     WorkersCountNewContentAPIModel         `json:"impact_analysis"`
	Notification       WorkersCountNewContentAPIModel         `json:"notification"`
	Panoramic          WorkersCountNewContentAPIModel         `json:"panoramic"`
}

WorkersCount uses Xray API which returns the follow JSON structure:

{
  "index": {
    "new_content": 8,
    "existing_content": 4
  },
  "persist": {
    "new_content": 8,
    "existing_content": 4
  },
  "analysis": {
    "new_content": 8,
    "existing_content": 4
  },
  "policy_enforcer": {
    "new_content": 8,
    "existing_content": 8
  },
  "sbom": {
    "new_content": 0,
    "existing_content": 0
  },
  "usercatalog": {
    "new_content": 0,
    "existing_content": 0
  },
  "sbomimpactanalysis": {
    "new_content": 0,
    "existing_content": 0
  },
  "migrationsbom": {
    "new_content": 0,
    "existing_content": 0
  },
  "impact_analysis": {
    "new_content": 8
  },
  "notification": {
    "new_content": 8
  },
  "panoramic": {
    "new_content": 0
  }
}

type WorkersCountNewContentAPIModel

type WorkersCountNewContentAPIModel struct {
	New int64 `json:"new_content"`
}

type WorkersCountNewExistingContentAPIModel

type WorkersCountNewExistingContentAPIModel struct {
	WorkersCountNewContentAPIModel
	Existing int64 `json:"existing_content"`
}

type WorkersCountResource

type WorkersCountResource struct {
	ProviderData util.ProviderMetadata
	TypeName     string
}

func (*WorkersCountResource) Configure

func (*WorkersCountResource) Create

func (*WorkersCountResource) Delete

Delete No delete functionality provided by API for the settings or DB sync call. This function will remove the object from the Terraform state

func (*WorkersCountResource) ImportState

ImportState imports the resource into the Terraform state.

func (*WorkersCountResource) Metadata

func (*WorkersCountResource) Read

func (*WorkersCountResource) Schema

func (*WorkersCountResource) Update

func (*WorkersCountResource) UpgradeState

type WorkersCountResourceModelV0

type WorkersCountResourceModelV0 struct {
	ID             types.String `tfsdk:"id"`
	Index          types.Set    `tfsdk:"index"`
	Persist        types.Set    `tfsdk:"persist"`
	Alert          types.Set    `tfsdk:"alert"`
	Analysis       types.Set    `tfsdk:"analysis"`
	ImpactAnalysis types.Set    `tfsdk:"impact_analysis"`
	Notification   types.Set    `tfsdk:"notification"`
}

type WorkersCountResourceModelV1

type WorkersCountResourceModelV1 struct {
	ID                 types.String `tfsdk:"id"`
	Index              types.Set    `tfsdk:"index"`
	Persist            types.Set    `tfsdk:"persist"`
	Analysis           types.Set    `tfsdk:"analysis"`
	PolicyEnforcer     types.Set    `tfsdk:"policy_enforcer"`
	SBOM               types.Set    `tfsdk:"sbom"`
	UserCatalog        types.Set    `tfsdk:"user_catalog"`
	SBOMImpactAnalysis types.Set    `tfsdk:"sbom_impact_analysis"`
	MigrationSBOM      types.Set    `tfsdk:"migration_sbom"`
	ImpactAnalysis     types.Set    `tfsdk:"impact_analysis"`
	Notification       types.Set    `tfsdk:"notification"`
	Panoramic          types.Set    `tfsdk:"panoramic"`
}

Jump to

Keyboard shortcuts

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