Enforce DENY non-HTTPS requests to s3 buckets (#250)
- Enforces access over HTTPS to all Fleet-terraform created buckets. - Fixes vpc-flow-logs log retention; now allows configuring the retention in days.
This commit is contained in:
1 parent
a276eb6a98
commit
7b381e0bbb
25 files changed
+503
-175
No files matched your search
@@ -14,14 +14,18 @@ The second link includes a script that can be used to test and see if signed URL
|
||||
This addon is intentionally out of scope for AWS GovCloud compatibility. CloudFront is not available inside the AWS GovCloud (US) partition, so using it with GovCloud-hosted resources is a cross-partition architecture that should be designed and reviewed separately.
|
||||
|
||||
|
||||
## S3 Bucket Policy
|
||||
|
||||
This addon no longer manages an S3 bucket policy on the software installers bucket. The bucket policy is now managed by the core module (`byo-ecs`), which automatically denies non-HTTPS requests and includes the CloudFront allow statement when `cloudfront_distribution_arn` is set.
|
||||
|
||||
## Other module requirements
|
||||
|
||||
These are the minimum versions of modules required if used:
|
||||
|
||||
- tf-mod-root-v1.13.0
|
||||
- tf-mod-byo-vpc-v1.14.0
|
||||
- tf-mod-byo-db-v1.10.0
|
||||
- tf-mod-byo-ecs-v1.9.0
|
||||
- tf-mod-root-v1.30.0
|
||||
- tf-mod-byo-vpc-v1.31.0
|
||||
- tf-mod-byo-db-v1.21.0
|
||||
- tf-mod-byo-ecs-v1.21.0
|
||||
- tf-mod-addon-logging-alb-v1.3.0
|
||||
|
||||
Previous versions do not allow for proper interaction with both the software installers and logging s3 buckets.
|
||||
@@ -121,7 +125,7 @@ Now with those encrypted we could setup the module with something like the follo
|
||||
|
||||
```
|
||||
module "cloudfront-software-installers" {
|
||||
source = "github.com/fleetdm/fleet-terraform/addons/cloudfront-software-installers?ref=tf-mod-addon-cloudfront-software-installers-v1.2.0"
|
||||
source = "github.com/fleetdm/fleet-terraform/addons/cloudfront-software-installers?ref=tf-mod-addon-cloudfront-software-installers-v3.0.0"
|
||||
customer = "fleet"
|
||||
s3_bucket = module.main.byo-vpc.byo-db.byo-ecs.fleet_s3_software_installers_config.bucket_name
|
||||
# OPTIONAL
|
||||
|
||||
@@ -13,14 +13,18 @@ The second link includes a script that can be used to test and see if signed URL
|
||||
|
||||
This addon is intentionally out of scope for AWS GovCloud compatibility. CloudFront is not available inside the AWS GovCloud (US) partition, so using it with GovCloud-hosted resources is a cross-partition architecture that should be designed and reviewed separately.
|
||||
|
||||
## S3 Bucket Policy
|
||||
|
||||
This addon no longer manages an S3 bucket policy on the software installers bucket. The bucket policy is now managed by the core module (`byo-ecs`), which automatically denies non-HTTPS requests and includes the CloudFront allow statement when `cloudfront_distribution_arn` is set.
|
||||
|
||||
## Other module requirements
|
||||
|
||||
These are the minimum versions of modules required if used:
|
||||
|
||||
- tf-mod-root-v1.13.0
|
||||
- tf-mod-byo-vpc-v1.14.0
|
||||
- tf-mod-byo-db-v1.10.0
|
||||
- tf-mod-byo-ecs-v1.9.0
|
||||
- tf-mod-root-v1.30.0
|
||||
- tf-mod-byo-vpc-v1.31.0
|
||||
- tf-mod-byo-db-v1.21.0
|
||||
- tf-mod-byo-ecs-v1.21.0
|
||||
- tf-mod-addon-logging-alb-v1.3.0
|
||||
|
||||
Previous versions do not allow for proper interaction with both the software installers and logging s3 buckets.
|
||||
@@ -120,7 +124,7 @@ Now with those encrypted we could setup the module with something like the follo
|
||||
|
||||
```
|
||||
module "cloudfront-software-installers" {
|
||||
source = "github.com/fleetdm/fleet-terraform/addons/cloudfront-software-installers?ref=tf-mod-addon-cloudfront-software-installers-v1.2.0"
|
||||
source = "github.com/fleetdm/fleet-terraform/addons/cloudfront-software-installers?ref=tf-mod-addon-cloudfront-software-installers-v3.0.0"
|
||||
customer = "fleet"
|
||||
s3_bucket = module.main.byo-vpc.byo-db.byo-ecs.fleet_s3_software_installers_config.bucket_name
|
||||
# OPTIONAL
|
||||
@@ -177,7 +181,7 @@ No requirements.
|
||||
|
||||
| Name | Version |
|
||||
|------|---------|
|
||||
| <a name="provider_aws"></a> [aws](#provider\_aws) | 6.36.0 |
|
||||
| <a name="provider_aws"></a> [aws](#provider\_aws) | 6.49.0 |
|
||||
|
||||
## Modules
|
||||
|
||||
@@ -192,10 +196,8 @@ No requirements.
|
||||
| [aws_cloudfront_key_group.software_installers](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudfront_key_group) | resource |
|
||||
| [aws_cloudfront_public_key.software_installers](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudfront_public_key) | resource |
|
||||
| [aws_iam_policy.software_installers_secret](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
|
||||
| [aws_s3_bucket_policy.software_installers](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_policy) | resource |
|
||||
| [aws_secretsmanager_secret.software_installers](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/secretsmanager_secret) | resource |
|
||||
| [aws_secretsmanager_secret_version.software_installers](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/secretsmanager_secret_version) | resource |
|
||||
| [aws_iam_policy_document.software_installers_bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
|
||||
| [aws_iam_policy_document.software_installers_secret](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
|
||||
| [aws_s3_bucket.logging](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/s3_bucket) | data source |
|
||||
| [aws_s3_bucket.software_installers](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/s3_bucket) | data source |
|
||||
|
||||
@@ -1,29 +1,7 @@
|
||||
data "aws_iam_policy_document" "software_installers_bucket" {
|
||||
statement {
|
||||
actions = ["s3:GetObject"]
|
||||
resources = ["${data.aws_s3_bucket.software_installers.arn}/*"]
|
||||
effect = "Allow"
|
||||
principals {
|
||||
type = "Service"
|
||||
identifiers = ["cloudfront.amazonaws.com"]
|
||||
}
|
||||
condition {
|
||||
test = "StringEquals"
|
||||
variable = "AWS:SourceArn"
|
||||
values = [module.cloudfront_software_installers.cloudfront_distribution_arn]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
data "aws_s3_bucket" "software_installers" {
|
||||
bucket = var.s3_bucket
|
||||
}
|
||||
|
||||
resource "aws_s3_bucket_policy" "software_installers" {
|
||||
bucket = data.aws_s3_bucket.software_installers.bucket
|
||||
policy = data.aws_iam_policy_document.software_installers_bucket.json
|
||||
}
|
||||
|
||||
data "aws_iam_policy_document" "software_installers_secret" {
|
||||
statement {
|
||||
effect = "Allow"
|
||||
|
||||
Reference in new issue
Block a user