-
Notifications
You must be signed in to change notification settings - Fork 1
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
jnobrega
committed
May 1, 2024
1 parent
0489455
commit 343cf36
Showing
17 changed files
with
189 additions
and
67 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,3 @@ | ||
resource "akeyless_auth_method_api_key" "flux_key" { | ||
name = "Flux-Key" | ||
} |
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,6 @@ | ||
resource "akeyless_associate_role_auth_method" "flux-ro" { | ||
am_name = akeyless_auth_method_api_key.flux_key.name | ||
role_name = akeyless_role.read_only.name | ||
|
||
depends_on = [akeyless_auth_method_api_key.flux_key, akeyless_role.read_only] | ||
} |
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,21 @@ | ||
terraform { | ||
|
||
required_providers { | ||
akeyless = { | ||
version = ">= 1.0.0" | ||
source = "akeyless-community/akeyless" | ||
} | ||
} | ||
|
||
backend "s3" { | ||
bucket = "akeyless" | ||
key = "cloudflare.tfstate" | ||
region = "weur" | ||
endpoint = "https://015ce648cc705f6d069fe6068434a576.r2.cloudflarestorage.com" | ||
skip_credentials_validation = true | ||
skip_region_validation = true | ||
skip_metadata_api_check = true | ||
} | ||
} | ||
|
||
|
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,9 @@ | ||
output "flux_access_id" { | ||
value = akeyless_auth_method_api_key.flux_key.access_id | ||
sensitive = true | ||
} | ||
|
||
output "flux_access_key" { | ||
value = akeyless_auth_method_api_key.flux_key.access_key | ||
sensitive = true | ||
} |
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,8 @@ | ||
provider "akeyless" { | ||
api_gateway_address = "https://api.akeyless.io" | ||
|
||
api_key_login { | ||
access_id = var.akeyless_access_id | ||
access_key = var.akeyless_api_key | ||
} | ||
} |
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,12 @@ | ||
resource "akeyless_role" "read_only" { | ||
|
||
name = "ReadOnly" | ||
|
||
rules { | ||
capability = ["read", "list"] | ||
path = "/*" | ||
rule_type = "item-rule" | ||
} | ||
|
||
} | ||
|
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,3 @@ | ||
variable "akeyless_api_key" { | ||
type = string | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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,25 @@ | ||
resource "cloudflare_filter" "notportugal" { | ||
zone_id = lookup(data.cloudflare_zones.domain_com.zones[0], "id") | ||
description = "Block Requests that dont come from Portugal" | ||
expression = "(ip.geoip.country ne \"PT\")" | ||
} | ||
|
||
resource "cloudflare_firewall_rule" "notportugal" { | ||
zone_id = lookup(data.cloudflare_zones.domain_com.zones[0], "id") | ||
description = "Block Requests that don't come from Portugal" | ||
filter_id = cloudflare_filter.notportugal.id | ||
action = "block" | ||
} | ||
|
||
resource "cloudflare_filter" "blockbots" { | ||
zone_id = lookup(data.cloudflare_zones.domain_com.zones[0], "id") | ||
description = "Block Known Bots" | ||
expression = "(cf.client.bot)" | ||
} | ||
|
||
resource "cloudflare_firewall_rule" "blockbots" { | ||
zone_id = lookup(data.cloudflare_zones.domain_com.zones[0], "id") | ||
description = "Block Known Bots" | ||
filter_id = cloudflare_filter.blockbots.id | ||
action = "block" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
resource "cloudflare_zone_settings_override" "cloudflare_settings_com" { | ||
zone_id = lookup(data.cloudflare_zones.domain_com.zones[0], "id") | ||
settings { | ||
# /ssl-tls | ||
ssl = "strict" | ||
# /ssl-tls/edge-certificates | ||
always_use_https = "on" | ||
min_tls_version = "1.2" | ||
opportunistic_encryption = "on" | ||
tls_1_3 = "zrt" | ||
automatic_https_rewrites = "on" | ||
universal_ssl = "on" | ||
# /firewall/settings | ||
browser_check = "on" | ||
challenge_ttl = 1800 | ||
privacy_pass = "on" | ||
security_level = "medium" | ||
# /speed/optimization | ||
brotli = "on" | ||
minify { | ||
css = "on" | ||
js = "on" | ||
html = "on" | ||
} | ||
rocket_loader = "off" | ||
# /caching/configuration | ||
always_online = "off" | ||
development_mode = "off" | ||
# /network | ||
http3 = "on" | ||
zero_rtt = "on" | ||
ipv6 = "on" | ||
websockets = "on" | ||
opportunistic_onion = "on" | ||
pseudo_ipv4 = "off" | ||
ip_geolocation = "on" | ||
# /content-protection | ||
email_obfuscation = "on" | ||
server_side_exclude = "on" | ||
hotlink_protection = "off" | ||
# /workers | ||
security_header { | ||
enabled = false | ||
} | ||
|
||
} | ||
} |