-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #423 from cloudflare/support-changes-from-upstream…
…-rulesets generate: support remapping rulesets overrides `enabled` => `status`
- Loading branch information
Showing
11 changed files
with
419 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
testdata/cloudflare/cloudflare_logpush_job_with_filter.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
version: 1 | ||
interactions: | ||
- request: | ||
body: "" | ||
form: {} | ||
headers: | ||
Content-Type: | ||
- application/json | ||
url: https://api.cloudflare.com/client/v4/zones/0da42c8d2132a9ddaf714f9e7c920711/logpush/jobs | ||
method: GET | ||
response: | ||
body: | | ||
{ | ||
"success": true, | ||
"errors": [], | ||
"messages": [], | ||
"result": [ | ||
{ | ||
"id": 1, | ||
"enabled": false, | ||
"name": "example.com", | ||
"dataset": "http_requests", | ||
"filter": "{\"where\":{\"and\":[{\"key\":\"ClientRequestPath\",\"operator\":\"contains\",\"value\":\"/static\"},{\"key\":\"ClientRequestHost\",\"operator\":\"eq\",\"value\":\"example.com\"}]}}", | ||
"logpull_options": "fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339", | ||
"destination_conf": "s3://mybucket/logs?region=us-west-2", | ||
"last_complete": null, | ||
"last_error": null, | ||
"error_message": null | ||
} | ||
] | ||
} | ||
headers: | ||
Content-Type: | ||
- application/json | ||
Vary: | ||
- Accept-Encoding | ||
status: 200 OK | ||
code: 200 | ||
duration: "" |
138 changes: 138 additions & 0 deletions
138
testdata/cloudflare/cloudflare_ruleset_override_remapping_disabled.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
--- | ||
version: 1 | ||
interactions: | ||
- request: | ||
body: "" | ||
form: {} | ||
headers: | ||
Content-Type: | ||
- application/json | ||
url: https://api.cloudflare.com/client/v4/zones/0da42c8d2132a9ddaf714f9e7c920711/rulesets | ||
method: GET | ||
response: | ||
body: | | ||
{ | ||
"result": [ | ||
{ | ||
"id": "a6905ff86d3844cebc1a88dd80c659e7", | ||
"name": "Bot Fight Mode for Likely Bots", | ||
"description": "", | ||
"source": "firewall_managed", | ||
"kind": "managed", | ||
"version": "4", | ||
"last_updated": "2021-07-01T16:59:14.386598Z", | ||
"phase": "http_request_firewall_managed" | ||
}, | ||
{ | ||
"id": "48ba18287c544bd7bdbe842a294f1ae2", | ||
"name": "Bot Fight Mode for Definite Bots", | ||
"description": "", | ||
"source": "firewall_managed", | ||
"kind": "managed", | ||
"version": "4", | ||
"last_updated": "2021-07-01T16:59:17.970712Z", | ||
"phase": "http_request_firewall_managed" | ||
}, | ||
{ | ||
"id": "4c971a697dd249939460f4520dcd7184", | ||
"name": "zone", | ||
"description": "", | ||
"source": "firewall_managed", | ||
"kind": "zone", | ||
"version": "2", | ||
"last_updated": "2021-09-03T06:42:41.341405Z", | ||
"phase": "http_request_firewall_managed" | ||
}, | ||
{ | ||
"id": "c2e184081120413c86c3ab7e14069605", | ||
"name": "Cloudflare Exposed Credentials Check Ruleset", | ||
"description": "Exposed credentials check rules", | ||
"source": "firewall_managed", | ||
"kind": "managed", | ||
"version": "32", | ||
"last_updated": "2021-09-06T16:39:15.601436Z", | ||
"phase": "http_request_firewall_managed" | ||
}, | ||
{ | ||
"id": "efb7b8c949ac4650a09736fc376e9aee", | ||
"name": "Cloudflare Managed Ruleset", | ||
"description": "Created by the Cloudflare security team, this ruleset is designed to provide fast and effective protection for all your applications. It is frequently updated to cover new vulnerabilities and reduce false positives.", | ||
"source": "firewall_managed", | ||
"kind": "managed", | ||
"version": "30", | ||
"last_updated": "2021-09-06T16:39:16.550214Z", | ||
"phase": "http_request_firewall_managed" | ||
}, | ||
{ | ||
"id": "4814384a9e5d4991b9815dcfc25d2f1f", | ||
"name": "Cloudflare OWASP Core Ruleset", | ||
"description": "Cloudflare's implementation of the Open Web Application Security Project (OWASP) ModSecurity Core Rule Set. We routinely monitor for updates from OWASP based on the latest version available from the official code repository", | ||
"source": "firewall_managed", | ||
"kind": "managed", | ||
"version": "29", | ||
"last_updated": "2021-09-06T16:39:18.773224Z", | ||
"phase": "http_request_firewall_managed" | ||
} | ||
], | ||
"success": true, | ||
"errors": [], | ||
"messages": [] | ||
} | ||
headers: | ||
Content-Type: | ||
- application/json | ||
Vary: | ||
- Accept-Encoding | ||
status: 200 OK | ||
code: 200 | ||
duration: "" | ||
- request: | ||
body: "" | ||
form: {} | ||
headers: | ||
Content-Type: | ||
- application/json | ||
url: https://api.cloudflare.com/client/v4/zones/0da42c8d2132a9ddaf714f9e7c920711/rulesets/4c971a697dd249939460f4520dcd7184 | ||
method: GET | ||
response: | ||
body: | | ||
{ | ||
"result": { | ||
"id": "4c971a697dd249939460f4520dcd7184", | ||
"name": "zone", | ||
"description": "", | ||
"source": "firewall_managed", | ||
"kind": "zone", | ||
"version": "2", | ||
"rules": [ | ||
{ | ||
"action": "execute", | ||
"action_parameters": { | ||
"id": "efb7b8c949ac4650a09736fc376e9aee", | ||
"version": "latest", | ||
"overrides": { | ||
"action": "log", | ||
"enabled": false | ||
} | ||
}, | ||
"expression": "(http.cookie eq \"jb_testing=true\")", | ||
"description": "zone", | ||
"last_updated": "2021-09-03T06:42:41.341405Z", | ||
"enabled": false | ||
} | ||
], | ||
"last_updated": "2021-09-03T06:42:41.341405Z", | ||
"phase": "http_request_firewall_managed" | ||
}, | ||
"success": true, | ||
"errors": [], | ||
"messages": [] | ||
} | ||
headers: | ||
Content-Type: | ||
- application/json | ||
Vary: | ||
- Accept-Encoding | ||
status: 200 OK | ||
code: 200 | ||
duration: "" |
138 changes: 138 additions & 0 deletions
138
testdata/cloudflare/cloudflare_ruleset_override_remapping_enabled.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
--- | ||
version: 1 | ||
interactions: | ||
- request: | ||
body: "" | ||
form: {} | ||
headers: | ||
Content-Type: | ||
- application/json | ||
url: https://api.cloudflare.com/client/v4/zones/0da42c8d2132a9ddaf714f9e7c920711/rulesets | ||
method: GET | ||
response: | ||
body: | | ||
{ | ||
"result": [ | ||
{ | ||
"id": "a6905ff86d3844cebc1a88dd80c659e7", | ||
"name": "Bot Fight Mode for Likely Bots", | ||
"description": "", | ||
"source": "firewall_managed", | ||
"kind": "managed", | ||
"version": "4", | ||
"last_updated": "2021-07-01T16:59:14.386598Z", | ||
"phase": "http_request_firewall_managed" | ||
}, | ||
{ | ||
"id": "48ba18287c544bd7bdbe842a294f1ae2", | ||
"name": "Bot Fight Mode for Definite Bots", | ||
"description": "", | ||
"source": "firewall_managed", | ||
"kind": "managed", | ||
"version": "4", | ||
"last_updated": "2021-07-01T16:59:17.970712Z", | ||
"phase": "http_request_firewall_managed" | ||
}, | ||
{ | ||
"id": "4c971a697dd249939460f4520dcd7184", | ||
"name": "zone", | ||
"description": "", | ||
"source": "firewall_managed", | ||
"kind": "zone", | ||
"version": "2", | ||
"last_updated": "2021-09-03T06:42:41.341405Z", | ||
"phase": "http_request_firewall_managed" | ||
}, | ||
{ | ||
"id": "c2e184081120413c86c3ab7e14069605", | ||
"name": "Cloudflare Exposed Credentials Check Ruleset", | ||
"description": "Exposed credentials check rules", | ||
"source": "firewall_managed", | ||
"kind": "managed", | ||
"version": "32", | ||
"last_updated": "2021-09-06T16:39:15.601436Z", | ||
"phase": "http_request_firewall_managed" | ||
}, | ||
{ | ||
"id": "efb7b8c949ac4650a09736fc376e9aee", | ||
"name": "Cloudflare Managed Ruleset", | ||
"description": "Created by the Cloudflare security team, this ruleset is designed to provide fast and effective protection for all your applications. It is frequently updated to cover new vulnerabilities and reduce false positives.", | ||
"source": "firewall_managed", | ||
"kind": "managed", | ||
"version": "30", | ||
"last_updated": "2021-09-06T16:39:16.550214Z", | ||
"phase": "http_request_firewall_managed" | ||
}, | ||
{ | ||
"id": "4814384a9e5d4991b9815dcfc25d2f1f", | ||
"name": "Cloudflare OWASP Core Ruleset", | ||
"description": "Cloudflare's implementation of the Open Web Application Security Project (OWASP) ModSecurity Core Rule Set. We routinely monitor for updates from OWASP based on the latest version available from the official code repository", | ||
"source": "firewall_managed", | ||
"kind": "managed", | ||
"version": "29", | ||
"last_updated": "2021-09-06T16:39:18.773224Z", | ||
"phase": "http_request_firewall_managed" | ||
} | ||
], | ||
"success": true, | ||
"errors": [], | ||
"messages": [] | ||
} | ||
headers: | ||
Content-Type: | ||
- application/json | ||
Vary: | ||
- Accept-Encoding | ||
status: 200 OK | ||
code: 200 | ||
duration: "" | ||
- request: | ||
body: "" | ||
form: {} | ||
headers: | ||
Content-Type: | ||
- application/json | ||
url: https://api.cloudflare.com/client/v4/zones/0da42c8d2132a9ddaf714f9e7c920711/rulesets/4c971a697dd249939460f4520dcd7184 | ||
method: GET | ||
response: | ||
body: | | ||
{ | ||
"result": { | ||
"id": "4c971a697dd249939460f4520dcd7184", | ||
"name": "zone", | ||
"description": "", | ||
"source": "firewall_managed", | ||
"kind": "zone", | ||
"version": "2", | ||
"rules": [ | ||
{ | ||
"action": "execute", | ||
"action_parameters": { | ||
"id": "efb7b8c949ac4650a09736fc376e9aee", | ||
"version": "latest", | ||
"overrides": { | ||
"action": "log", | ||
"enabled": true | ||
} | ||
}, | ||
"expression": "(http.cookie eq \"jb_testing=true\")", | ||
"description": "zone", | ||
"last_updated": "2021-09-03T06:42:41.341405Z", | ||
"enabled": false | ||
} | ||
], | ||
"last_updated": "2021-09-03T06:42:41.341405Z", | ||
"phase": "http_request_firewall_managed" | ||
}, | ||
"success": true, | ||
"errors": [], | ||
"messages": [] | ||
} | ||
headers: | ||
Content-Type: | ||
- application/json | ||
Vary: | ||
- Accept-Encoding | ||
status: 200 OK | ||
code: 200 | ||
duration: "" |
7 changes: 7 additions & 0 deletions
7
testdata/terraform/cloudflare_logpush_job_with_filter/provider.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
terraform { | ||
required_providers { | ||
cloudflare = { | ||
source = "cloudflare/cloudflare" | ||
} | ||
} | ||
} |
Oops, something went wrong.