-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add variables and infra for least privilege analytics * update bucket config * update env vars * fix acl * fix outputs * fix bool interpretation * fix bool env var * update env var * add required AWS IAM IDC read permission * update ALB path rule * add assume role external ID * widen assume role scope * remove duplicate variable * fix provisioner iam policy * fix duplicate resource names * fix iam policies and count conditions * changeset * Update .changeset/polite-falcons-sleep.md --------- Co-authored-by: chrnorm <[email protected]>
- Loading branch information
1 parent
714a2c3
commit 47d06e6
Showing
19 changed files
with
539 additions
and
63 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,5 @@ | ||
--- | ||
"@common-fate/terraform-aws-common-fate-deployment": minor | ||
--- | ||
|
||
Adds modules required for Least Privilege Analysis. |
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
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,34 @@ | ||
data "aws_iam_policy_document" "main" { | ||
source_policy_documents = var.policy_documents | ||
|
||
statement { | ||
sid = "DontAllowNonSecureConnection" | ||
effect = "Deny" | ||
|
||
actions = [ | ||
"s3:*", | ||
] | ||
|
||
resources = [ | ||
aws_s3_bucket.main.arn, | ||
"${aws_s3_bucket.main.arn}/*", | ||
] | ||
|
||
principals { | ||
type = "AWS" | ||
|
||
identifiers = [ | ||
"*", | ||
] | ||
} | ||
|
||
condition { | ||
test = "Bool" | ||
variable = "aws:SecureTransport" | ||
|
||
values = [ | ||
"false", | ||
] | ||
} | ||
} | ||
} |
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,37 @@ | ||
locals { | ||
# Compound Scope Identifier | ||
csi = replace( | ||
format( | ||
"%s-%s-%s-%s", | ||
var.namespace, | ||
var.stage, | ||
var.component, | ||
var.bucket_prefix, | ||
), | ||
"_", | ||
"", | ||
) | ||
|
||
# CSI for use in resources with a global namespace, i.e. S3 Buckets | ||
csi_global = replace( | ||
format( | ||
"%s-%s-%s-%s-%s-%s", | ||
var.namespace, | ||
var.aws_account_id, | ||
var.region, | ||
var.stage, | ||
var.component, | ||
var.bucket_prefix, | ||
), | ||
"_", | ||
"", | ||
) | ||
|
||
default_tags = merge( | ||
var.default_tags, | ||
{ | ||
Module = var.module | ||
Name = var.bucket_prefix | ||
}, | ||
) | ||
} |
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,31 @@ | ||
output "arn" { | ||
value = aws_s3_bucket.main.arn | ||
} | ||
|
||
output "bucket" { | ||
value = aws_s3_bucket.main.bucket | ||
} | ||
|
||
output "bucket_domain_name" { | ||
value = aws_s3_bucket.main.bucket_domain_name | ||
} | ||
|
||
output "bucket_regional_domain_name" { | ||
value = aws_s3_bucket.main.bucket_regional_domain_name | ||
} | ||
|
||
output "hosted_zone_id" { | ||
value = aws_s3_bucket.main.hosted_zone_id | ||
} | ||
|
||
output "id" { | ||
value = aws_s3_bucket.main.id | ||
} | ||
|
||
output "policy" { | ||
value = aws_s3_bucket_policy.main.policy | ||
} | ||
|
||
output "region" { | ||
value = aws_s3_bucket.main.region | ||
} |
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 "aws_s3_bucket" "main" { | ||
bucket_prefix = var.bucket_prefix | ||
force_destroy = var.force_destroy | ||
|
||
tags = local.default_tags | ||
} |
Oops, something went wrong.