-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2671c9f
commit 0967738
Showing
70 changed files
with
197 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
layout: "fastly" | ||
page_title: "Fastly: fastly_ip_ranges" | ||
sidebar_current: "docs-fastly-datasource-ip_ranges" | ||
description: |- | ||
Get information on Fastly IP ranges. | ||
--- | ||
|
||
# fastly_ip_ranges | ||
|
||
Use this data source to get the [IP ranges][1] of Fastly edge nodes. | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
data "fastly_ip_ranges" "fastly" {} | ||
resource "aws_security_group" "from_fastly" { | ||
name = "from_fastly" | ||
ingress { | ||
from_port = "443" | ||
to_port = "443" | ||
protocol = "tcp" | ||
cidr_blocks = ["${data.fastly_ip_ranges.fastly.cidr_blocks}"] | ||
ipv6_cidr_blocks = ["${data.fastly_ip_ranges.fastly.ipv6_cidr_blocks}"] | ||
} | ||
} | ||
``` | ||
|
||
## Attributes Reference | ||
|
||
* `cidr_blocks` - The lexically ordered list of ipv4 CIDR blocks. | ||
* `ipv6_cidr_blocks` - The lexically ordered list of ipv6 CIDR blocks. | ||
|
||
[1]: https://docs.fastly.com/guides/securing-communications/accessing-fastlys-ip-ranges |
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,148 @@ | ||
--- | ||
layout: "fastly" | ||
page_title: "Fastly: fastly_waf_rules" | ||
sidebar_current: "docs-fastly-datasource-waf_rules" | ||
description: |- | ||
Get information on Fastly WAF rules. | ||
--- | ||
|
||
-> **Note:** This data source is only available from 0.20.0 of the Fastly terraform provider. | ||
|
||
# fastly_waf_rules | ||
|
||
Use this data source to get the [WAF rules][1] of Fastly. A set of third-party rules from the OWASP Core Ruleset, commercial sources, and open source, in addition to Fastly-generated rules. | ||
They offer protection from injection attacks and cross site scripting amongst other key application-layer attacks. | ||
|
||
## Example Usage | ||
|
||
Usage with publishers Filter: | ||
|
||
```hcl | ||
data "fastly_waf_rules" "owasp" { | ||
publishers = ["owasp"] | ||
} | ||
``` | ||
|
||
Usage with tags filter: | ||
|
||
```hcl | ||
data "fastly_waf_rules" "tag" { | ||
tags = ["language-html", "language-jsp"] | ||
} | ||
``` | ||
|
||
Usage with exclude filter: | ||
|
||
```hcl | ||
data "fastly_waf_rules" "owasp_with_exclusions" { | ||
publishers = ["owasp"] | ||
exclude_modsec_rule_ids = [1010090] | ||
} | ||
``` | ||
|
||
Usage without filters: | ||
|
||
```hcl | ||
data "fastly_waf_rules" "all" { | ||
# This will retrieve the entire list of rules available from the API at the time. | ||
} | ||
``` | ||
|
||
Usage with WAF configuration resource: | ||
|
||
```hcl | ||
variable "type_status" { | ||
type = map(string) | ||
default = { | ||
score = "score" | ||
threshold = "log" | ||
strict = "log" | ||
} | ||
} | ||
resource "fastly_service_v1" "demo" { | ||
name = "demofastly" | ||
domain { | ||
name = "example.com" | ||
comment = "demo" | ||
} | ||
backend { | ||
address = "127.0.0.1" | ||
name = "origin1" | ||
port = 80 | ||
} | ||
condition { | ||
name = "WAF_Prefetch" | ||
type = "PREFETCH" | ||
statement = "req.backend.is_origin" | ||
} | ||
# This condition will always be false | ||
# adding it to the response object created below | ||
# prevents Fastly from returning a 403 on all of your traffic. | ||
condition { | ||
name = "WAF_always_false" | ||
statement = "false" | ||
type = "REQUEST" | ||
} | ||
response_object { | ||
name = "WAF_Response" | ||
status = "403" | ||
response = "Forbidden" | ||
content_type = "text/html" | ||
content = "<html><body>Forbidden</body></html>" | ||
request_condition = "WAF_always_false" | ||
} | ||
waf { | ||
prefetch_condition = "WAF_Prefetch" | ||
response_object = "WAF_Response" | ||
} | ||
force_destroy = true | ||
} | ||
data "fastly_waf_rules" "owasp" { | ||
publishers = ["owasp"] | ||
} | ||
resource "fastly_service_waf_configuration" "waf" { | ||
waf_id = fastly_service_v1.demo.waf[0].waf_id | ||
http_violation_score_threshold = 100 | ||
dynamic "rule" { | ||
for_each = data.fastly_waf_rules.owasp.rules | ||
content { | ||
modsec_rule_id = rule.value.modsec_rule_id | ||
revision = rule.value.latest_revision_number | ||
status = lookup(var.type_status, rule.value.type, "log") | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
~> **Warning:** The data source's filters are applied using an **AND** boolean operator, so depending on the combination of filters, they may become mutually exclusive. | ||
|
||
* `publishers` - Inclusion filter by WAF rule's publishers. | ||
* `tags` - Inclusion filter by WAF rule's tags. | ||
* `exclude_modsec_rule_ids` - Exclusion filter by WAF rule's ModSecurity ID. | ||
|
||
## Attribute Reference | ||
|
||
* `rules` - The Web Application Firewall's rules result set. | ||
|
||
~> **Warning:** Deprecated rules will not be present on this data source's result set. | ||
|
||
The `rules` block supports: | ||
|
||
* `modsec_rule_id` - The rule's modsecurity ID. | ||
* `latest_revision_number` - The rule's latest revision. | ||
* `type` - The rule's type. | ||
|
||
[1]: https://developer.fastly.com/reference/api/waf/rules/ |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...data-sources/ip_ranges.html.markdown.tmpl → docs_src/data-sources/ip_ranges.md.tmpl
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
2 changes: 1 addition & 1 deletion
2
...data-sources/waf_rules.html.markdown.tmpl → docs_src/data-sources/waf_rules.md.tmpl
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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