You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Results #1-19 HIGH IAM policy document uses sensitive action 's3:PutObject' on wildcarded resource '132a874f-7632-45f3-afb8-d52dc9522a1d/' (19 similar results)
────────────────────────────────────────────────────────────────────────────────
modules/landing_zone/landing_zone_user/main.tf:57
via modules/landing_zone/main.tf:352-362 (module.landing_zone_users["0"])
via main.tf:1-25 (module.capita)
────────────────────────────────────────────────────────────────────────────────
46 data "aws_iam_policy_document" "this_transfer_user" {
..
57 [ resources = ["${var.landing_bucket.arn}/"]
..
59 }
────────────────────────────────────────────────────────────────────────────────
Individual Causes
modules/landing_zone/landing_zone_user/main.tf:1-25 (module.capita) 19 instances
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
Results #20-22 HIGH IAM policy document uses sensitive action 's3:GetObject' on wildcarded resource '132a874f-7632-45f3-afb8-d52dc9522a1d/' (3 similar results)
────────────────────────────────────────────────────────────────────────────────
modules/landing_zone/main.tf:294
via main.tf:1-25 (module.capita)
────────────────────────────────────────────────────────────────────────────────
286 data "aws_iam_policy_document" "this_transfer_workflow" {
...
294 [ resources = ["${aws_s3_bucket.landing_bucket.arn}/"]
...
338 }
────────────────────────────────────────────────────────────────────────────────
Individual Causes
modules/landing_zone/main.tf:1-25 (module.capita) 3 instances
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
Results #23-25 HIGH IAM policy document uses sensitive action 's3:PutObject' on wildcarded resource 'db620b2b-4270-43a3-a3cb-e85c39e5c46f/' (3 similar results)
────────────────────────────────────────────────────────────────────────────────
modules/landing_zone/main.tf:303
via main.tf:1-25 (module.capita)
────────────────────────────────────────────────────────────────────────────────
286 data "aws_iam_policy_document" "this_transfer_workflow" {
...
303 [ resources = ["${var.data_store_bucket.arn}/"]
...
338 }
────────────────────────────────────────────────────────────────────────────────
Individual Causes
modules/landing_zone/main.tf:1-25 (module.capita) 3 instances
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
Results #26-31 HIGH IAM policy document uses sensitive action 's3:PutObjectTagging' on wildcarded resource 'db620b2b-4270-43a3-a3cb-e85c39e5c46f/' (6 similar results)
────────────────────────────────────────────────────────────────────────────────
modules/landing_zone/main.tf:323-326
via main.tf:1-25 (module.capita)
────────────────────────────────────────────────────────────────────────────────
286 data "aws_iam_policy_document" "this_transfer_workflow" {
...
323 ┌ resources = [
324 │ "${var.data_store_bucket.arn}/",
325 │ "${aws_s3_bucket.landing_bucket.arn}/*",
326 └ ]
...
338 }
────────────────────────────────────────────────────────────────────────────────
Individual Causes
modules/landing_zone/main.tf:1-25 (module.capita) 6 instances
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
Results #32-34 HIGH IAM policy document uses sensitive action 's3:DeleteObject' on wildcarded resource '132a874f-7632-45f3-afb8-d52dc9522a1d/' (3 similar results)
────────────────────────────────────────────────────────────────────────────────
modules/landing_zone/main.tf:336
via main.tf:1-25 (module.capita)
────────────────────────────────────────────────────────────────────────────────
286 data "aws_iam_policy_document" "this_transfer_workflow" {
...
336 [ resources = ["${aws_s3_bucket.landing_bucket.arn}/"]
...
338 }
────────────────────────────────────────────────────────────────────────────────
Individual Causes
modules/landing_zone/main.tf:1-25 (module.capita) 3 instances
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
modules/landing_zone/main.tf:1-25 (module.capita)
────────────────────────────────────────────────────────────────────────────────
ID aws-s3-encryption-customer-key
Impact Using AWS managed keys does not allow for fine grained control
Resolution Enable encryption using customer managed keys
modules/s3_log_bucket/main.tf:1-25 (module.capita) 3 instances
────────────────────────────────────────────────────────────────────────────────
ID aws-s3-encryption-customer-key
Impact Using AWS managed keys does not allow for fine grained control
Resolution Enable encryption using customer managed keys
Result #42 HIGH Bucket does not encrypt data with a customer managed key.
────────────────────────────────────────────────────────────────────────────────
s3.tf:20-28
────────────────────────────────────────────────────────────────────────────────
20 resource "aws_s3_bucket_server_side_encryption_configuration" "data_store" {
21 bucket = aws_s3_bucket.data_store.id
22
23 rule {
24 apply_server_side_encryption_by_default {
25 sse_algorithm = "AES256"
26 }
27 }
28 }
────────────────────────────────────────────────────────────────────────────────
ID aws-s3-encryption-customer-key
Impact Using AWS managed keys does not allow for fine grained control
Resolution Enable encryption using customer managed keys
Results #43-45 MEDIUM Bucket does not have versioning enabled (3 similar results)
────────────────────────────────────────────────────────────────────────────────
modules/landing_zone/main.tf:84
via main.tf:51-81 (module.g4s)
────────────────────────────────────────────────────────────────────────────────
81 resource "aws_s3_bucket_versioning" "landing_bucket" {
82 bucket = aws_s3_bucket.landing_bucket.id
83 versioning_configuration {
84 [ status = "Disabled"
85 }
86 }
────────────────────────────────────────────────────────────────────────────────
Individual Causes
modules/landing_zone/main.tf:51-81 (module.g4s)
modules/landing_zone/main.tf:1-25 (module.capita)
modules/landing_zone/main.tf:27-49 (module.civica)
────────────────────────────────────────────────────────────────────────────────
ID aws-s3-enable-versioning
Impact Deleted or modified data would not be recoverable
Resolution Enable versioning to protect against accidental/malicious removal or modification
modules/s3_log_bucket/main.tf:27-49 (module.civica)
────────────────────────────────────────────────────────────────────────────────
ID aws-s3-enable-bucket-logging
Impact There is no way to determine the access to this bucket
Resolution Add a logging block to the resource to enable access logging
</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>
```hcl
*****************************
Checkov will check the following folders:
CTFLint Scan Success
Show Output
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>
```hcl
*****************************
Checkov will check the following folders:
CTFLint Scan Success
Show Output
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>
```hcl
*****************************
Checkov will check the following folders:
CTFLint Scan Success
Show Output
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
Result #1 HIGH IAM policy document uses sensitive action 's3:PutObject' on wildcarded resource 'e3166581-e50b-4749-998c-fa08c4bc4108/'
────────────────────────────────────────────────────────────────────────────────
data_store.tf:164
────────────────────────────────────────────────────────────────────────────────
148 data "aws_iam_policy_document" "calculate_checksum_lambda" {
...
164 [ resources = ["${aws_s3_bucket.data_store.arn}/"]
...
166 }
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
Result #2 HIGH Bucket does not encrypt data with a customer managed key.
────────────────────────────────────────────────────────────────────────────────
data_store.tf:20-28
────────────────────────────────────────────────────────────────────────────────
20 resource "aws_s3_bucket_server_side_encryption_configuration" "data_store" {
21 bucket = aws_s3_bucket.data_store.id
22
23 rule {
24 apply_server_side_encryption_by_default {
25 sse_algorithm = "AES256"
26 }
27 }
28 }
────────────────────────────────────────────────────────────────────────────────
ID aws-s3-encryption-customer-key
Impact Using AWS managed keys does not allow for fine grained control
Resolution Enable encryption using customer managed keys
Result #3 HIGH IAM policy document uses sensitive action 's3:GetObject' on wildcarded resource 'e3166581-e50b-4749-998c-fa08c4bc4108/'
────────────────────────────────────────────────────────────────────────────────
data_store.tf:216
────────────────────────────────────────────────────────────────────────────────
207 data "aws_iam_policy_document" "summarise_zip_lambda" {
...
216 [ resources = ["${aws_s3_bucket.data_store.arn}/"]
...
218 }
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
Results #4-15 HIGH IAM policy document uses sensitive action 's3:PutObject' on wildcarded resource 'e1ace58f-1453-4603-8cbc-c0e5dcab7f8b/' (12 similar results)
────────────────────────────────────────────────────────────────────────────────
modules/landing_zone/landing_zone_user/main.tf:57
via modules/landing_zone/main.tf:352-362 (module.landing_zone_users["0"])
via main.tf:1-25 (module.capita)
────────────────────────────────────────────────────────────────────────────────
46 data "aws_iam_policy_document" "this_transfer_user" {
..
57 [ resources = ["${var.landing_bucket.arn}/"]
..
59 }
────────────────────────────────────────────────────────────────────────────────
Individual Causes
modules/landing_zone/landing_zone_user/main.tf:1-25 (module.capita) 12 instances
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
Results #16-18 HIGH IAM policy document uses sensitive action 's3:GetObject' on wildcarded resource 'e1ace58f-1453-4603-8cbc-c0e5dcab7f8b/' (3 similar results)
────────────────────────────────────────────────────────────────────────────────
modules/landing_zone/main.tf:294
via main.tf:1-25 (module.capita)
────────────────────────────────────────────────────────────────────────────────
286 data "aws_iam_policy_document" "this_transfer_workflow" {
...
294 [ resources = ["${aws_s3_bucket.landing_bucket.arn}/"]
...
338 }
────────────────────────────────────────────────────────────────────────────────
Individual Causes
modules/landing_zone/main.tf:1-25 (module.capita) 3 instances
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
Results #19-21 HIGH IAM policy document uses sensitive action 's3:PutObject' on wildcarded resource 'e3166581-e50b-4749-998c-fa08c4bc4108/' (3 similar results)
────────────────────────────────────────────────────────────────────────────────
modules/landing_zone/main.tf:303
via main.tf:1-25 (module.capita)
────────────────────────────────────────────────────────────────────────────────
286 data "aws_iam_policy_document" "this_transfer_workflow" {
...
303 [ resources = ["${var.data_store_bucket.arn}/"]
...
338 }
────────────────────────────────────────────────────────────────────────────────
Individual Causes
modules/landing_zone/main.tf:1-25 (module.capita) 3 instances
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
Results #22-27 HIGH IAM policy document uses sensitive action 's3:PutObjectTagging' on wildcarded resource 'e3166581-e50b-4749-998c-fa08c4bc4108/' (6 similar results)
────────────────────────────────────────────────────────────────────────────────
modules/landing_zone/main.tf:323-326
via main.tf:1-25 (module.capita)
────────────────────────────────────────────────────────────────────────────────
286 data "aws_iam_policy_document" "this_transfer_workflow" {
...
323 ┌ resources = [
324 │ "${var.data_store_bucket.arn}/",
325 │ "${aws_s3_bucket.landing_bucket.arn}/*",
326 └ ]
...
338 }
────────────────────────────────────────────────────────────────────────────────
Individual Causes
modules/landing_zone/main.tf:1-25 (module.capita) 6 instances
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
Results #28-30 HIGH IAM policy document uses sensitive action 's3:DeleteObject' on wildcarded resource 'e1ace58f-1453-4603-8cbc-c0e5dcab7f8b/' (3 similar results)
────────────────────────────────────────────────────────────────────────────────
modules/landing_zone/main.tf:336
via main.tf:1-25 (module.capita)
────────────────────────────────────────────────────────────────────────────────
286 data "aws_iam_policy_document" "this_transfer_workflow" {
...
336 [ resources = ["${aws_s3_bucket.landing_bucket.arn}/"]
...
338 }
────────────────────────────────────────────────────────────────────────────────
Individual Causes
modules/landing_zone/main.tf:1-25 (module.capita) 3 instances
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
modules/landing_zone/main.tf:1-25 (module.capita)
────────────────────────────────────────────────────────────────────────────────
ID aws-s3-encryption-customer-key
Impact Using AWS managed keys does not allow for fine grained control
Resolution Enable encryption using customer managed keys
modules/s3_log_bucket/main.tf:5-10 (module.data_store_log_bucket)
────────────────────────────────────────────────────────────────────────────────
ID aws-s3-encryption-customer-key
Impact Using AWS managed keys does not allow for fine grained control
Resolution Enable encryption using customer managed keys
modules/landing_zone/main.tf:51-81 (module.g4s)
────────────────────────────────────────────────────────────────────────────────
ID aws-s3-enable-versioning
Impact Deleted or modified data would not be recoverable
Resolution Enable versioning to protect against accidental/malicious removal or modification
modules/s3_log_bucket/main.tf:5-10 (module.data_store_log_bucket)
────────────────────────────────────────────────────────────────────────────────
ID aws-s3-enable-bucket-logging
Impact There is no way to determine the access to this bucket
Resolution Add a logging block to the resource to enable access logging
Result #46 LOW Function does not have tracing enabled.
────────────────────────────────────────────────────────────────────────────────
data_store.tf:192-199
────────────────────────────────────────────────────────────────────────────────
192 resource "aws_lambda_function" "summarise_zip_lambda" {
193 filename = "summarise_zip_lambda.zip"
194 function_name = "summarise-zip-lambda"
195 role = aws_iam_role.summarise_zip_lambda.arn
196 handler = "summarise_zip_lambda.handler"
197 runtime = "python3.12"
198 timeout = 600
199 }
────────────────────────────────────────────────────────────────────────────────
ID aws-lambda-enable-tracing
Impact Without full tracing enabled it is difficult to trace the flow of logs
Resolution Enable tracing
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
terraform/environments/electronic-monitoring-data
*****************************
Running tflint in terraform/environments/electronic-monitoring-data
Excluding the following checks: terraform_unused_declarations
4issue(s) found:
Warning: `checksum_algorithm` variable has no type (terraform_typed_variables)
on terraform/environments/electronic-monitoring-data/data_store.tf line 115:115:variable"checksum_algorithm" {
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_typed_variables.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/electronic-monitoring-data/data_store.tf line 179:179:source_arn="${aws_s3_bucket.data_store.arn}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Missing version constraint for provider "archive" in `required_providers` (terraform_required_providers)
on terraform/environments/electronic-monitoring-data/data_store.tf line 186:186:data"archive_file""summarise_zip_lambda" {
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_required_providers.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/electronic-monitoring-data/data_store.tf line 231:231:source_arn="${aws_s3_bucket.data_store.arn}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.mdtflint_exitcode=2
</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>
```hcl
*****************************
Checkov will check the following folders:
CTFLint Scan Success
Show Output
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
terraform/environments/hmpps-domain-services
*****************************
Running tflint in terraform/environments/hmpps-domain-services
Excluding the following checks: terraform_unused_declarations
2issue(s) found:
Warning: Module source "github.com/ministryofjustice/modernisation-platform-terraform-lambda-function" is not pinned (terraform_module_pinned_source)
on terraform/environments/hmpps-domain-services/lambda.tf line 8:8:source="github.com/ministryofjustice/modernisation-platform-terraform-lambda-function"# ref for V3.1
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_module_pinned_source.md
Warning: Missing version constraint for provider "archive" in `required_providers` (terraform_required_providers)
on terraform/environments/hmpps-domain-services/lambda.tf line 35:35:data"archive_file""ad-cleanup-lambda" {
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_required_providers.mdtflint_exitcode=2
</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>
```hcl
*****************************
Checkov will check the following folders:
CTFLint Scan Success
Show Output
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>
```hcl
*****************************
Checkov will check the following folders:
CTFLint Scan Success
Show Output
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fully self-contained example of ec2 module use - #1