Skip to content

Commit

Permalink
Merge pull request #76 from jfrog/GH-67-add-ignore-rules
Browse files Browse the repository at this point in the history
GH-67 add ignore rules
  • Loading branch information
alexhung authored Sep 1, 2022
2 parents 422adba + 2359024 commit bc0621c
Show file tree
Hide file tree
Showing 16 changed files with 1,356 additions and 207 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 1.6.0 (August 31, 2022). Tested on Artifactory 7.41.7 and Xray 3.55.2

NEW FEATURE:

* **New Resource:** `xray_ignore_rule` Issue: [#67](https://github.com/jfrog/terraform-provider-xray/issues/67) PR: [#76](https://github.com/jfrog/terraform-provider-xray/pull/76).

## 1.5.1 (August 9, 2022). Tested on Artifactory 7.41.7 and Xray 3.54.5

BUG FIXES:
Expand Down
1 change: 0 additions & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ fmt:
@go fmt ./...

doc:
go get github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
go generate

.PHONY: build fmt
93 changes: 93 additions & 0 deletions docs/resources/ignore_rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "xray_ignore_rule Resource - terraform-provider-xray"
subcategory: ""
description: |-
Provides an Xray ignore rule resource. See Xray Ignore Rules https://www.jfrog.com/confluence/display/JFROG/Ignore+Rules and REST API https://www.jfrog.com/confluence/display/JFROG/Xray+REST+API#XrayRESTAPI-IGNORERULES for more details. Notice: at least one of the 'vulnerabilities/cves/liceneses', 'component', and 'dockerlayers/artifact/build/releasebundle' should not be empty. When selecting the ignore criteria, take note of the combinations you choose. Some combinations such as omitting everything is not allowed as it will ignore all future violations (in the watch or in the system).
---

# xray_ignore_rule (Resource)

Provides an Xray ignore rule resource. See [Xray Ignore Rules](https://www.jfrog.com/confluence/display/JFROG/Ignore+Rules) and [REST API](https://www.jfrog.com/confluence/display/JFROG/Xray+REST+API#XrayRESTAPI-IGNORERULES) for more details. Notice: at least one of the 'vulnerabilities/cves/liceneses', 'component', and 'docker_layers/artifact/build/release_bundle' should not be empty. When selecting the ignore criteria, take note of the combinations you choose. Some combinations such as omitting everything is not allowed as it will ignore all future violations (in the watch or in the system).



<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `notes` (String) Notes of the ignore rule

### Optional

- `artifact` (Block Set) List of specific artifacts to ignore. Omit to apply to all. (see [below for nested schema](#nestedblock--artifact))
- `build` (Block Set) List of specific builds to ignore. Omit to apply to all. (see [below for nested schema](#nestedblock--build))
- `component` (Block Set) List of specific components to ignore. Omit to apply to all. (see [below for nested schema](#nestedblock--component))
- `cves` (Set of String) List of specific CVEs to ignore. Omit to apply to all.
- `docker_layers` (Set of String) List of Docker layer SHA256 hashes to ignore. Omit to apply to all.
- `expiration_date` (String) The Ignore Rule will be active until the expiration date. At that date it will automatically get deleted.
- `licenses` (Set of String) List of specific licenses to ignore. Omit to apply to all.
- `operational_risk` (List of String) Operational risk to ignore. Only accept 'any'
- `policies` (Set of String) List of specific policies to ignore. Omit to apply to all.
- `project_key` (String) Project key for assigning this resource to. Must be 3 - 10 lowercase alphanumeric and hyphen characters.
- `release_bundle` (Block Set) List of specific release bundles to ignore. Omit to apply to all. (see [below for nested schema](#nestedblock--release_bundle))
- `vulnerabilities` (Set of String) List of specific vulnerabilities to ignore. Omit to apply to all.
- `watches` (Set of String) List of specific watches to ignore. Omit to apply to all.

### Read-Only

- `author` (String)
- `created` (String)
- `id` (String) ID of the ignore rule
- `is_expired` (Boolean)

<a id="nestedblock--artifact"></a>
### Nested Schema for `artifact`

Required:

- `name` (String) Name of the artifact. Wildcards are not supported.

Optional:

- `path` (String) Path of the artifact. Must end with a '/'
- `version` (String) Version of the artifact


<a id="nestedblock--build"></a>
### Nested Schema for `build`

Required:

- `name` (String) Name of the build

Optional:

- `version` (String) Version of the build


<a id="nestedblock--component"></a>
### Nested Schema for `component`

Required:

- `name` (String) Name of the component

Optional:

- `version` (String) Version of the component


<a id="nestedblock--release_bundle"></a>
### Nested Schema for `release_bundle`

Required:

- `name` (String) Name of the release bundle

Optional:

- `version` (String) Version of the release bundle


2 changes: 1 addition & 1 deletion docs/resources/license_policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ resource "xray_license_policy" "banned_licenses" {
### Optional

- `description` (String) More verbose description of the policy
- `project_key` (String) Project key for assigning this policy to. Must be 3 - 10 lowercase alphanumeric characters.
- `project_key` (String) Project key for assigning this resource to. Must be 3 - 10 lowercase alphanumeric and hyphen characters.

### Read-Only

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/operational_risk_policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ resource "xray_operational_risk_policy" "custom_criteria" {
### Optional

- `description` (String) More verbose description of the policy
- `project_key` (String) Project key for assigning this policy to. Must be 3 - 10 lowercase alphanumeric characters.
- `project_key` (String) Project key for assigning this resource to. Must be 3 - 10 lowercase alphanumeric and hyphen characters.

### Read-Only

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/security_policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ resource "xray_security_policy" "cvss_score" {
### Optional

- `description` (String) More verbose description of the policy
- `project_key` (String) Project key for assigning this policy to. Must be 3 - 10 lowercase alphanumeric characters.
- `project_key` (String) Project key for assigning this resource to. Must be 3 - 10 lowercase alphanumeric and hyphen characters.

### Read-Only

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/watch.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ resource "xray_watch" "project" {

- `active` (Boolean) Whether or not the watch is active
- `description` (String) Description of the watch
- `project_key` (String) Project key for assigning this watch to. Must be 3 - 10 lowercase alphanumeric characters. Support repository and build watch resource types. When specifying individual repository or build they must be already assigned to the project. Build must be added as indexed resources.
- `project_key` (String) Project key for assigning this resource to. Must be 3 - 10 lowercase alphanumeric and hyphen characters. Support repository and build watch resource types. When specifying individual repository or build they must be already assigned to the project. Build must be added as indexed resources.
- `watch_recipients` (Set of String) A list of email addressed that will get emailed when a violation is triggered.

### Read-Only
Expand Down
15 changes: 13 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,26 @@ module github.com/jfrog/terraform-provider-xray

require (
github.com/go-resty/resty/v2 v2.7.0
github.com/hashicorp/terraform-plugin-docs v0.13.0
github.com/hashicorp/terraform-plugin-log v0.4.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.14.0
github.com/jfrog/terraform-provider-shared v1.7.0
golang.org/x/exp v0.0.0-20220613132600-b0d781184e0d
)

require (
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.1.1 // indirect
github.com/Masterminds/sprig/v3 v3.2.2 // indirect
github.com/agext/levenshtein v1.2.2 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-checkpoint v0.5.0 // indirect
Expand All @@ -37,16 +44,21 @@ require (
github.com/hashicorp/terraform-registry-address v0.0.0-20210412075316-9b2996cce896 // indirect
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/kr/pretty v0.3.0 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mitchellh/cli v1.1.4 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/go-wordwrap v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/oklog/run v1.0.0 // indirect
github.com/posener/complete v1.2.3 // indirect
github.com/russross/blackfriday v1.6.0 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect
github.com/vmihailenco/tagparser v0.1.1 // indirect
Expand All @@ -61,7 +73,6 @@ require (
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect
gopkg.in/ldap.v2 v2.5.1 // indirect
gopkg.in/yaml.v3 v3.0.0 // indirect
)

go 1.18
Loading

0 comments on commit bc0621c

Please sign in to comment.