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
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase will rebase this PR
@dependabot recreate will recreate this PR, overwriting any edits that have been made to it
@dependabot merge will merge this PR after your CI passes on it
@dependabot squash and merge will squash and merge this PR after your CI passes on it
@dependabot cancel merge will cancel a previously requested merge and block automerging
@dependabot reopen will reopen this PR if it is closed
@dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
@dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
@dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Trivy will check the following folders:
terraform/environments/analytical-platform-ingestion
Running Trivy in terraform/environments/analytical-platform-ingestion
2024-10-14T00:28:46Z INFO [vulndb] Need to update DB
2024-10-14T00:28:46Z INFO [vulndb] Downloading vulnerability DB...
2024-10-14T00:28:46Z INFO [vulndb] Downloading artifact... repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-14T00:28:48Z INFO [vulndb] Artifact successfully downloaded repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-14T00:28:48Z INFO [vuln] Vulnerability scanning is enabled
2024-10-14T00:28:48Z INFO [misconfig] Misconfiguration scanning is enabled
2024-10-14T00:28:48Z INFO [misconfig] Need to update the built-in checks
2024-10-14T00:28:48Z INFO [misconfig] Downloading the built-in checks...
156.02 KiB / 156.02 KiB [---------------------------------------------------------] 100.00% ? p/s 0s2024-10-14T00:28:48Z INFO [secret] Secret scanning is enabled
2024-10-14T00:28:48Z INFO [secret] If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-10-14T00:28:48Z INFO [secret] Please see also https://aquasecurity.github.io/trivy/v0.56/docs/scanner/secret#recommendation for faster secret detection
2024-10-14T00:28:49Z INFO [terraform scanner] Scanning root module file_path="."
2024-10-14T00:28:49Z WARN [terraform parser] Variable values was not found in the environment or variable files. Evaluating may not work correctly. module="root" variables="networking"
2024-10-14T00:28:49Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.sftp_users" value="cty.NilVal"
2024-10-14T00:28:49Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.sftp_users_with_egress" value="cty.NilVal"
2024-10-14T00:28:55Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.bold_egress_bucket.dynamic.rule" value="cty.NilVal"
2024-10-14T00:28:55Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.bold_egress_bucket.dynamic.rule" value="cty.NilVal"
2024-10-14T00:28:55Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.vpc_config" value="cty.NilVal"
2024-10-14T00:28:55Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.logging_config" value="cty.NilVal"
2024-10-14T00:28:55Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.vpc_config" value="cty.NilVal"
2024-10-14T00:28:55Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.logging_config" value="cty.NilVal"
2024-10-14T00:28:55Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.vpc_config" value="cty.NilVal"
2024-10-14T00:28:55Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.logging_config" value="cty.NilVal"
2024-10-14T00:28:55Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.vpc_config" value="cty.NilVal"
2024-10-14T00:28:55Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.logging_config" value="cty.NilVal"
2024-10-14T00:28:55Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definitions_bucket.dynamic.rule" value="cty.NilVal"
2024-10-14T00:28:55Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definitions_bucket.dynamic.rule" value="cty.NilVal"
2024-10-14T00:28:55Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.vpc_config" value="cty.NilVal"
2024-10-14T00:28:55Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.logging_config" value="cty.NilVal"
2024-10-14T00:28:55Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.vpc_config" value="cty.NilVal"
2024-10-14T00:28:55Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.logging_config" value="cty.NilVal"
2024-10-14T00:28:55Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.landing_bucket.dynamic.rule" value="cty.NilVal"
2024-10-14T00:28:55Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.landing_bucket.dynamic.rule" value="cty.NilVal"
2024-10-14T00:28:56Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.notify_quarantined_lambda.dynamic.vpc_config" value="cty.NilVal"
2024-10-14T00:28:56Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.notify_quarantined_lambda.dynamic.logging_config" value="cty.NilVal"
2024-10-14T00:28:56Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.notify_quarantined_lambda.dynamic.vpc_config" value="cty.NilVal"
2024-10-14T00:28:56Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.notify_quarantined_lambda.dynamic.logging_config" value="cty.NilVal"
2024-10-14T00:28:56Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.notify_transferred_lambda.dynamic.vpc_config" value="cty.NilVal"
2024-10-14T00:28:56Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.notify_transferred_lambda.dynamic.logging_config" value="cty.NilVal"
2024-10-14T00:28:56Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.notify_transferred_lambda.dynamic.vpc_config" value="cty.NilVal"
2024-10-14T00:28:56Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.notify_transferred_lambda.dynamic.logging_config" value="cty.NilVal"
2024-10-14T00:28:56Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.processed_bucket.dynamic.rule" value="cty.NilVal"
2024-10-14T00:28:56Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.processed_bucket.dynamic.rule" value="cty.NilVal"
2024-10-14T00:28:56Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.quarantine_bucket.dynamic.rule" value="cty.NilVal"
2024-10-14T00:28:56Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.quarantine_bucket.dynamic.rule" value="cty.NilVal"
2024-10-14T00:28:56Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.notify_quarantined_lambda.dynamic.vpc_config" value="cty.NilVal"
2024-10-14T00:28:56Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.notify_quarantined_lambda.dynamic.logging_config" value="cty.NilVal"
2024-10-14T00:28:56Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.notify_quarantined_lambda.dynamic.vpc_config" value="cty.NilVal"
2024-10-14T00:28:56Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.notify_quarantined_lambda.dynamic.logging_config" value="cty.NilVal"
2024-10-14T00:28:56Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.notify_transferred_lambda.dynamic.vpc_config" value="cty.NilVal"
2024-10-14T00:28:56Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.notify_transferred_lambda.dynamic.logging_config" value="cty.NilVal"
2024-10-14T00:28:56Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.notify_transferred_lambda.dynamic.vpc_config" value="cty.NilVal"
2024-10-14T00:28:56Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.notify_transferred_lambda.dynamic.logging_config" value="cty.NilVal"
2024-10-14T00:28:57Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-public-egress-sgr" range="terraform-aws-modules/security-group/aws/main.tf:533"
2024-10-14T00:28:57Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-public-egress-sgr" range="terraform-aws-modules/security-group/aws/main.tf:534"
2024-10-14T00:28:57Z INFO [terraform executor] Ignore finding rule="aws-s3-encryption-customer-key" range="git::https:/github.com/terraform-aws-modules/terraform-aws-s3-bucket?ref=d8ad14f2da0179178030c8876de84458aa7495e9/main.tf:176-198"
2024-10-14T00:28:57Z INFO [terraform executor] Ignore finding rule="aws-s3-enable-bucket-encryption" range="git::https:/github.com/terraform-aws-modules/terraform-aws-s3-bucket?ref=d8ad14f2da0179178030c8876de84458aa7495e9/main.tf:176-198"
2024-10-14T00:28:57Z INFO Number of language-specific files num=0
2024-10-14T00:28:57Z INFO Detected config files num=13
CRITICAL: Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:340
via git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:328-343 (aws_network_acl_rule.private_outbound[0])
via vpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
328 resource "aws_network_acl_rule" "private_outbound" {
...
340 [ protocol = var.private_outbound_acl_rules[count.index]["protocol"]
...
343 }
────────────────────────────────────────
CRITICAL: Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:323
via git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:311-326 (aws_network_acl_rule.private_inbound[0])
via vpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
311 resource "aws_network_acl_rule" "private_inbound" {
...
323 [ protocol = var.private_inbound_acl_rules[count.index]["protocol"]
...
326 }
────────────────────────────────────────
CRITICAL: Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:221
via git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:209-224 (aws_network_acl_rule.public_outbound[0])
via vpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
209 resource "aws_network_acl_rule" "public_outbound" {
...
221 [ protocol = var.public_outbound_acl_rules[count.index]["protocol"]
...
224 }
────────────────────────────────────────
CRITICAL: Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:204
via git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:192-207 (aws_network_acl_rule.public_inbound[0])
via vpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
192 resource "aws_network_acl_rule" "public_inbound" {
...
204 [ protocol = var.public_inbound_acl_rules[count.index]["protocol"]
...
207 }
────────────────────────────────────────
CRITICAL: Lambda permission lacks source ARN for *.amazonaws.com principal.
════════════════════════════════════════
When the principal is an AWS service, the ARN of the specific resource within that service to grant permission to.
Without this, any resource from principal will be granted permission – even if that resource is from another account.
For S3, this should be the ARN of the S3 Bucket. For CloudWatch Events, this should be the ARN of the CloudWatch Events Rule. For API Gateway, this should be the ARN of the API
See https://avd.aquasec.com/misconfig/avd-aws-0067
────────────────────────────────────────
terraform-aws-modules/lambda/aws/main.tf:306
via terraform-aws-modules/lambda/aws/main.tf:297-313 (aws_lambda_permission.unqualified_alias_triggers["sns"])
via lambda-functions.tf:243-307 (module.notify_quarantined_lambda)
────────────────────────────────────────
297 resource "aws_lambda_permission" "unqualified_alias_triggers" {
...
306 [ source_arn = try(each.value.source_arn, null)
...
313 }
────────────────────────────────────────
CRITICAL: Lambda permission lacks source ARN for *.amazonaws.com principal.
════════════════════════════════════════
When the principal is an AWS service, the ARN of the specific resource within that service to grant permission to.
Without this, any resource from principal will be granted permission – even if that resource is from another account.
For S3, this should be the ARN of the S3 Bucket. For CloudWatch Events, this should be the ARN of the CloudWatch Events Rule. For API Gateway, this should be the ARN of the API
See https://avd.aquasec.com/misconfig/avd-aws-0067
────────────────────────────────────────
terraform-aws-modules/lambda/aws/main.tf:287
via terraform-aws-modules/lambda/aws/main.tf:277-294 (aws_lambda_permission.current_version_triggers["sns"])
via lambda-functions.tf:243-307 (module.notify_quarantined_lambda)
────────────────────────────────────────
277 resource "aws_lambda_permission" "current_version_triggers" {
...
287 [ source_arn = try(each.value.source_arn, null)
...
294 }
────────────────────────────────────────
CRITICAL: Lambda permission lacks source ARN for *.amazonaws.com principal.
════════════════════════════════════════
When the principal is an AWS service, the ARN of the specific resource within that service to grant permission to.
Without this, any resource from principal will be granted permission – even if that resource is from another account.
For S3, this should be the ARN of the S3 Bucket. For CloudWatch Events, this should be the ARN of the CloudWatch Events Rule. For API Gateway, this should be the ARN of the API
See https://avd.aquasec.com/misconfig/avd-aws-0067
────────────────────────────────────────
terraform-aws-modules/lambda/aws/main.tf:306
via terraform-aws-modules/lambda/aws/main.tf:297-313 (aws_lambda_permission.unqualified_alias_triggers["sns"])
via lambda-functions.tf:309-370 (module.notify_transferred_lambda)
────────────────────────────────────────
297 resource "aws_lambda_permission" "unqualified_alias_triggers" {
...
306 [ source_arn = try(each.value.source_arn, null)
...
313 }
────────────────────────────────────────
CRITICAL: Lambda permission lacks source ARN for *.amazonaws.com principal.
════════════════════════════════════════
When the principal is an AWS service, the ARN of the specific resource within that service to grant permission to.
Without this, any resource from principal will be granted permission – even if that resource is from another account.
For S3, this should be the ARN of the S3 Bucket. For CloudWatch Events, this should be the ARN of the CloudWatch Events Rule. For API Gateway, this should be the ARN of the API
See https://avd.aquasec.com/misconfig/avd-aws-0067
────────────────────────────────────────
terraform-aws-modules/lambda/aws/main.tf:287
via terraform-aws-modules/lambda/aws/main.tf:277-294 (aws_lambda_permission.current_version_triggers["sns"])
via lambda-functions.tf:309-370 (module.notify_transferred_lambda)
────────────────────────────────────────
277 resource "aws_lambda_permission" "current_version_triggers" {
...
287 [ source_arn = try(each.value.source_arn, null)
...
294 }
────────────────────────────────────────
CRITICAL: Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:340
via terraform-aws-modules/vpc/aws/main.tf:328-343 (aws_network_acl_rule.private_outbound[0])
via vpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
328 resource "aws_network_acl_rule" "private_outbound" {
...
340 [ protocol = var.private_outbound_acl_rules[count.index]["protocol"]
...
343 }
────────────────────────────────────────
CRITICAL: Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:323
via terraform-aws-modules/vpc/aws/main.tf:311-326 (aws_network_acl_rule.private_inbound[0])
via vpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
311 resource "aws_network_acl_rule" "private_inbound" {
...
323 [ protocol = var.private_inbound_acl_rules[count.index]["protocol"]
...
326 }
────────────────────────────────────────
CRITICAL: Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:221
via terraform-aws-modules/vpc/aws/main.tf:209-224 (aws_network_acl_rule.public_outbound[0])
via vpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
209 resource "aws_network_acl_rule" "public_outbound" {
...
221 [ protocol = var.public_outbound_acl_rules[count.index]["protocol"]
...
224 }
────────────────────────────────────────
CRITICAL: Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:204
via terraform-aws-modules/vpc/aws/main.tf:192-207 (aws_network_acl_rule.public_inbound[0])
via vpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
192 resource "aws_network_acl_rule" "public_inbound" {
...
204 [ protocol = var.public_inbound_acl_rules[count.index]["protocol"]
...
207 }
────────────────────────────────────────
trivy_exitcode=1
</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>
```hcl
*****************************
Checkov will check the following folders:
terraform/environments/analytical-platform-ingestion
*****************************
Running Checkov in terraform/environments/analytical-platform-ingestion
Excluding the following checks: CKV_GIT_1,CKV_AWS_126,CKV2_AWS_38,CKV2_AWS_39
2024-10-14 00:28:59,927 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/kms/aws:3.1.0 (for external modules, the --download-external-modules flag is required)
2024-10-14 00:28:59,927 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/cloudwatch/aws//modules/log-group:5.6.0 (for external modules, the --download-external-modules flag is required)
2024-10-14 00:28:59,927 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/iam/aws//modules/iam-policy:5.44.1 (for external modules, the --download-external-modules flag is required)
2024-10-14 00:28:59,927 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/ec2-instance/aws:5.7.0 (for external modules, the --download-external-modules flag is required)
2024-10-14 00:28:59,927 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/s3-bucket/aws:4.2.1 (for external modules, the --download-external-modules flag is required)
2024-10-14 00:28:59,927 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/iam/aws//modules/iam-assumable-role:5.44.1 (for external modules, the --download-external-modules flag is required)
2024-10-14 00:28:59,927 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/s3-bucket/aws//modules/notification:4.2.1 (for external modules, the --download-external-modules flag is required)
2024-10-14 00:28:59,928 [MainThread ] [WARNI] Failed to download module ministryofjustice/observability-platform-tenant/aws:1.2.0 (for external modules, the --download-external-modules flag is required)
2024-10-14 00:28:59,928 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/vpc/aws//modules/vpc-endpoints:5.13.0 (for external modules, the --download-external-modules flag is required)
2024-10-14 00:28:59,928 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/security-group/aws:5.2.0 (for external modules, the --download-external-modules flag is required)
2024-10-14 00:28:59,928 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/sns/aws:6.1.0 (for external modules, the --download-external-modules flag is required)
2024-10-14 00:28:59,928 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/vpc/aws:5.13.0 (for external modules, the --download-external-modules flag is required)
2024-10-14 00:28:59,928 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/lambda/aws:7.9.0 (for external modules, the --download-external-modules flag is required)
terraform scan results:
Passed checks: 157, Failed checks: 0, Skipped checks: 58
checkov_exitcode=0
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.9.1)
tflint will check the following folders:
terraform/environments/analytical-platform-ingestion
*****************************
Running tflint in terraform/environments/analytical-platform-ingestion
Excluding the following checks: terraform_unused_declarations
tflint_exitcode=0
Trivy Scan Failed
Show Output
*****************************
Trivy will check the following folders:
terraform/environments/analytical-platform-ingestion
*****************************
Running Trivy in terraform/environments/analytical-platform-ingestion
2024-10-14T00:28:46Z INFO [vulndb] Need to update DB
2024-10-14T00:28:46Z INFO [vulndb] Downloading vulnerability DB...2024-10-14T00:28:46Z INFO [vulndb] Downloading artifact...repo="ghcr.io/aquasecurity/trivy-db:2"2024-10-14T00:28:48Z INFO [vulndb] Artifact successfully downloaded repo="ghcr.io/aquasecurity/trivy-db:2"2024-10-14T00:28:48Z INFO [vuln] Vulnerability scanning is enabled
2024-10-14T00:28:48Z INFO [misconfig] Misconfiguration scanning is enabled
2024-10-14T00:28:48Z INFO [misconfig] Need to update the built-in checks
2024-10-14T00:28:48Z INFO [misconfig] Downloading the built-in checks...156.02 KiB /156.02 KiB [---------------------------------------------------------] 100.00%? p/s 0s2024-10-14T00:28:48Z INFO [secret] Secret scanning is enabled
2024-10-14T00:28:48Z INFO [secret] If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-10-14T00:28:48Z INFO [secret] Please see also https://aquasecurity.github.io/trivy/v0.56/docs/scanner/secret#recommendation for faster secret detection2024-10-14T00:28:49Z INFO [terraformscanner] Scanning root module file_path="."2024-10-14T00:28:49Z WARN [terraformparser] Variable values was not found in the environment or variable files. Evaluating may not work correctly.module="root"variables="networking"2024-10-14T00:28:49Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.sftp_users"value="cty.NilVal"2024-10-14T00:28:49Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.sftp_users_with_egress"value="cty.NilVal"2024-10-14T00:28:55Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.bold_egress_bucket.dynamic.rule"value="cty.NilVal"2024-10-14T00:28:55Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.bold_egress_bucket.dynamic.rule"value="cty.NilVal"2024-10-14T00:28:55Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.vpc_config"value="cty.NilVal"2024-10-14T00:28:55Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.logging_config"value="cty.NilVal"2024-10-14T00:28:55Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.vpc_config"value="cty.NilVal"2024-10-14T00:28:55Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.logging_config"value="cty.NilVal"2024-10-14T00:28:55Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.vpc_config"value="cty.NilVal"2024-10-14T00:28:55Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.logging_config"value="cty.NilVal"2024-10-14T00:28:55Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.vpc_config"value="cty.NilVal"2024-10-14T00:28:55Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.logging_config"value="cty.NilVal"2024-10-14T00:28:55Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definitions_bucket.dynamic.rule"value="cty.NilVal"2024-10-14T00:28:55Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definitions_bucket.dynamic.rule"value="cty.NilVal"2024-10-14T00:28:55Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.vpc_config"value="cty.NilVal"2024-10-14T00:28:55Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.logging_config"value="cty.NilVal"2024-10-14T00:28:55Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.vpc_config"value="cty.NilVal"2024-10-14T00:28:55Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.logging_config"value="cty.NilVal"2024-10-14T00:28:55Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.landing_bucket.dynamic.rule"value="cty.NilVal"2024-10-14T00:28:55Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.landing_bucket.dynamic.rule"value="cty.NilVal"2024-10-14T00:28:56Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.notify_quarantined_lambda.dynamic.vpc_config"value="cty.NilVal"2024-10-14T00:28:56Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.notify_quarantined_lambda.dynamic.logging_config"value="cty.NilVal"2024-10-14T00:28:56Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.notify_quarantined_lambda.dynamic.vpc_config"value="cty.NilVal"2024-10-14T00:28:56Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.notify_quarantined_lambda.dynamic.logging_config"value="cty.NilVal"2024-10-14T00:28:56Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.notify_transferred_lambda.dynamic.vpc_config"value="cty.NilVal"2024-10-14T00:28:56Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.notify_transferred_lambda.dynamic.logging_config"value="cty.NilVal"2024-10-14T00:28:56Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.notify_transferred_lambda.dynamic.vpc_config"value="cty.NilVal"2024-10-14T00:28:56Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.notify_transferred_lambda.dynamic.logging_config"value="cty.NilVal"2024-10-14T00:28:56Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.processed_bucket.dynamic.rule"value="cty.NilVal"2024-10-14T00:28:56Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.processed_bucket.dynamic.rule"value="cty.NilVal"2024-10-14T00:28:56Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.quarantine_bucket.dynamic.rule"value="cty.NilVal"2024-10-14T00:28:56Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.quarantine_bucket.dynamic.rule"value="cty.NilVal"2024-10-14T00:28:56Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.notify_quarantined_lambda.dynamic.vpc_config"value="cty.NilVal"2024-10-14T00:28:56Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.notify_quarantined_lambda.dynamic.logging_config"value="cty.NilVal"2024-10-14T00:28:56Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.notify_quarantined_lambda.dynamic.vpc_config"value="cty.NilVal"2024-10-14T00:28:56Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.notify_quarantined_lambda.dynamic.logging_config"value="cty.NilVal"2024-10-14T00:28:56Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.notify_transferred_lambda.dynamic.vpc_config"value="cty.NilVal"2024-10-14T00:28:56Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.notify_transferred_lambda.dynamic.logging_config"value="cty.NilVal"2024-10-14T00:28:56Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.notify_transferred_lambda.dynamic.vpc_config"value="cty.NilVal"2024-10-14T00:28:56Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.notify_transferred_lambda.dynamic.logging_config"value="cty.NilVal"2024-10-14T00:28:57Z INFO [terraformexecutor] Ignore finding rule="aws-ec2-no-public-egress-sgr"range="terraform-aws-modules/security-group/aws/main.tf:533"2024-10-14T00:28:57Z INFO [terraformexecutor] Ignore finding rule="aws-ec2-no-public-egress-sgr"range="terraform-aws-modules/security-group/aws/main.tf:534"2024-10-14T00:28:57Z INFO [terraformexecutor] Ignore finding rule="aws-s3-encryption-customer-key"range="git::https:/github.com/terraform-aws-modules/terraform-aws-s3-bucket?ref=d8ad14f2da0179178030c8876de84458aa7495e9/main.tf:176-198"2024-10-14T00:28:57Z INFO [terraformexecutor] Ignore finding rule="aws-s3-enable-bucket-encryption"range="git::https:/github.com/terraform-aws-modules/terraform-aws-s3-bucket?ref=d8ad14f2da0179178030c8876de84458aa7495e9/main.tf:176-198"2024-10-14T00:28:57Z INFO Number of language-specific files num=02024-10-14T00:28:57Z INFO Detected config files num=13
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf (terraform)
===============================================================================================================================
Tests:4 (SUCCESSES:0, FAILURES:4, EXCEPTIONS:0)
Failures:4 (HIGH:0, CRITICAL:4)
CRITICAL: Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:340
via git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:328-343 (aws_network_acl_rule.private_outbound[0])
via vpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
328 resource"aws_network_acl_rule""private_outbound" {
...340 [ protocol = var.private_outbound_acl_rules[count.index]["protocol"]
...343 }
────────────────────────────────────────
CRITICAL:NetworkACLruleallowsaccessusingALLports.
════════════════════════════════════════
Ensureaccesstospecificrequiredportsisallowed, andnothingelse.Seehttps://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:323viagit::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:311-326 (aws_network_acl_rule.private_inbound[0])
viavpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
311resource"aws_network_acl_rule""private_inbound" {
...323 [ protocol = var.private_inbound_acl_rules[count.index]["protocol"]
...326 }
────────────────────────────────────────
CRITICAL:NetworkACLruleallowsaccessusingALLports.
════════════════════════════════════════
Ensureaccesstospecificrequiredportsisallowed, andnothingelse.Seehttps://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:221viagit::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:209-224 (aws_network_acl_rule.public_outbound[0])
viavpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
209resource"aws_network_acl_rule""public_outbound" {
...221 [ protocol = var.public_outbound_acl_rules[count.index]["protocol"]
...224 }
────────────────────────────────────────
CRITICAL:NetworkACLruleallowsaccessusingALLports.
════════════════════════════════════════
Ensureaccesstospecificrequiredportsisallowed, andnothingelse.Seehttps://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:204viagit::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:192-207 (aws_network_acl_rule.public_inbound[0])
viavpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
192resource"aws_network_acl_rule""public_inbound" {
...204 [ protocol = var.public_inbound_acl_rules[count.index]["protocol"]
...207 }
────────────────────────────────────────
terraform-aws-modules/lambda/aws/main.tf (terraform)
====================================================Tests:4 (SUCCESSES:0, FAILURES:4, EXCEPTIONS:0)
Failures:4 (HIGH:0, CRITICAL:4)
CRITICAL:LambdapermissionlackssourceARNfor*.amazonaws.comprincipal.
════════════════════════════════════════
WhentheprincipalisanAWSservice, theARNofthespecificresourcewithinthatservicetograntpermissionto.Withoutthis, anyresourcefromprincipalwillbegrantedpermission – evenifthatresourceisfromanotheraccount.ForS3, thisshouldbetheARNoftheS3Bucket.ForCloudWatchEvents, thisshouldbetheARNoftheCloudWatchEventsRule.ForAPIGateway, thisshouldbetheARNoftheAPISeehttps://avd.aquasec.com/misconfig/avd-aws-0067
────────────────────────────────────────
terraform-aws-modules/lambda/aws/main.tf:306viaterraform-aws-modules/lambda/aws/main.tf:297-313 (aws_lambda_permission.unqualified_alias_triggers["sns"])
vialambda-functions.tf:243-307 (module.notify_quarantined_lambda)
────────────────────────────────────────
297resource"aws_lambda_permission""unqualified_alias_triggers" {
...306 [ source_arn =try(each.value.source_arn, null)
...313 }
────────────────────────────────────────
CRITICAL:LambdapermissionlackssourceARNfor*.amazonaws.comprincipal.
════════════════════════════════════════
WhentheprincipalisanAWSservice, theARNofthespecificresourcewithinthatservicetograntpermissionto.Withoutthis, anyresourcefromprincipalwillbegrantedpermission – evenifthatresourceisfromanotheraccount.ForS3, thisshouldbetheARNoftheS3Bucket.ForCloudWatchEvents, thisshouldbetheARNoftheCloudWatchEventsRule.ForAPIGateway, thisshouldbetheARNoftheAPISeehttps://avd.aquasec.com/misconfig/avd-aws-0067
────────────────────────────────────────
terraform-aws-modules/lambda/aws/main.tf:287viaterraform-aws-modules/lambda/aws/main.tf:277-294 (aws_lambda_permission.current_version_triggers["sns"])
vialambda-functions.tf:243-307 (module.notify_quarantined_lambda)
────────────────────────────────────────
277resource"aws_lambda_permission""current_version_triggers" {
...287 [ source_arn =try(each.value.source_arn, null)
...294 }
────────────────────────────────────────
CRITICAL:LambdapermissionlackssourceARNfor*.amazonaws.comprincipal.
════════════════════════════════════════
WhentheprincipalisanAWSservice, theARNofthespecificresourcewithinthatservicetograntpermissionto.Withoutthis, anyresourcefromprincipalwillbegrantedpermission – evenifthatresourceisfromanotheraccount.ForS3, thisshouldbetheARNoftheS3Bucket.ForCloudWatchEvents, thisshouldbetheARNoftheCloudWatchEventsRule.ForAPIGateway, thisshouldbetheARNoftheAPISeehttps://avd.aquasec.com/misconfig/avd-aws-0067
────────────────────────────────────────
terraform-aws-modules/lambda/aws/main.tf:306viaterraform-aws-modules/lambda/aws/main.tf:297-313 (aws_lambda_permission.unqualified_alias_triggers["sns"])
vialambda-functions.tf:309-370 (module.notify_transferred_lambda)
────────────────────────────────────────
297resource"aws_lambda_permission""unqualified_alias_triggers" {
...306 [ source_arn =try(each.value.source_arn, null)
...313 }
────────────────────────────────────────
CRITICAL:LambdapermissionlackssourceARNfor*.amazonaws.comprincipal.
════════════════════════════════════════
WhentheprincipalisanAWSservice, theARNofthespecificresourcewithinthatservicetograntpermissionto.Withoutthis, anyresourcefromprincipalwillbegrantedpermission – evenifthatresourceisfromanotheraccount.ForS3, thisshouldbetheARNoftheS3Bucket.ForCloudWatchEvents, thisshouldbetheARNoftheCloudWatchEventsRule.ForAPIGateway, thisshouldbetheARNoftheAPISeehttps://avd.aquasec.com/misconfig/avd-aws-0067
────────────────────────────────────────
terraform-aws-modules/lambda/aws/main.tf:287viaterraform-aws-modules/lambda/aws/main.tf:277-294 (aws_lambda_permission.current_version_triggers["sns"])
vialambda-functions.tf:309-370 (module.notify_transferred_lambda)
────────────────────────────────────────
277resource"aws_lambda_permission""current_version_triggers" {
...287 [ source_arn =try(each.value.source_arn, null)
...294 }
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf (terraform)
=================================================
Tests:4 (SUCCESSES:0, FAILURES:4, EXCEPTIONS:0)
Failures:4 (HIGH:0, CRITICAL:4)
CRITICAL:NetworkACLruleallowsaccessusingALLports.
════════════════════════════════════════
Ensureaccesstospecificrequiredportsisallowed, andnothingelse.Seehttps://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:340viaterraform-aws-modules/vpc/aws/main.tf:328-343 (aws_network_acl_rule.private_outbound[0])
viavpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
328resource"aws_network_acl_rule""private_outbound" {
...340 [ protocol = var.private_outbound_acl_rules[count.index]["protocol"]
...343 }
────────────────────────────────────────
CRITICAL:NetworkACLruleallowsaccessusingALLports.
════════════════════════════════════════
Ensureaccesstospecificrequiredportsisallowed, andnothingelse.Seehttps://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:323viaterraform-aws-modules/vpc/aws/main.tf:311-326 (aws_network_acl_rule.private_inbound[0])
viavpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
311resource"aws_network_acl_rule""private_inbound" {
...323 [ protocol = var.private_inbound_acl_rules[count.index]["protocol"]
...326 }
────────────────────────────────────────
CRITICAL:NetworkACLruleallowsaccessusingALLports.
════════════════════════════════════════
Ensureaccesstospecificrequiredportsisallowed, andnothingelse.Seehttps://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:221viaterraform-aws-modules/vpc/aws/main.tf:209-224 (aws_network_acl_rule.public_outbound[0])
viavpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
209resource"aws_network_acl_rule""public_outbound" {
...221 [ protocol = var.public_outbound_acl_rules[count.index]["protocol"]
...224 }
────────────────────────────────────────
CRITICAL:NetworkACLruleallowsaccessusingALLports.
════════════════════════════════════════
Ensureaccesstospecificrequiredportsisallowed, andnothingelse.Seehttps://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:204viaterraform-aws-modules/vpc/aws/main.tf:192-207 (aws_network_acl_rule.public_inbound[0])
viavpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
192resource"aws_network_acl_rule""public_inbound" {
...204 [ protocol = var.public_inbound_acl_rules[count.index]["protocol"]
...207 }
────────────────────────────────────────
trivy_exitcode=1
Trivy will check the following folders:
terraform/environments/analytical-platform-ingestion
Running Trivy in terraform/environments/analytical-platform-ingestion
2024-10-21T08:21:32Z INFO [vulndb] Need to update DB
2024-10-21T08:21:32Z INFO [vulndb] Downloading vulnerability DB...
2024-10-21T08:21:32Z INFO [vulndb] Downloading artifact... repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-21T08:21:34Z INFO [vulndb] Artifact successfully downloaded repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-21T08:21:34Z INFO [vuln] Vulnerability scanning is enabled
2024-10-21T08:21:34Z INFO [misconfig] Misconfiguration scanning is enabled
2024-10-21T08:21:34Z INFO [misconfig] Need to update the built-in checks
2024-10-21T08:21:34Z INFO [misconfig] Downloading the built-in checks...
156.02 KiB / 156.02 KiB [------------------------------------------------------] 100.00% ? p/s 100ms2024-10-21T08:21:34Z INFO [secret] Secret scanning is enabled
2024-10-21T08:21:34Z INFO [secret] If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-10-21T08:21:34Z INFO [secret] Please see also https://aquasecurity.github.io/trivy/v0.56/docs/scanner/secret#recommendation for faster secret detection
2024-10-21T08:21:35Z INFO [terraform scanner] Scanning root module file_path="."
2024-10-21T08:21:35Z WARN [terraform parser] Variable values was not found in the environment or variable files. Evaluating may not work correctly. module="root" variables="networking"
2024-10-21T08:21:35Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.sftp_users" value="cty.NilVal"
2024-10-21T08:21:35Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.sftp_users_with_egress" value="cty.NilVal"
2024-10-21T08:21:39Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.bold_egress_bucket.dynamic.rule" value="cty.NilVal"
2024-10-21T08:21:39Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.bold_egress_bucket.dynamic.rule" value="cty.NilVal"
2024-10-21T08:21:40Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.vpc_config" value="cty.NilVal"
2024-10-21T08:21:40Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.logging_config" value="cty.NilVal"
2024-10-21T08:21:40Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.vpc_config" value="cty.NilVal"
2024-10-21T08:21:40Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.logging_config" value="cty.NilVal"
2024-10-21T08:21:40Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.vpc_config" value="cty.NilVal"
2024-10-21T08:21:40Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.logging_config" value="cty.NilVal"
2024-10-21T08:21:40Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.vpc_config" value="cty.NilVal"
2024-10-21T08:21:40Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.logging_config" value="cty.NilVal"
2024-10-21T08:21:40Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definitions_bucket.dynamic.rule" value="cty.NilVal"
2024-10-21T08:21:40Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definitions_bucket.dynamic.rule" value="cty.NilVal"
2024-10-21T08:21:40Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.vpc_config" value="cty.NilVal"
2024-10-21T08:21:40Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.logging_config" value="cty.NilVal"
2024-10-21T08:21:40Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.vpc_config" value="cty.NilVal"
2024-10-21T08:21:40Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.logging_config" value="cty.NilVal"
2024-10-21T08:21:40Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.landing_bucket.dynamic.rule" value="cty.NilVal"
2024-10-21T08:21:40Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.landing_bucket.dynamic.rule" value="cty.NilVal"
2024-10-21T08:21:40Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.notify_quarantined_lambda.dynamic.vpc_config" value="cty.NilVal"
2024-10-21T08:21:40Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.notify_quarantined_lambda.dynamic.logging_config" value="cty.NilVal"
2024-10-21T08:21:40Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.notify_quarantined_lambda.dynamic.vpc_config" value="cty.NilVal"
2024-10-21T08:21:40Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.notify_quarantined_lambda.dynamic.logging_config" value="cty.NilVal"
2024-10-21T08:21:41Z INFO [terraform executor] Ignore finding rule="aws-s3-encryption-customer-key" range="git::https:/github.com/terraform-aws-modules/terraform-aws-s3-bucket?ref=d8ad14f2da0179178030c8876de84458aa7495e9/main.tf:176-198"
2024-10-21T08:21:41Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-public-egress-sgr" range="terraform-aws-modules/security-group/aws/main.tf:533"
2024-10-21T08:21:41Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-public-egress-sgr" range="terraform-aws-modules/security-group/aws/main.tf:534"
2024-10-21T08:21:41Z INFO [terraform executor] Ignore finding rule="aws-s3-enable-bucket-encryption" range="git::https:/github.com/terraform-aws-modules/terraform-aws-s3-bucket?ref=d8ad14f2da0179178030c8876de84458aa7495e9/main.tf:176-198"
2024-10-21T08:21:41Z INFO Number of language-specific files num=0
2024-10-21T08:21:41Z INFO Detected config files num=14
HIGH: Load balancer is exposed publicly.
════════════════════════════════════════
There are many scenarios in which you would want to expose a load balancer to the wider internet, but this check exists as a warning to prevent accidental exposure of internal assets. You should ensure that this resource should be exposed publicly.
See https://avd.aquasec.com/misconfig/avd-aws-0053
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-alb?ref=349540d1a611cd98a6383cc64ef0d9bf08d88fb7/main.tf:47
via git::https:/github.com/terraform-aws-modules/terraform-aws-alb?ref=349540d1a611cd98a6383cc64ef0d9bf08d88fb7/main.tf:12-81 (aws_lb.this[0])
via network-load-balancers.tf:1-37 (module.datasync_activation_nlb)
────────────────────────────────────────
12 resource "aws_lb" "this" {
..
47 [ internal = var.internal
..
81 }
────────────────────────────────────────
CRITICAL: Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:340
via git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:328-343 (aws_network_acl_rule.private_outbound[0])
via vpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
328 resource "aws_network_acl_rule" "private_outbound" {
...
340 [ protocol = var.private_outbound_acl_rules[count.index]["protocol"]
...
343 }
────────────────────────────────────────
CRITICAL: Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:323
via git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:311-326 (aws_network_acl_rule.private_inbound[0])
via vpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
311 resource "aws_network_acl_rule" "private_inbound" {
...
323 [ protocol = var.private_inbound_acl_rules[count.index]["protocol"]
...
326 }
────────────────────────────────────────
CRITICAL: Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:221
via git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:209-224 (aws_network_acl_rule.public_outbound[0])
via vpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
209 resource "aws_network_acl_rule" "public_outbound" {
...
221 [ protocol = var.public_outbound_acl_rules[count.index]["protocol"]
...
224 }
────────────────────────────────────────
CRITICAL: Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:204
via git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:192-207 (aws_network_acl_rule.public_inbound[0])
via vpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
192 resource "aws_network_acl_rule" "public_inbound" {
...
204 [ protocol = var.public_inbound_acl_rules[count.index]["protocol"]
...
207 }
────────────────────────────────────────
CRITICAL: Lambda permission lacks source ARN for *.amazonaws.com principal.
════════════════════════════════════════
When the principal is an AWS service, the ARN of the specific resource within that service to grant permission to.
Without this, any resource from principal will be granted permission – even if that resource is from another account.
For S3, this should be the ARN of the S3 Bucket. For CloudWatch Events, this should be the ARN of the CloudWatch Events Rule. For API Gateway, this should be the ARN of the API
See https://avd.aquasec.com/misconfig/avd-aws-0067
────────────────────────────────────────
terraform-aws-modules/lambda/aws/main.tf:306
via terraform-aws-modules/lambda/aws/main.tf:297-313 (aws_lambda_permission.unqualified_alias_triggers["sns"])
via lambda-functions.tf:243-307 (module.notify_quarantined_lambda)
────────────────────────────────────────
297 resource "aws_lambda_permission" "unqualified_alias_triggers" {
...
306 [ source_arn = try(each.value.source_arn, null)
...
313 }
────────────────────────────────────────
CRITICAL: Lambda permission lacks source ARN for *.amazonaws.com principal.
════════════════════════════════════════
When the principal is an AWS service, the ARN of the specific resource within that service to grant permission to.
Without this, any resource from principal will be granted permission – even if that resource is from another account.
For S3, this should be the ARN of the S3 Bucket. For CloudWatch Events, this should be the ARN of the CloudWatch Events Rule. For API Gateway, this should be the ARN of the API
See https://avd.aquasec.com/misconfig/avd-aws-0067
────────────────────────────────────────
terraform-aws-modules/lambda/aws/main.tf:287
via terraform-aws-modules/lambda/aws/main.tf:277-294 (aws_lambda_permission.current_version_triggers["sns"])
via lambda-functions.tf:243-307 (module.notify_quarantined_lambda)
────────────────────────────────────────
277 resource "aws_lambda_permission" "current_version_triggers" {
...
287 [ source_arn = try(each.value.source_arn, null)
...
294 }
────────────────────────────────────────
CRITICAL: Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:340
via terraform-aws-modules/vpc/aws/main.tf:328-343 (aws_network_acl_rule.private_outbound[0])
via vpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
328 resource "aws_network_acl_rule" "private_outbound" {
...
340 [ protocol = var.private_outbound_acl_rules[count.index]["protocol"]
...
343 }
────────────────────────────────────────
CRITICAL: Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:323
via terraform-aws-modules/vpc/aws/main.tf:311-326 (aws_network_acl_rule.private_inbound[0])
via vpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
311 resource "aws_network_acl_rule" "private_inbound" {
...
323 [ protocol = var.private_inbound_acl_rules[count.index]["protocol"]
...
326 }
────────────────────────────────────────
CRITICAL: Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:221
via terraform-aws-modules/vpc/aws/main.tf:209-224 (aws_network_acl_rule.public_outbound[0])
via vpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
209 resource "aws_network_acl_rule" "public_outbound" {
...
221 [ protocol = var.public_outbound_acl_rules[count.index]["protocol"]
...
224 }
────────────────────────────────────────
CRITICAL: Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:204
via terraform-aws-modules/vpc/aws/main.tf:192-207 (aws_network_acl_rule.public_inbound[0])
via vpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
192 resource "aws_network_acl_rule" "public_inbound" {
...
204 [ protocol = var.public_inbound_acl_rules[count.index]["protocol"]
...
207 }
────────────────────────────────────────
trivy_exitcode=1
</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>
```hcl
*****************************
Checkov will check the following folders:
terraform/environments/analytical-platform-ingestion
*****************************
Running Checkov in terraform/environments/analytical-platform-ingestion
Excluding the following checks: CKV_GIT_1,CKV_AWS_126,CKV2_AWS_38,CKV2_AWS_39
2024-10-21 08:21:44,396 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/cloudwatch/aws//modules/log-group:5.6.0 (for external modules, the --download-external-modules flag is required)
2024-10-21 08:21:44,396 [MainThread ] [WARNI] Failed to download module ministryofjustice/observability-platform-tenant/aws:1.2.0 (for external modules, the --download-external-modules flag is required)
2024-10-21 08:21:44,396 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/kms/aws:3.1.0 (for external modules, the --download-external-modules flag is required)
2024-10-21 08:21:44,396 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/sns/aws:6.1.0 (for external modules, the --download-external-modules flag is required)
2024-10-21 08:21:44,396 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/vpc/aws//modules/vpc-endpoints:5.13.0 (for external modules, the --download-external-modules flag is required)
2024-10-21 08:21:44,396 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/lambda/aws:7.9.0 (for external modules, the --download-external-modules flag is required)
2024-10-21 08:21:44,397 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/vpc/aws:5.13.0 (for external modules, the --download-external-modules flag is required)
2024-10-21 08:21:44,397 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/iam/aws//modules/iam-assumable-role:5.44.1 (for external modules, the --download-external-modules flag is required)
2024-10-21 08:21:44,397 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/s3-bucket/aws:4.2.1 (for external modules, the --download-external-modules flag is required)
2024-10-21 08:21:44,397 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/security-group/aws:5.2.0 (for external modules, the --download-external-modules flag is required)
2024-10-21 08:21:44,397 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/alb/aws:9.11.0 (for external modules, the --download-external-modules flag is required)
2024-10-21 08:21:44,397 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/s3-bucket/aws//modules/notification:4.2.1 (for external modules, the --download-external-modules flag is required)
2024-10-21 08:21:44,398 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/iam/aws//modules/iam-policy:5.44.1 (for external modules, the --download-external-modules flag is required)
2024-10-21 08:21:44,398 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/ec2-instance/aws:5.7.0 (for external modules, the --download-external-modules flag is required)
terraform scan results:
Passed checks: 162, Failed checks: 0, Skipped checks: 62
checkov_exitcode=0
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.9.1)
tflint will check the following folders:
terraform/environments/analytical-platform-ingestion
*****************************
Running tflint in terraform/environments/analytical-platform-ingestion
Excluding the following checks: terraform_unused_declarations
tflint_exitcode=0
Trivy Scan Failed
Show Output
*****************************
Trivy will check the following folders:
terraform/environments/analytical-platform-ingestion
*****************************
Running Trivy in terraform/environments/analytical-platform-ingestion
2024-10-21T08:21:32Z INFO [vulndb] Need to update DB
2024-10-21T08:21:32Z INFO [vulndb] Downloading vulnerability DB...2024-10-21T08:21:32Z INFO [vulndb] Downloading artifact...repo="ghcr.io/aquasecurity/trivy-db:2"2024-10-21T08:21:34Z INFO [vulndb] Artifact successfully downloaded repo="ghcr.io/aquasecurity/trivy-db:2"2024-10-21T08:21:34Z INFO [vuln] Vulnerability scanning is enabled
2024-10-21T08:21:34Z INFO [misconfig] Misconfiguration scanning is enabled
2024-10-21T08:21:34Z INFO [misconfig] Need to update the built-in checks
2024-10-21T08:21:34Z INFO [misconfig] Downloading the built-in checks...156.02 KiB /156.02 KiB [------------------------------------------------------] 100.00%? p/s 100ms2024-10-21T08:21:34Z INFO [secret] Secret scanning is enabled
2024-10-21T08:21:34Z INFO [secret] If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-10-21T08:21:34Z INFO [secret] Please see also https://aquasecurity.github.io/trivy/v0.56/docs/scanner/secret#recommendation for faster secret detection2024-10-21T08:21:35Z INFO [terraformscanner] Scanning root module file_path="."2024-10-21T08:21:35Z WARN [terraformparser] Variable values was not found in the environment or variable files. Evaluating may not work correctly.module="root"variables="networking"2024-10-21T08:21:35Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.sftp_users"value="cty.NilVal"2024-10-21T08:21:35Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.sftp_users_with_egress"value="cty.NilVal"2024-10-21T08:21:39Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.bold_egress_bucket.dynamic.rule"value="cty.NilVal"2024-10-21T08:21:39Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.bold_egress_bucket.dynamic.rule"value="cty.NilVal"2024-10-21T08:21:40Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.vpc_config"value="cty.NilVal"2024-10-21T08:21:40Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.logging_config"value="cty.NilVal"2024-10-21T08:21:40Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.vpc_config"value="cty.NilVal"2024-10-21T08:21:40Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.logging_config"value="cty.NilVal"2024-10-21T08:21:40Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.vpc_config"value="cty.NilVal"2024-10-21T08:21:40Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.logging_config"value="cty.NilVal"2024-10-21T08:21:40Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.vpc_config"value="cty.NilVal"2024-10-21T08:21:40Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.logging_config"value="cty.NilVal"2024-10-21T08:21:40Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definitions_bucket.dynamic.rule"value="cty.NilVal"2024-10-21T08:21:40Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definitions_bucket.dynamic.rule"value="cty.NilVal"2024-10-21T08:21:40Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.vpc_config"value="cty.NilVal"2024-10-21T08:21:40Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.logging_config"value="cty.NilVal"2024-10-21T08:21:40Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.vpc_config"value="cty.NilVal"2024-10-21T08:21:40Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.logging_config"value="cty.NilVal"2024-10-21T08:21:40Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.landing_bucket.dynamic.rule"value="cty.NilVal"2024-10-21T08:21:40Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.landing_bucket.dynamic.rule"value="cty.NilVal"2024-10-21T08:21:40Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.notify_quarantined_lambda.dynamic.vpc_config"value="cty.NilVal"2024-10-21T08:21:40Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.notify_quarantined_lambda.dynamic.logging_config"value="cty.NilVal"2024-10-21T08:21:40Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.notify_quarantined_lambda.dynamic.vpc_config"value="cty.NilVal"2024-10-21T08:21:40Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.notify_quarantined_lambda.dynamic.logging_config"value="cty.NilVal"2024-10-21T08:21:41Z INFO [terraformexecutor] Ignore finding rule="aws-s3-encryption-customer-key"range="git::https:/github.com/terraform-aws-modules/terraform-aws-s3-bucket?ref=d8ad14f2da0179178030c8876de84458aa7495e9/main.tf:176-198"2024-10-21T08:21:41Z INFO [terraformexecutor] Ignore finding rule="aws-ec2-no-public-egress-sgr"range="terraform-aws-modules/security-group/aws/main.tf:533"2024-10-21T08:21:41Z INFO [terraformexecutor] Ignore finding rule="aws-ec2-no-public-egress-sgr"range="terraform-aws-modules/security-group/aws/main.tf:534"2024-10-21T08:21:41Z INFO [terraformexecutor] Ignore finding rule="aws-s3-enable-bucket-encryption"range="git::https:/github.com/terraform-aws-modules/terraform-aws-s3-bucket?ref=d8ad14f2da0179178030c8876de84458aa7495e9/main.tf:176-198"2024-10-21T08:21:41Z INFO Number of language-specific files num=02024-10-21T08:21:41Z INFO Detected config files num=14
git::https:/github.com/terraform-aws-modules/terraform-aws-alb?ref=349540d1a611cd98a6383cc64ef0d9bf08d88fb7/main.tf (terraform)
===============================================================================================================================
Tests:1 (SUCCESSES:0, FAILURES:1, EXCEPTIONS:0)
Failures:1 (HIGH:1, CRITICAL:0)
HIGH: Load balancer is exposed publicly.
════════════════════════════════════════
There are many scenarios in which you would want to expose a load balancer to the wider internet, but this check exists as a warning to prevent accidental exposure of internal assets. You should ensure that this resource should be exposed publicly.
See https://avd.aquasec.com/misconfig/avd-aws-0053
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-alb?ref=349540d1a611cd98a6383cc64ef0d9bf08d88fb7/main.tf:47
via git::https:/github.com/terraform-aws-modules/terraform-aws-alb?ref=349540d1a611cd98a6383cc64ef0d9bf08d88fb7/main.tf:12-81 (aws_lb.this[0])
via network-load-balancers.tf:1-37 (module.datasync_activation_nlb)
────────────────────────────────────────
12 resource"aws_lb""this" {
..47 [ internal = var.internal..81 }
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf (terraform)
===============================================================================================================================
Tests:4 (SUCCESSES:0, FAILURES:4, EXCEPTIONS:0)
Failures:4 (HIGH:0, CRITICAL:4)
CRITICAL:NetworkACLruleallowsaccessusingALLports.
════════════════════════════════════════
Ensureaccesstospecificrequiredportsisallowed, andnothingelse.Seehttps://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:340viagit::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:328-343 (aws_network_acl_rule.private_outbound[0])
viavpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
328resource"aws_network_acl_rule""private_outbound" {
...340 [ protocol = var.private_outbound_acl_rules[count.index]["protocol"]
...343 }
────────────────────────────────────────
CRITICAL:NetworkACLruleallowsaccessusingALLports.
════════════════════════════════════════
Ensureaccesstospecificrequiredportsisallowed, andnothingelse.Seehttps://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:323viagit::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:311-326 (aws_network_acl_rule.private_inbound[0])
viavpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
311resource"aws_network_acl_rule""private_inbound" {
...323 [ protocol = var.private_inbound_acl_rules[count.index]["protocol"]
...326 }
────────────────────────────────────────
CRITICAL:NetworkACLruleallowsaccessusingALLports.
════════════════════════════════════════
Ensureaccesstospecificrequiredportsisallowed, andnothingelse.Seehttps://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:221viagit::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:209-224 (aws_network_acl_rule.public_outbound[0])
viavpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
209resource"aws_network_acl_rule""public_outbound" {
...221 [ protocol = var.public_outbound_acl_rules[count.index]["protocol"]
...224 }
────────────────────────────────────────
CRITICAL:NetworkACLruleallowsaccessusingALLports.
════════════════════════════════════════
Ensureaccesstospecificrequiredportsisallowed, andnothingelse.Seehttps://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:204viagit::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:192-207 (aws_network_acl_rule.public_inbound[0])
viavpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
192resource"aws_network_acl_rule""public_inbound" {
...204 [ protocol = var.public_inbound_acl_rules[count.index]["protocol"]
...207 }
────────────────────────────────────────
terraform-aws-modules/lambda/aws/main.tf (terraform)
====================================================Tests:2 (SUCCESSES:0, FAILURES:2, EXCEPTIONS:0)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:LambdapermissionlackssourceARNfor*.amazonaws.comprincipal.
════════════════════════════════════════
WhentheprincipalisanAWSservice, theARNofthespecificresourcewithinthatservicetograntpermissionto.Withoutthis, anyresourcefromprincipalwillbegrantedpermission – evenifthatresourceisfromanotheraccount.ForS3, thisshouldbetheARNoftheS3Bucket.ForCloudWatchEvents, thisshouldbetheARNoftheCloudWatchEventsRule.ForAPIGateway, thisshouldbetheARNoftheAPISeehttps://avd.aquasec.com/misconfig/avd-aws-0067
────────────────────────────────────────
terraform-aws-modules/lambda/aws/main.tf:306viaterraform-aws-modules/lambda/aws/main.tf:297-313 (aws_lambda_permission.unqualified_alias_triggers["sns"])
vialambda-functions.tf:243-307 (module.notify_quarantined_lambda)
────────────────────────────────────────
297resource"aws_lambda_permission""unqualified_alias_triggers" {
...306 [ source_arn =try(each.value.source_arn, null)
...313 }
────────────────────────────────────────
CRITICAL:LambdapermissionlackssourceARNfor*.amazonaws.comprincipal.
════════════════════════════════════════
WhentheprincipalisanAWSservice, theARNofthespecificresourcewithinthatservicetograntpermissionto.Withoutthis, anyresourcefromprincipalwillbegrantedpermission – evenifthatresourceisfromanotheraccount.ForS3, thisshouldbetheARNoftheS3Bucket.ForCloudWatchEvents, thisshouldbetheARNoftheCloudWatchEventsRule.ForAPIGateway, thisshouldbetheARNoftheAPISeehttps://avd.aquasec.com/misconfig/avd-aws-0067
────────────────────────────────────────
terraform-aws-modules/lambda/aws/main.tf:287viaterraform-aws-modules/lambda/aws/main.tf:277-294 (aws_lambda_permission.current_version_triggers["sns"])
vialambda-functions.tf:243-307 (module.notify_quarantined_lambda)
────────────────────────────────────────
277resource"aws_lambda_permission""current_version_triggers" {
...287 [ source_arn =try(each.value.source_arn, null)
...294 }
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf (terraform)
=================================================
Tests:4 (SUCCESSES:0, FAILURES:4, EXCEPTIONS:0)
Failures:4 (HIGH:0, CRITICAL:4)
CRITICAL:NetworkACLruleallowsaccessusingALLports.
════════════════════════════════════════
Ensureaccesstospecificrequiredportsisallowed, andnothingelse.Seehttps://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:340viaterraform-aws-modules/vpc/aws/main.tf:328-343 (aws_network_acl_rule.private_outbound[0])
viavpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
328resource"aws_network_acl_rule""private_outbound" {
...340 [ protocol = var.private_outbound_acl_rules[count.index]["protocol"]
...343 }
────────────────────────────────────────
CRITICAL:NetworkACLruleallowsaccessusingALLports.
════════════════════════════════════════
Ensureaccesstospecificrequiredportsisallowed, andnothingelse.Seehttps://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:323viaterraform-aws-modules/vpc/aws/main.tf:311-326 (aws_network_acl_rule.private_inbound[0])
viavpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
311resource"aws_network_acl_rule""private_inbound" {
...323 [ protocol = var.private_inbound_acl_rules[count.index]["protocol"]
...326 }
────────────────────────────────────────
CRITICAL:NetworkACLruleallowsaccessusingALLports.
════════════════════════════════════════
Ensureaccesstospecificrequiredportsisallowed, andnothingelse.Seehttps://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:221viaterraform-aws-modules/vpc/aws/main.tf:209-224 (aws_network_acl_rule.public_outbound[0])
viavpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
209resource"aws_network_acl_rule""public_outbound" {
...221 [ protocol = var.public_outbound_acl_rules[count.index]["protocol"]
...224 }
────────────────────────────────────────
CRITICAL:NetworkACLruleallowsaccessusingALLports.
════════════════════════════════════════
Ensureaccesstospecificrequiredportsisallowed, andnothingelse.Seehttps://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:204viaterraform-aws-modules/vpc/aws/main.tf:192-207 (aws_network_acl_rule.public_inbound[0])
viavpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
192resource"aws_network_acl_rule""public_inbound" {
...204 [ protocol = var.public_inbound_acl_rules[count.index]["protocol"]
...207 }
────────────────────────────────────────
trivy_exitcode=1
Trivy will check the following folders:
terraform/environments/analytical-platform-ingestion
Running Trivy in terraform/environments/analytical-platform-ingestion
2024-10-23T16:22:46Z INFO [vulndb] Need to update DB
2024-10-23T16:22:46Z INFO [vulndb] Downloading vulnerability DB...
2024-10-23T16:22:46Z INFO [vulndb] Downloading artifact... repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-23T16:22:46Z ERROR [vulndb] Failed to download artifact repo="ghcr.io/aquasecurity/trivy-db:2" err="OCI repository error: 1 error occurred:\n\t* GET https://ghcr.io/v2/aquasecurity/trivy-db/manifests/2: TOOMANYREQUESTS: retry-after: 813.037µs, allowed: 44000/minute\n\n"
2024-10-23T16:22:46Z FATAL Fatal error init error: DB error: failed to download vulnerability DB: OCI artifact error: failed to download vulnerability DB: failed to download artifact from any source
trivy_exitcode=1
</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>
```hcl
*****************************
Checkov will check the following folders:
terraform/environments/analytical-platform-ingestion
*****************************
Running Checkov in terraform/environments/analytical-platform-ingestion
Excluding the following checks: CKV_GIT_1,CKV_AWS_126,CKV2_AWS_38,CKV2_AWS_39
2024-10-23 16:22:48,859 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/cloudwatch/aws//modules/log-group:5.6.0 (for external modules, the --download-external-modules flag is required)
2024-10-23 16:22:48,859 [MainThread ] [WARNI] Failed to download module ministryofjustice/observability-platform-tenant/aws:1.2.0 (for external modules, the --download-external-modules flag is required)
2024-10-23 16:22:48,859 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/kms/aws:3.1.0 (for external modules, the --download-external-modules flag is required)
2024-10-23 16:22:48,859 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/sns/aws:6.1.0 (for external modules, the --download-external-modules flag is required)
2024-10-23 16:22:48,859 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/vpc/aws//modules/vpc-endpoints:5.13.0 (for external modules, the --download-external-modules flag is required)
2024-10-23 16:22:48,859 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/lambda/aws:7.9.0 (for external modules, the --download-external-modules flag is required)
2024-10-23 16:22:48,860 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/vpc/aws:5.13.0 (for external modules, the --download-external-modules flag is required)
2024-10-23 16:22:48,860 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/iam/aws//modules/iam-assumable-role:5.44.1 (for external modules, the --download-external-modules flag is required)
2024-10-23 16:22:48,860 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/s3-bucket/aws:4.2.1 (for external modules, the --download-external-modules flag is required)
2024-10-23 16:22:48,860 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/security-group/aws:5.2.0 (for external modules, the --download-external-modules flag is required)
2024-10-23 16:22:48,860 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/alb/aws:9.11.0 (for external modules, the --download-external-modules flag is required)
2024-10-23 16:22:48,860 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/s3-bucket/aws//modules/notification:4.2.1 (for external modules, the --download-external-modules flag is required)
2024-10-23 16:22:48,860 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/iam/aws//modules/iam-policy:5.44.1 (for external modules, the --download-external-modules flag is required)
2024-10-23 16:22:48,860 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/ec2-instance/aws:5.7.0 (for external modules, the --download-external-modules flag is required)
terraform scan results:
Passed checks: 162, Failed checks: 0, Skipped checks: 62
checkov_exitcode=0
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.9.1)
tflint will check the following folders:
terraform/environments/analytical-platform-ingestion
*****************************
Running tflint in terraform/environments/analytical-platform-ingestion
Excluding the following checks: terraform_unused_declarations
tflint_exitcode=0
Trivy Scan Failed
Show Output
*****************************
Trivy will check the following folders:
terraform/environments/analytical-platform-ingestion
*****************************
Running Trivy in terraform/environments/analytical-platform-ingestion
2024-10-23T16:22:46Z INFO [vulndb] Need to update DB
2024-10-23T16:22:46Z INFO [vulndb] Downloading vulnerability DB...2024-10-23T16:22:46Z INFO [vulndb] Downloading artifact...repo="ghcr.io/aquasecurity/trivy-db:2"2024-10-23T16:22:46Z ERROR [vulndb] Failed to download artifact repo="ghcr.io/aquasecurity/trivy-db:2"err="OCI repository error: 1 error occurred:\n\t* GET https://ghcr.io/v2/aquasecurity/trivy-db/manifests/2: TOOMANYREQUESTS: retry-after: 813.037µs, allowed: 44000/minute\n\n"2024-10-23T16:22:46Z FATAL Fatal error init error: DB error: failed to download vulnerability DB: OCI artifact error: failed to download vulnerability DB: failed to download artifact from any source
trivy_exitcode=1
Trivy will check the following folders:
terraform/environments/analytical-platform-ingestion
Running Trivy in terraform/environments/analytical-platform-ingestion
2024-10-28T12:56:17Z INFO [vulndb] Need to update DB
2024-10-28T12:56:17Z INFO [vulndb] Downloading vulnerability DB...
2024-10-28T12:56:17Z INFO [vulndb] Downloading artifact... repo="public.ecr.aws/aquasecurity/trivy-db:2"
2024-10-28T12:56:19Z INFO [vulndb] Artifact successfully downloaded repo="public.ecr.aws/aquasecurity/trivy-db:2"
2024-10-28T12:56:19Z INFO [vuln] Vulnerability scanning is enabled
2024-10-28T12:56:19Z INFO [misconfig] Misconfiguration scanning is enabled
2024-10-28T12:56:19Z INFO [misconfig] Need to update the built-in checks
2024-10-28T12:56:19Z INFO [misconfig] Downloading the built-in checks...
156.02 KiB / 156.02 KiB [---------------------------------------------------------] 100.00% ? p/s 0s2024-10-28T12:56:19Z INFO [secret] Secret scanning is enabled
2024-10-28T12:56:19Z INFO [secret] If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-10-28T12:56:19Z INFO [secret] Please see also https://aquasecurity.github.io/trivy/v0.56/docs/scanner/secret#recommendation for faster secret detection
2024-10-28T12:56:20Z INFO [terraform scanner] Scanning root module file_path="."
2024-10-28T12:56:20Z WARN [terraform parser] Variable values was not found in the environment or variable files. Evaluating may not work correctly. module="root" variables="networking"
2024-10-28T12:56:20Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.connected_vpc_transit_gateway_routes" value="cty.NilVal"
2024-10-28T12:56:20Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.sftp_users" value="cty.NilVal"
2024-10-28T12:56:20Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.sftp_users_with_egress" value="cty.NilVal"
2024-10-28T12:56:24Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.bold_egress_bucket.dynamic.rule" value="cty.NilVal"
2024-10-28T12:56:24Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.bold_egress_bucket.dynamic.rule" value="cty.NilVal"
2024-10-28T12:56:24Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.vpc_config" value="cty.NilVal"
2024-10-28T12:56:24Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.logging_config" value="cty.NilVal"
2024-10-28T12:56:24Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.vpc_config" value="cty.NilVal"
2024-10-28T12:56:24Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.logging_config" value="cty.NilVal"
2024-10-28T12:56:24Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.vpc_config" value="cty.NilVal"
2024-10-28T12:56:24Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.logging_config" value="cty.NilVal"
2024-10-28T12:56:24Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.vpc_config" value="cty.NilVal"
2024-10-28T12:56:24Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.logging_config" value="cty.NilVal"
2024-10-28T12:56:24Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definitions_bucket.dynamic.rule" value="cty.NilVal"
2024-10-28T12:56:24Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definitions_bucket.dynamic.rule" value="cty.NilVal"
2024-10-28T12:56:24Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.vpc_config" value="cty.NilVal"
2024-10-28T12:56:24Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.logging_config" value="cty.NilVal"
2024-10-28T12:56:24Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.vpc_config" value="cty.NilVal"
2024-10-28T12:56:24Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.definition_upload_lambda.dynamic.logging_config" value="cty.NilVal"
2024-10-28T12:56:25Z INFO [terraform executor] Ignore finding rule="aws-s3-encryption-customer-key" range="git::https:/github.com/terraform-aws-modules/terraform-aws-s3-bucket?ref=d8ad14f2da0179178030c8876de84458aa7495e9/main.tf:176-198"
2024-10-28T12:56:25Z INFO [terraform executor] Ignore finding rule="aws-s3-enable-bucket-encryption" range="git::https:/github.com/terraform-aws-modules/terraform-aws-s3-bucket?ref=d8ad14f2da0179178030c8876de84458aa7495e9/main.tf:176-198"
2024-10-28T12:56:25Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-public-egress-sgr" range="terraform-aws-modules/security-group/aws/main.tf:533"
2024-10-28T12:56:25Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-public-egress-sgr" range="terraform-aws-modules/security-group/aws/main.tf:534"
2024-10-28T12:56:25Z INFO Number of language-specific files num=0
2024-10-28T12:56:25Z INFO Detected config files num=14
HIGH: Load balancer is exposed publicly.
════════════════════════════════════════
There are many scenarios in which you would want to expose a load balancer to the wider internet, but this check exists as a warning to prevent accidental exposure of internal assets. You should ensure that this resource should be exposed publicly.
See https://avd.aquasec.com/misconfig/avd-aws-0053
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-alb?ref=349540d1a611cd98a6383cc64ef0d9bf08d88fb7/main.tf:47
via git::https:/github.com/terraform-aws-modules/terraform-aws-alb?ref=349540d1a611cd98a6383cc64ef0d9bf08d88fb7/main.tf:12-81 (aws_lb.this[0])
via network-load-balancers.tf:1-37 (module.datasync_activation_nlb)
────────────────────────────────────────
12 resource "aws_lb" "this" {
..
47 [ internal = var.internal
..
81 }
────────────────────────────────────────
CRITICAL: Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:340
via git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:328-343 (aws_network_acl_rule.private_outbound[0])
via vpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
328 resource "aws_network_acl_rule" "private_outbound" {
...
340 [ protocol = var.private_outbound_acl_rules[count.index]["protocol"]
...
343 }
────────────────────────────────────────
CRITICAL: Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:323
via git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:311-326 (aws_network_acl_rule.private_inbound[0])
via vpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
311 resource "aws_network_acl_rule" "private_inbound" {
...
323 [ protocol = var.private_inbound_acl_rules[count.index]["protocol"]
...
326 }
────────────────────────────────────────
CRITICAL: Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:221
via git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:209-224 (aws_network_acl_rule.public_outbound[0])
via vpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
209 resource "aws_network_acl_rule" "public_outbound" {
...
221 [ protocol = var.public_outbound_acl_rules[count.index]["protocol"]
...
224 }
────────────────────────────────────────
CRITICAL: Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:204
via git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:192-207 (aws_network_acl_rule.public_inbound[0])
via vpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
192 resource "aws_network_acl_rule" "public_inbound" {
...
204 [ protocol = var.public_inbound_acl_rules[count.index]["protocol"]
...
207 }
────────────────────────────────────────
CRITICAL: Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:340
via terraform-aws-modules/vpc/aws/main.tf:328-343 (aws_network_acl_rule.private_outbound[0])
via vpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
328 resource "aws_network_acl_rule" "private_outbound" {
...
340 [ protocol = var.private_outbound_acl_rules[count.index]["protocol"]
...
343 }
────────────────────────────────────────
CRITICAL: Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:323
via terraform-aws-modules/vpc/aws/main.tf:311-326 (aws_network_acl_rule.private_inbound[0])
via vpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
311 resource "aws_network_acl_rule" "private_inbound" {
...
323 [ protocol = var.private_inbound_acl_rules[count.index]["protocol"]
...
326 }
────────────────────────────────────────
CRITICAL: Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:221
via terraform-aws-modules/vpc/aws/main.tf:209-224 (aws_network_acl_rule.public_outbound[0])
via vpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
209 resource "aws_network_acl_rule" "public_outbound" {
...
221 [ protocol = var.public_outbound_acl_rules[count.index]["protocol"]
...
224 }
────────────────────────────────────────
CRITICAL: Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:204
via terraform-aws-modules/vpc/aws/main.tf:192-207 (aws_network_acl_rule.public_inbound[0])
via vpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
192 resource "aws_network_acl_rule" "public_inbound" {
...
204 [ protocol = var.public_inbound_acl_rules[count.index]["protocol"]
...
207 }
────────────────────────────────────────
trivy_exitcode=1
</details> #### `Checkov Scan` Failed
<details><summary>Show Output</summary>
```hcl
*****************************
Checkov will check the following folders:
terraform/environments/analytical-platform-ingestion
*****************************
Running Checkov in terraform/environments/analytical-platform-ingestion
Excluding the following checks: CKV_GIT_1,CKV_AWS_126,CKV2_AWS_38,CKV2_AWS_39
2024-10-28 12:56:28,253 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/cloudwatch/aws//modules/log-group:5.6.0 (for external modules, the --download-external-modules flag is required)
2024-10-28 12:56:28,253 [MainThread ] [WARNI] Failed to download module ministryofjustice/observability-platform-tenant/aws:1.2.0 (for external modules, the --download-external-modules flag is required)
2024-10-28 12:56:28,253 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/kms/aws:3.1.0 (for external modules, the --download-external-modules flag is required)
2024-10-28 12:56:28,253 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/route53/aws//modules/resolver-rule-associations:4.1.0 (for external modules, the --download-external-modules flag is required)
2024-10-28 12:56:28,253 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/secrets-manager/aws:1.3.1 (for external modules, the --download-external-modules flag is required)
2024-10-28 12:56:28,253 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/sns/aws:6.1.0 (for external modules, the --download-external-modules flag is required)
2024-10-28 12:56:28,254 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/vpc/aws//modules/vpc-endpoints:5.13.0 (for external modules, the --download-external-modules flag is required)
2024-10-28 12:56:28,254 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/route53/aws//modules/resolver-endpoints:4.1.0 (for external modules, the --download-external-modules flag is required)
2024-10-28 12:56:28,254 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/lambda/aws:7.9.0 (for external modules, the --download-external-modules flag is required)
2024-10-28 12:56:28,254 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/vpc/aws:5.13.0 (for external modules, the --download-external-modules flag is required)
2024-10-28 12:56:28,254 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/iam/aws//modules/iam-assumable-role:5.44.1 (for external modules, the --download-external-modules flag is required)
2024-10-28 12:56:28,254 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/s3-bucket/aws:4.2.1 (for external modules, the --download-external-modules flag is required)
2024-10-28 12:56:28,255 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/security-group/aws:5.2.0 (for external modules, the --download-external-modules flag is required)
2024-10-28 12:56:28,255 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/alb/aws:9.11.0 (for external modules, the --download-external-modules flag is required)
2024-10-28 12:56:28,255 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/s3-bucket/aws//modules/notification:4.2.1 (for external modules, the --download-external-modules flag is required)
2024-10-28 12:56:28,255 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/iam/aws//modules/iam-policy:5.44.1 (for external modules, the --download-external-modules flag is required)
2024-10-28 12:56:28,255 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/ec2-instance/aws:5.7.0 (for external modules, the --download-external-modules flag is required)
terraform scan results:
Passed checks: 167, Failed checks: 2, Skipped checks: 65
Check: CKV_TF_1: "Ensure Terraform module sources use a commit hash"
FAILED for resource: connected_vpc_route53_resolver_associations
File: /route53-resolver-associations.tf:1-13
Guide: https://docs.prismacloud.io/en/enterprise-edition/policy-reference/supply-chain-policies/terraform-policies/ensure-terraform-module-sources-use-git-url-with-commit-hash-revision
1 | module "connected_vpc_route53_resolver_associations" {
2 |
3 | source = "terraform-aws-modules/route53/aws//modules/resolver-rule-associations"
4 | version = "4.1.0"
5 |
6 | vpc_id = module.connected_vpc.vpc_id
7 |
8 | resolver_rule_associations = {
9 | mojo-dns-resolver-dom1-infra-int = {
10 | resolver_rule_id = aws_route53_resolver_rule.mojo_dns_resolver_dom1_infra_int.id
11 | }
12 | }
13 | }
Check: CKV_TF_1: "Ensure Terraform module sources use a commit hash"
FAILED for resource: connected_vpc_outbound_route53_resolver_endpoint
File: /route53-resolver-endpoints.tf:1-27
Guide: https://docs.prismacloud.io/en/enterprise-edition/policy-reference/supply-chain-policies/terraform-policies/ensure-terraform-module-sources-use-git-url-with-commit-hash-revision
1 | module "connected_vpc_outbound_route53_resolver_endpoint" {
2 | source = "terraform-aws-modules/route53/aws//modules/resolver-endpoints"
3 | version = "4.1.0"
4 |
5 | name = "connected-vpc-outbound"
6 | vpc_id = module.connected_vpc.vpc_id
7 | direction = "OUTBOUND"
8 | protocols = ["Do53"]
9 |
10 | ip_address = [
11 | {
12 | subnet_id = module.connected_vpc.private_subnets[0]
13 | },
14 | {
15 | subnet_id = module.connected_vpc.private_subnets[1]
16 | }
17 | ]
18 |
19 | security_group_ingress_cidr_blocks = [module.connected_vpc.vpc_cidr_block]
20 | security_group_egress_cidr_blocks = [
21 | /* MoJO DNS Resolver Service */
22 | "10.180.80.5/32",
23 | "10.180.81.5/32"
24 | ]
25 |
26 | tags = local.tags
27 | }
checkov_exitcode=1
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.9.1)
tflint will check the following folders:
terraform/environments/analytical-platform-ingestion
*****************************
Running tflint in terraform/environments/analytical-platform-ingestion
Excluding the following checks: terraform_unused_declarations
tflint_exitcode=0
Trivy Scan Failed
Show Output
*****************************
Trivy will check the following folders:
terraform/environments/analytical-platform-ingestion
*****************************
Running Trivy in terraform/environments/analytical-platform-ingestion
2024-10-28T12:56:17Z INFO [vulndb] Need to update DB
2024-10-28T12:56:17Z INFO [vulndb] Downloading vulnerability DB...2024-10-28T12:56:17Z INFO [vulndb] Downloading artifact...repo="public.ecr.aws/aquasecurity/trivy-db:2"2024-10-28T12:56:19Z INFO [vulndb] Artifact successfully downloaded repo="public.ecr.aws/aquasecurity/trivy-db:2"2024-10-28T12:56:19Z INFO [vuln] Vulnerability scanning is enabled
2024-10-28T12:56:19Z INFO [misconfig] Misconfiguration scanning is enabled
2024-10-28T12:56:19Z INFO [misconfig] Need to update the built-in checks
2024-10-28T12:56:19Z INFO [misconfig] Downloading the built-in checks...156.02 KiB /156.02 KiB [---------------------------------------------------------] 100.00%? p/s 0s2024-10-28T12:56:19Z INFO [secret] Secret scanning is enabled
2024-10-28T12:56:19Z INFO [secret] If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-10-28T12:56:19Z INFO [secret] Please see also https://aquasecurity.github.io/trivy/v0.56/docs/scanner/secret#recommendation for faster secret detection2024-10-28T12:56:20Z INFO [terraformscanner] Scanning root module file_path="."2024-10-28T12:56:20Z WARN [terraformparser] Variable values was not found in the environment or variable files. Evaluating may not work correctly.module="root"variables="networking"2024-10-28T12:56:20Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.connected_vpc_transit_gateway_routes"value="cty.NilVal"2024-10-28T12:56:20Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.sftp_users"value="cty.NilVal"2024-10-28T12:56:20Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.sftp_users_with_egress"value="cty.NilVal"2024-10-28T12:56:24Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.bold_egress_bucket.dynamic.rule"value="cty.NilVal"2024-10-28T12:56:24Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.bold_egress_bucket.dynamic.rule"value="cty.NilVal"2024-10-28T12:56:24Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.vpc_config"value="cty.NilVal"2024-10-28T12:56:24Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.logging_config"value="cty.NilVal"2024-10-28T12:56:24Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.vpc_config"value="cty.NilVal"2024-10-28T12:56:24Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.logging_config"value="cty.NilVal"2024-10-28T12:56:24Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.vpc_config"value="cty.NilVal"2024-10-28T12:56:24Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.logging_config"value="cty.NilVal"2024-10-28T12:56:24Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.vpc_config"value="cty.NilVal"2024-10-28T12:56:24Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.logging_config"value="cty.NilVal"2024-10-28T12:56:24Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definitions_bucket.dynamic.rule"value="cty.NilVal"2024-10-28T12:56:24Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definitions_bucket.dynamic.rule"value="cty.NilVal"2024-10-28T12:56:24Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.vpc_config"value="cty.NilVal"2024-10-28T12:56:24Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.logging_config"value="cty.NilVal"2024-10-28T12:56:24Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.vpc_config"value="cty.NilVal"2024-10-28T12:56:24Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.definition_upload_lambda.dynamic.logging_config"value="cty.NilVal"2024-10-28T12:56:25Z INFO [terraformexecutor] Ignore finding rule="aws-s3-encryption-customer-key"range="git::https:/github.com/terraform-aws-modules/terraform-aws-s3-bucket?ref=d8ad14f2da0179178030c8876de84458aa7495e9/main.tf:176-198"2024-10-28T12:56:25Z INFO [terraformexecutor] Ignore finding rule="aws-s3-enable-bucket-encryption"range="git::https:/github.com/terraform-aws-modules/terraform-aws-s3-bucket?ref=d8ad14f2da0179178030c8876de84458aa7495e9/main.tf:176-198"2024-10-28T12:56:25Z INFO [terraformexecutor] Ignore finding rule="aws-ec2-no-public-egress-sgr"range="terraform-aws-modules/security-group/aws/main.tf:533"2024-10-28T12:56:25Z INFO [terraformexecutor] Ignore finding rule="aws-ec2-no-public-egress-sgr"range="terraform-aws-modules/security-group/aws/main.tf:534"2024-10-28T12:56:25Z INFO Number of language-specific files num=02024-10-28T12:56:25Z INFO Detected config files num=14
git::https:/github.com/terraform-aws-modules/terraform-aws-alb?ref=349540d1a611cd98a6383cc64ef0d9bf08d88fb7/main.tf (terraform)
===============================================================================================================================
Tests:1 (SUCCESSES:0, FAILURES:1, EXCEPTIONS:0)
Failures:1 (HIGH:1, CRITICAL:0)
HIGH: Load balancer is exposed publicly.
════════════════════════════════════════
There are many scenarios in which you would want to expose a load balancer to the wider internet, but this check exists as a warning to prevent accidental exposure of internal assets. You should ensure that this resource should be exposed publicly.
See https://avd.aquasec.com/misconfig/avd-aws-0053
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-alb?ref=349540d1a611cd98a6383cc64ef0d9bf08d88fb7/main.tf:47
via git::https:/github.com/terraform-aws-modules/terraform-aws-alb?ref=349540d1a611cd98a6383cc64ef0d9bf08d88fb7/main.tf:12-81 (aws_lb.this[0])
via network-load-balancers.tf:1-37 (module.datasync_activation_nlb)
────────────────────────────────────────
12 resource"aws_lb""this" {
..47 [ internal = var.internal..81 }
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf (terraform)
===============================================================================================================================
Tests:4 (SUCCESSES:0, FAILURES:4, EXCEPTIONS:0)
Failures:4 (HIGH:0, CRITICAL:4)
CRITICAL:NetworkACLruleallowsaccessusingALLports.
════════════════════════════════════════
Ensureaccesstospecificrequiredportsisallowed, andnothingelse.Seehttps://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:340viagit::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:328-343 (aws_network_acl_rule.private_outbound[0])
viavpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
328resource"aws_network_acl_rule""private_outbound" {
...340 [ protocol = var.private_outbound_acl_rules[count.index]["protocol"]
...343 }
────────────────────────────────────────
CRITICAL:NetworkACLruleallowsaccessusingALLports.
════════════════════════════════════════
Ensureaccesstospecificrequiredportsisallowed, andnothingelse.Seehttps://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:323viagit::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:311-326 (aws_network_acl_rule.private_inbound[0])
viavpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
311resource"aws_network_acl_rule""private_inbound" {
...323 [ protocol = var.private_inbound_acl_rules[count.index]["protocol"]
...326 }
────────────────────────────────────────
CRITICAL:NetworkACLruleallowsaccessusingALLports.
════════════════════════════════════════
Ensureaccesstospecificrequiredportsisallowed, andnothingelse.Seehttps://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:221viagit::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:209-224 (aws_network_acl_rule.public_outbound[0])
viavpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
209resource"aws_network_acl_rule""public_outbound" {
...221 [ protocol = var.public_outbound_acl_rules[count.index]["protocol"]
...224 }
────────────────────────────────────────
CRITICAL:NetworkACLruleallowsaccessusingALLports.
════════════════════════════════════════
Ensureaccesstospecificrequiredportsisallowed, andnothingelse.Seehttps://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:204viagit::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:192-207 (aws_network_acl_rule.public_inbound[0])
viavpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
192resource"aws_network_acl_rule""public_inbound" {
...204 [ protocol = var.public_inbound_acl_rules[count.index]["protocol"]
...207 }
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf (terraform)
=================================================
Tests:4 (SUCCESSES:0, FAILURES:4, EXCEPTIONS:0)
Failures:4 (HIGH:0, CRITICAL:4)
CRITICAL:NetworkACLruleallowsaccessusingALLports.
════════════════════════════════════════
Ensureaccesstospecificrequiredportsisallowed, andnothingelse.Seehttps://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:340viaterraform-aws-modules/vpc/aws/main.tf:328-343 (aws_network_acl_rule.private_outbound[0])
viavpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
328resource"aws_network_acl_rule""private_outbound" {
...340 [ protocol = var.private_outbound_acl_rules[count.index]["protocol"]
...343 }
────────────────────────────────────────
CRITICAL:NetworkACLruleallowsaccessusingALLports.
════════════════════════════════════════
Ensureaccesstospecificrequiredportsisallowed, andnothingelse.Seehttps://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:323viaterraform-aws-modules/vpc/aws/main.tf:311-326 (aws_network_acl_rule.private_inbound[0])
viavpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
311resource"aws_network_acl_rule""private_inbound" {
...323 [ protocol = var.private_inbound_acl_rules[count.index]["protocol"]
...326 }
────────────────────────────────────────
CRITICAL:NetworkACLruleallowsaccessusingALLports.
════════════════════════════════════════
Ensureaccesstospecificrequiredportsisallowed, andnothingelse.Seehttps://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:221viaterraform-aws-modules/vpc/aws/main.tf:209-224 (aws_network_acl_rule.public_outbound[0])
viavpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
209resource"aws_network_acl_rule""public_outbound" {
...221 [ protocol = var.public_outbound_acl_rules[count.index]["protocol"]
...224 }
────────────────────────────────────────
CRITICAL:NetworkACLruleallowsaccessusingALLports.
════════════════════════════════════════
Ensureaccesstospecificrequiredportsisallowed, andnothingelse.Seehttps://avd.aquasec.com/misconfig/avd-aws-0102
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:204viaterraform-aws-modules/vpc/aws/main.tf:192-207 (aws_network_acl_rule.public_inbound[0])
viavpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
192resource"aws_network_acl_rule""public_inbound" {
...204 [ protocol = var.public_inbound_acl_rules[count.index]["protocol"]
...207 }
────────────────────────────────────────
trivy_exitcode=1
Trivy will check the following folders:
terraform/environments/analytical-platform-ingestion
Running Trivy in terraform/environments/analytical-platform-ingestion
2024-11-04T09:13:07Z INFO [vulndb] Need to update DB
2024-11-04T09:13:07Z INFO [vulndb] Downloading vulnerability DB...
2024-11-04T09:13:07Z INFO [vulndb] Downloading artifact... repo="public.ecr.aws/aquasecurity/trivy-db:2"
2024-11-04T09:13:10Z INFO [vulndb] Artifact successfully downloaded repo="public.ecr.aws/aquasecurity/trivy-db:2"
2024-11-04T09:13:10Z INFO [vuln] Vulnerability scanning is enabled
2024-11-04T09:13:10Z INFO [misconfig] Misconfiguration scanning is enabled
2024-11-04T09:13:10Z INFO [misconfig] Need to update the built-in checks
2024-11-04T09:13:10Z INFO [misconfig] Downloading the built-in checks...
2024-11-04T09:13:10Z ERROR [misconfig] Falling back to embedded checks err="failed to download built-in policies: download error: OCI repository error: 1 error occurred:\n\t* GET https://ghcr.io/v2/aquasecurity/trivy-checks/manifests/1: TOOMANYREQUESTS: retry-after: 436.097µs, allowed: 44000/minute\n\n"
2024-11-04T09:13:10Z INFO [secret] Secret scanning is enabled
2024-11-04T09:13:10Z INFO [secret] If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-11-04T09:13:10Z INFO [secret] Please see also https://aquasecurity.github.io/trivy/v0.57/docs/scanner/secret#recommendation for faster secret detection
2024-11-04T09:13:11Z INFO [terraform scanner] Scanning root module file_path="."
2024-11-04T09:13:11Z WARN [terraform parser] Variable values was not found in the environment or variable files. Evaluating may not work correctly. module="root" variables="networking"
2024-11-04T09:13:11Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.connected_vpc_transit_gateway_routes" value="cty.NilVal"
2024-11-04T09:13:11Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.sftp_users" value="cty.NilVal"
2024-11-04T09:13:11Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.sftp_users_with_egress" value="cty.NilVal"
2024-11-04T09:13:21Z ERROR [terraform evaluator] Failed to expand dynamic block. block="module.bold_egress_bucket.aws_s3_bucket_server_side_encryption_configuration.this[0]" err="1 error occurred:\n\t* invalid for-each in aws_s3_bucket_server_side_encryption_configuration.this[0].dynamic.rule block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\n"
2024-11-04T09:13:21Z ERROR [terraform evaluator] Failed to expand dynamic block. block="module.bold_egress_bucket.aws_s3_bucket_server_side_encryption_configuration.this[0]" err="1 error occurred:\n\t* invalid for-each in aws_s3_bucket_server_side_encryption_configuration.this[0].dynamic.rule block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\n"
2024-11-04T09:13:21Z ERROR [terraform evaluator] Failed to expand dynamic block. block="module.definition_upload_lambda.aws_lambda_function.this[0]" err="2 errors occurred:\n\t* invalid for-each in aws_lambda_function.this[0].dynamic.vpc_config block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\t* invalid for-each in aws_lambda_function.this[0].dynamic.logging_config block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\n"
2024-11-04T09:13:21Z ERROR [terraform evaluator] Failed to expand dynamic block. block="module.definition_upload_lambda.aws_lambda_function.this[0]" err="2 errors occurred:\n\t* invalid for-each in aws_lambda_function.this[0].dynamic.vpc_config block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\t* invalid for-each in aws_lambda_function.this[0].dynamic.logging_config block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\n"
2024-11-04T09:13:21Z ERROR [terraform evaluator] Failed to expand dynamic block. block="module.definition_upload_lambda.aws_lambda_function.this[0]" err="2 errors occurred:\n\t* invalid for-each in aws_lambda_function.this[0].dynamic.vpc_config block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\t* invalid for-each in aws_lambda_function.this[0].dynamic.logging_config block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\n"
2024-11-04T09:13:21Z ERROR [terraform evaluator] Failed to expand dynamic block. block="module.definition_upload_lambda.aws_lambda_function.this[0]" err="2 errors occurred:\n\t* invalid for-each in aws_lambda_function.this[0].dynamic.vpc_config block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\t* invalid for-each in aws_lambda_function.this[0].dynamic.logging_config block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\n"
2024-11-04T09:13:21Z ERROR [terraform evaluator] Failed to expand dynamic block. block="module.definitions_bucket.aws_s3_bucket_server_side_encryption_configuration.this[0]" err="1 error occurred:\n\t* invalid for-each in aws_s3_bucket_server_side_encryption_configuration.this[0].dynamic.rule block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\n"
2024-11-04T09:13:21Z ERROR [terraform evaluator] Failed to expand dynamic block. block="module.definitions_bucket.aws_s3_bucket_server_side_encryption_configuration.this[0]" err="1 error occurred:\n\t* invalid for-each in aws_s3_bucket_server_side_encryption_configuration.this[0].dynamic.rule block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\n"
2024-11-04T09:13:21Z ERROR [terraform evaluator] Failed to expand dynamic block. block="module.definition_upload_lambda.aws_lambda_function.this[0]" err="2 errors occurred:\n\t* invalid for-each in aws_lambda_function.this[0].dynamic.vpc_config block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\t* invalid for-each in aws_lambda_function.this[0].dynamic.logging_config block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\n"
2024-11-04T09:13:21Z ERROR [terraform evaluator] Failed to expand dynamic block. block="module.definition_upload_lambda.aws_lambda_function.this[0]" err="2 errors occurred:\n\t* invalid for-each in aws_lambda_function.this[0].dynamic.vpc_config block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\t* invalid for-each in aws_lambda_function.this[0].dynamic.logging_config block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\n"
2024-11-04T09:13:23Z INFO [terraform executor] Ignore finding rule="aws-s3-enable-bucket-encryption" range="git::https:/github.com/terraform-aws-modules/terraform-aws-s3-bucket?ref=d8ad14f2da0179178030c8876de84458aa7495e9/main.tf:176-198"
2024-11-04T09:13:23Z INFO [terraform executor] Ignore finding rule="aws-s3-encryption-customer-key" range="git::https:/github.com/terraform-aws-modules/terraform-aws-s3-bucket?ref=d8ad14f2da0179178030c8876de84458aa7495e9/main.tf:176-198"
2024-11-04T09:13:23Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-public-egress-sgr" range="terraform-aws-modules/security-group/aws/main.tf:533"
2024-11-04T09:13:23Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-public-egress-sgr" range="terraform-aws-modules/security-group/aws/main.tf:534"
2024-11-04T09:13:23Z INFO Number of language-specific files num=0
2024-11-04T09:13:23Z INFO Detected config files num=10
AVD-AWS-0053 (HIGH): Load balancer is exposed publicly.
════════════════════════════════════════
There are many scenarios in which you would want to expose a load balancer to the wider internet, but this check exists as a warning to prevent accidental exposure of internal assets. You should ensure that this resource should be exposed publicly.
AVD-AWS-0102 (CRITICAL): Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/aws-vpc-no-excessive-port-access
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:340
via git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:328-343 (aws_network_acl_rule.private_outbound[0])
via vpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
328 resource "aws_network_acl_rule" "private_outbound" {
...
340 [ protocol = var.private_outbound_acl_rules[count.index]["protocol"]
...
343 }
────────────────────────────────────────
AVD-AWS-0102 (CRITICAL): Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/aws-vpc-no-excessive-port-access
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:323
via git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:311-326 (aws_network_acl_rule.private_inbound[0])
via vpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
311 resource "aws_network_acl_rule" "private_inbound" {
...
323 [ protocol = var.private_inbound_acl_rules[count.index]["protocol"]
...
326 }
────────────────────────────────────────
AVD-AWS-0102 (CRITICAL): Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/aws-vpc-no-excessive-port-access
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:221
via git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:209-224 (aws_network_acl_rule.public_outbound[0])
via vpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
209 resource "aws_network_acl_rule" "public_outbound" {
...
221 [ protocol = var.public_outbound_acl_rules[count.index]["protocol"]
...
224 }
────────────────────────────────────────
AVD-AWS-0102 (CRITICAL): Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/aws-vpc-no-excessive-port-access
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:204
via git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:192-207 (aws_network_acl_rule.public_inbound[0])
via vpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
192 resource "aws_network_acl_rule" "public_inbound" {
...
204 [ protocol = var.public_inbound_acl_rules[count.index]["protocol"]
...
207 }
────────────────────────────────────────
AVD-AWS-0102 (CRITICAL): Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/aws-vpc-no-excessive-port-access
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:340
via terraform-aws-modules/vpc/aws/main.tf:328-343 (aws_network_acl_rule.private_outbound[0])
via vpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
328 resource "aws_network_acl_rule" "private_outbound" {
...
340 [ protocol = var.private_outbound_acl_rules[count.index]["protocol"]
...
343 }
────────────────────────────────────────
AVD-AWS-0102 (CRITICAL): Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/aws-vpc-no-excessive-port-access
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:323
via terraform-aws-modules/vpc/aws/main.tf:311-326 (aws_network_acl_rule.private_inbound[0])
via vpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
311 resource "aws_network_acl_rule" "private_inbound" {
...
323 [ protocol = var.private_inbound_acl_rules[count.index]["protocol"]
...
326 }
────────────────────────────────────────
AVD-AWS-0102 (CRITICAL): Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/aws-vpc-no-excessive-port-access
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:221
via terraform-aws-modules/vpc/aws/main.tf:209-224 (aws_network_acl_rule.public_outbound[0])
via vpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
209 resource "aws_network_acl_rule" "public_outbound" {
...
221 [ protocol = var.public_outbound_acl_rules[count.index]["protocol"]
...
224 }
────────────────────────────────────────
AVD-AWS-0102 (CRITICAL): Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/aws-vpc-no-excessive-port-access
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:204
via terraform-aws-modules/vpc/aws/main.tf:192-207 (aws_network_acl_rule.public_inbound[0])
via vpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
192 resource "aws_network_acl_rule" "public_inbound" {
...
204 [ protocol = var.public_inbound_acl_rules[count.index]["protocol"]
...
207 }
────────────────────────────────────────
trivy_exitcode=1
</details> #### `Checkov Scan` Failed
<details><summary>Show Output</summary>
```hcl
*****************************
Checkov will check the following folders:
terraform/environments/analytical-platform-ingestion
*****************************
Running Checkov in terraform/environments/analytical-platform-ingestion
Excluding the following checks: CKV_GIT_1,CKV_AWS_126,CKV2_AWS_38,CKV2_AWS_39
2024-11-04 09:13:26,052 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/cloudwatch/aws//modules/log-group:5.6.0 (for external modules, the --download-external-modules flag is required)
2024-11-04 09:13:26,052 [MainThread ] [WARNI] Failed to download module ministryofjustice/observability-platform-tenant/aws:1.2.0 (for external modules, the --download-external-modules flag is required)
2024-11-04 09:13:26,052 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/kms/aws:3.1.0 (for external modules, the --download-external-modules flag is required)
2024-11-04 09:13:26,052 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/route53/aws//modules/resolver-rule-associations:4.1.0 (for external modules, the --download-external-modules flag is required)
2024-11-04 09:13:26,052 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/secrets-manager/aws:1.3.1 (for external modules, the --download-external-modules flag is required)
2024-11-04 09:13:26,053 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/sns/aws:6.1.0 (for external modules, the --download-external-modules flag is required)
2024-11-04 09:13:26,053 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/vpc/aws//modules/vpc-endpoints:5.13.0 (for external modules, the --download-external-modules flag is required)
2024-11-04 09:13:26,053 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/route53/aws//modules/resolver-endpoints:4.1.0 (for external modules, the --download-external-modules flag is required)
2024-11-04 09:13:26,053 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/lambda/aws:7.9.0 (for external modules, the --download-external-modules flag is required)
2024-11-04 09:13:26,053 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/vpc/aws:5.13.0 (for external modules, the --download-external-modules flag is required)
2024-11-04 09:13:26,053 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/iam/aws//modules/iam-assumable-role:5.44.1 (for external modules, the --download-external-modules flag is required)
2024-11-04 09:13:26,054 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/s3-bucket/aws:4.2.1 (for external modules, the --download-external-modules flag is required)
2024-11-04 09:13:26,054 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/security-group/aws:5.2.0 (for external modules, the --download-external-modules flag is required)
2024-11-04 09:13:26,054 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/alb/aws:9.11.0 (for external modules, the --download-external-modules flag is required)
2024-11-04 09:13:26,054 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/s3-bucket/aws//modules/notification:4.2.1 (for external modules, the --download-external-modules flag is required)
2024-11-04 09:13:26,054 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/iam/aws//modules/iam-policy:5.44.1 (for external modules, the --download-external-modules flag is required)
2024-11-04 09:13:26,054 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/ec2-instance/aws:5.7.0 (for external modules, the --download-external-modules flag is required)
2024-11-04 09:13:26,071 [MainThread ] [WARNI] [ArmLocalGraph] created 0 vertices
2024-11-04 09:13:26,076 [MainThread ] [WARNI] [ArmLocalGraph] created 0 edges
terraform scan results:
Passed checks: 167, Failed checks: 2, Skipped checks: 65
Check: CKV_TF_1: "Ensure Terraform module sources use a commit hash"
FAILED for resource: connected_vpc_route53_resolver_associations
File: /route53-resolver-associations.tf:1-13
Guide: https://docs.prismacloud.io/en/enterprise-edition/policy-reference/supply-chain-policies/terraform-policies/ensure-terraform-module-sources-use-git-url-with-commit-hash-revision
1 | module "connected_vpc_route53_resolver_associations" {
2 |
3 | source = "terraform-aws-modules/route53/aws//modules/resolver-rule-associations"
4 | version = "4.1.0"
5 |
6 | vpc_id = module.connected_vpc.vpc_id
7 |
8 | resolver_rule_associations = {
9 | mojo-dns-resolver-dom1-infra-int = {
10 | resolver_rule_id = aws_route53_resolver_rule.mojo_dns_resolver_dom1_infra_int.id
11 | }
12 | }
13 | }
Check: CKV_TF_1: "Ensure Terraform module sources use a commit hash"
FAILED for resource: connected_vpc_outbound_route53_resolver_endpoint
File: /route53-resolver-endpoints.tf:1-27
Guide: https://docs.prismacloud.io/en/enterprise-edition/policy-reference/supply-chain-policies/terraform-policies/ensure-terraform-module-sources-use-git-url-with-commit-hash-revision
1 | module "connected_vpc_outbound_route53_resolver_endpoint" {
2 | source = "terraform-aws-modules/route53/aws//modules/resolver-endpoints"
3 | version = "4.1.0"
4 |
5 | name = "connected-vpc-outbound"
6 | vpc_id = module.connected_vpc.vpc_id
7 | direction = "OUTBOUND"
8 | protocols = ["Do53"]
9 |
10 | ip_address = [
11 | {
12 | subnet_id = module.connected_vpc.private_subnets[0]
13 | },
14 | {
15 | subnet_id = module.connected_vpc.private_subnets[1]
16 | }
17 | ]
18 |
19 | security_group_ingress_cidr_blocks = [module.connected_vpc.vpc_cidr_block]
20 | security_group_egress_cidr_blocks = [
21 | /* MoJO DNS Resolver Service */
22 | "10.180.80.5/32",
23 | "10.180.81.5/32"
24 | ]
25 |
26 | tags = local.tags
27 | }
checkov_exitcode=1
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.9.1)
tflint will check the following folders:
terraform/environments/analytical-platform-ingestion
*****************************
Running tflint in terraform/environments/analytical-platform-ingestion
Excluding the following checks: terraform_unused_declarations
tflint_exitcode=0
Trivy Scan Failed
Show Output
*****************************
Trivy will check the following folders:
terraform/environments/analytical-platform-ingestion
*****************************
Running Trivy in terraform/environments/analytical-platform-ingestion
2024-11-04T09:13:07Z INFO [vulndb] Need to update DB
2024-11-04T09:13:07Z INFO [vulndb] Downloading vulnerability DB...2024-11-04T09:13:07Z INFO [vulndb] Downloading artifact...repo="public.ecr.aws/aquasecurity/trivy-db:2"2024-11-04T09:13:10Z INFO [vulndb] Artifact successfully downloaded repo="public.ecr.aws/aquasecurity/trivy-db:2"2024-11-04T09:13:10Z INFO [vuln] Vulnerability scanning is enabled
2024-11-04T09:13:10Z INFO [misconfig] Misconfiguration scanning is enabled
2024-11-04T09:13:10Z INFO [misconfig] Need to update the built-in checks
2024-11-04T09:13:10Z INFO [misconfig] Downloading the built-in checks...2024-11-04T09:13:10Z ERROR [misconfig] Falling back to embedded checks err="failed to download built-in policies: download error: OCI repository error: 1 error occurred:\n\t* GET https://ghcr.io/v2/aquasecurity/trivy-checks/manifests/1: TOOMANYREQUESTS: retry-after: 436.097µs, allowed: 44000/minute\n\n"2024-11-04T09:13:10Z INFO [secret] Secret scanning is enabled
2024-11-04T09:13:10Z INFO [secret] If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-11-04T09:13:10Z INFO [secret] Please see also https://aquasecurity.github.io/trivy/v0.57/docs/scanner/secret#recommendation for faster secret detection2024-11-04T09:13:11Z INFO [terraformscanner] Scanning root module file_path="."2024-11-04T09:13:11Z WARN [terraformparser] Variable values was not found in the environment or variable files. Evaluating may not work correctly.module="root"variables="networking"2024-11-04T09:13:11Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.connected_vpc_transit_gateway_routes"value="cty.NilVal"2024-11-04T09:13:11Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.sftp_users"value="cty.NilVal"2024-11-04T09:13:11Z ERROR [terraformevaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.block="module.sftp_users_with_egress"value="cty.NilVal"2024-11-04T09:13:21Z ERROR [terraformevaluator] Failed to expand dynamic block.block="module.bold_egress_bucket.aws_s3_bucket_server_side_encryption_configuration.this[0]"err="1 error occurred:\n\t* invalid for-each in aws_s3_bucket_server_side_encryption_configuration.this[0].dynamic.rule block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\n"2024-11-04T09:13:21Z ERROR [terraformevaluator] Failed to expand dynamic block.block="module.bold_egress_bucket.aws_s3_bucket_server_side_encryption_configuration.this[0]"err="1 error occurred:\n\t* invalid for-each in aws_s3_bucket_server_side_encryption_configuration.this[0].dynamic.rule block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\n"2024-11-04T09:13:21Z ERROR [terraformevaluator] Failed to expand dynamic block.block="module.definition_upload_lambda.aws_lambda_function.this[0]"err="2 errors occurred:\n\t* invalid for-each in aws_lambda_function.this[0].dynamic.vpc_config block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\t* invalid for-each in aws_lambda_function.this[0].dynamic.logging_config block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\n"2024-11-04T09:13:21Z ERROR [terraformevaluator] Failed to expand dynamic block.block="module.definition_upload_lambda.aws_lambda_function.this[0]"err="2 errors occurred:\n\t* invalid for-each in aws_lambda_function.this[0].dynamic.vpc_config block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\t* invalid for-each in aws_lambda_function.this[0].dynamic.logging_config block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\n"2024-11-04T09:13:21Z ERROR [terraformevaluator] Failed to expand dynamic block.block="module.definition_upload_lambda.aws_lambda_function.this[0]"err="2 errors occurred:\n\t* invalid for-each in aws_lambda_function.this[0].dynamic.vpc_config block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\t* invalid for-each in aws_lambda_function.this[0].dynamic.logging_config block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\n"2024-11-04T09:13:21Z ERROR [terraformevaluator] Failed to expand dynamic block.block="module.definition_upload_lambda.aws_lambda_function.this[0]"err="2 errors occurred:\n\t* invalid for-each in aws_lambda_function.this[0].dynamic.vpc_config block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\t* invalid for-each in aws_lambda_function.this[0].dynamic.logging_config block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\n"2024-11-04T09:13:21Z ERROR [terraformevaluator] Failed to expand dynamic block.block="module.definitions_bucket.aws_s3_bucket_server_side_encryption_configuration.this[0]"err="1 error occurred:\n\t* invalid for-each in aws_s3_bucket_server_side_encryption_configuration.this[0].dynamic.rule block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\n"2024-11-04T09:13:21Z ERROR [terraformevaluator] Failed to expand dynamic block.block="module.definitions_bucket.aws_s3_bucket_server_side_encryption_configuration.this[0]"err="1 error occurred:\n\t* invalid for-each in aws_s3_bucket_server_side_encryption_configuration.this[0].dynamic.rule block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\n"2024-11-04T09:13:21Z ERROR [terraformevaluator] Failed to expand dynamic block.block="module.definition_upload_lambda.aws_lambda_function.this[0]"err="2 errors occurred:\n\t* invalid for-each in aws_lambda_function.this[0].dynamic.vpc_config block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\t* invalid for-each in aws_lambda_function.this[0].dynamic.logging_config block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\n"2024-11-04T09:13:21Z ERROR [terraformevaluator] Failed to expand dynamic block.block="module.definition_upload_lambda.aws_lambda_function.this[0]"err="2 errors occurred:\n\t* invalid for-each in aws_lambda_function.this[0].dynamic.vpc_config block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\t* invalid for-each in aws_lambda_function.this[0].dynamic.logging_config block: cannot use a cty.NilVal value in for_each. An iterable collection is required\n\n"2024-11-04T09:13:23Z INFO [terraformexecutor] Ignore finding rule="aws-s3-enable-bucket-encryption"range="git::https:/github.com/terraform-aws-modules/terraform-aws-s3-bucket?ref=d8ad14f2da0179178030c8876de84458aa7495e9/main.tf:176-198"2024-11-04T09:13:23Z INFO [terraformexecutor] Ignore finding rule="aws-s3-encryption-customer-key"range="git::https:/github.com/terraform-aws-modules/terraform-aws-s3-bucket?ref=d8ad14f2da0179178030c8876de84458aa7495e9/main.tf:176-198"2024-11-04T09:13:23Z INFO [terraformexecutor] Ignore finding rule="aws-ec2-no-public-egress-sgr"range="terraform-aws-modules/security-group/aws/main.tf:533"2024-11-04T09:13:23Z INFO [terraformexecutor] Ignore finding rule="aws-ec2-no-public-egress-sgr"range="terraform-aws-modules/security-group/aws/main.tf:534"2024-11-04T09:13:23Z INFO Number of language-specific files num=02024-11-04T09:13:23Z INFO Detected config files num=10
git::https:/github.com/terraform-aws-modules/terraform-aws-alb?ref=349540d1a611cd98a6383cc64ef0d9bf08d88fb7/main.tf (terraform)
===============================================================================================================================
Tests:1 (SUCCESSES:0, FAILURES:1)
Failures:1 (HIGH:1, CRITICAL:0)
AVD-AWS-0053 (HIGH): Load balancer is exposed publicly.
════════════════════════════════════════
There are many scenarios in which you would want to expose a load balancer to the wider internet, but this check exists as a warning to prevent accidental exposure of internal assets. You should ensure that this resource should be exposed publicly.
See https://avd.aquasec.com/misconfig/avd-aws-0053
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-alb?ref=349540d1a611cd98a6383cc64ef0d9bf08d88fb7/main.tf:12-81
via network-load-balancers.tf:1-37 (module.datasync_activation_nlb)
────────────────────────────────────────
12 ┌ resource"aws_lb""this" {
13 │ count=local.create?1:014 │
15 │ dynamic"access_logs" {
16 │ for_each=length(var.access_logs) >0? [var.access_logs] : []
17 │
18 │ content {
19 │ bucket=access_logs.value.bucket20 └ enabled=try(access_logs.value.enabled, true)
..
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf (terraform)
===============================================================================================================================
Tests:4 (SUCCESSES:0, FAILURES:4)
Failures:4 (HIGH:0, CRITICAL:4)
AVD-AWS-0102 (CRITICAL): Network ACL rule allows access using ALL ports.
════════════════════════════════════════
Ensure access to specific required ports is allowed, and nothing else.
See https://avd.aquasec.com/misconfig/aws-vpc-no-excessive-port-access
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:340
via git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:328-343 (aws_network_acl_rule.private_outbound[0])
via vpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
328resource"aws_network_acl_rule""private_outbound" {
...340 [ protocol = var.private_outbound_acl_rules[count.index]["protocol"]
...343 }
────────────────────────────────────────
AVD-AWS-0102 (CRITICAL):NetworkACLruleallowsaccessusingALLports.
════════════════════════════════════════
Ensureaccesstospecificrequiredportsisallowed, andnothingelse.Seehttps://avd.aquasec.com/misconfig/aws-vpc-no-excessive-port-access
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:323viagit::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:311-326 (aws_network_acl_rule.private_inbound[0])
viavpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
311resource"aws_network_acl_rule""private_inbound" {
...323 [ protocol = var.private_inbound_acl_rules[count.index]["protocol"]
...326 }
────────────────────────────────────────
AVD-AWS-0102 (CRITICAL):NetworkACLruleallowsaccessusingALLports.
════════════════════════════════════════
Ensureaccesstospecificrequiredportsisallowed, andnothingelse.Seehttps://avd.aquasec.com/misconfig/aws-vpc-no-excessive-port-access
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:221viagit::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:209-224 (aws_network_acl_rule.public_outbound[0])
viavpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
209resource"aws_network_acl_rule""public_outbound" {
...221 [ protocol = var.public_outbound_acl_rules[count.index]["protocol"]
...224 }
────────────────────────────────────────
AVD-AWS-0102 (CRITICAL):NetworkACLruleallowsaccessusingALLports.
════════════════════════════════════════
Ensureaccesstospecificrequiredportsisallowed, andnothingelse.Seehttps://avd.aquasec.com/misconfig/aws-vpc-no-excessive-port-access
────────────────────────────────────────
git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:204viagit::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=e226cc15a7b8f62fd0e108792fea66fa85bcb4b9/main.tf:192-207 (aws_network_acl_rule.public_inbound[0])
viavpc.tf:1-19 (module.connected_vpc)
────────────────────────────────────────
192resource"aws_network_acl_rule""public_inbound" {
...204 [ protocol = var.public_inbound_acl_rules[count.index]["protocol"]
...207 }
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf (terraform)
=================================================
Tests:4 (SUCCESSES:0, FAILURES:4)
Failures:4 (HIGH:0, CRITICAL:4)
AVD-AWS-0102 (CRITICAL):NetworkACLruleallowsaccessusingALLports.
════════════════════════════════════════
Ensureaccesstospecificrequiredportsisallowed, andnothingelse.Seehttps://avd.aquasec.com/misconfig/aws-vpc-no-excessive-port-access
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:340viaterraform-aws-modules/vpc/aws/main.tf:328-343 (aws_network_acl_rule.private_outbound[0])
viavpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
328resource"aws_network_acl_rule""private_outbound" {
...340 [ protocol = var.private_outbound_acl_rules[count.index]["protocol"]
...343 }
────────────────────────────────────────
AVD-AWS-0102 (CRITICAL):NetworkACLruleallowsaccessusingALLports.
════════════════════════════════════════
Ensureaccesstospecificrequiredportsisallowed, andnothingelse.Seehttps://avd.aquasec.com/misconfig/aws-vpc-no-excessive-port-access
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:323viaterraform-aws-modules/vpc/aws/main.tf:311-326 (aws_network_acl_rule.private_inbound[0])
viavpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
311resource"aws_network_acl_rule""private_inbound" {
...323 [ protocol = var.private_inbound_acl_rules[count.index]["protocol"]
...326 }
────────────────────────────────────────
AVD-AWS-0102 (CRITICAL):NetworkACLruleallowsaccessusingALLports.
════════════════════════════════════════
Ensureaccesstospecificrequiredportsisallowed, andnothingelse.Seehttps://avd.aquasec.com/misconfig/aws-vpc-no-excessive-port-access
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:221viaterraform-aws-modules/vpc/aws/main.tf:209-224 (aws_network_acl_rule.public_outbound[0])
viavpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
209resource"aws_network_acl_rule""public_outbound" {
...221 [ protocol = var.public_outbound_acl_rules[count.index]["protocol"]
...224 }
────────────────────────────────────────
AVD-AWS-0102 (CRITICAL):NetworkACLruleallowsaccessusingALLports.
════════════════════════════════════════
Ensureaccesstospecificrequiredportsisallowed, andnothingelse.Seehttps://avd.aquasec.com/misconfig/aws-vpc-no-excessive-port-access
────────────────────────────────────────
terraform-aws-modules/vpc/aws/main.tf:204viaterraform-aws-modules/vpc/aws/main.tf:192-207 (aws_network_acl_rule.public_inbound[0])
viavpc.tf:21-42 (module.isolated_vpc)
────────────────────────────────────────
192resource"aws_network_acl_rule""public_inbound" {
...204 [ protocol = var.public_inbound_acl_rules[count.index]["protocol"]
...207 }
────────────────────────────────────────
trivy_exitcode=1
dependabotbot
deleted the
dependabot/terraform/terraform/environments/analytical-platform-ingestion/terraform-aws-modules/s3-bucket/aws-4.2.1
branch
November 11, 2024 00:57
dependenciesPull requests that update a dependency fileenvironments-repositoryUsed to exclude PRs from this repo in our Slack PR updateterraformPull requests that update Terraform code
0 participants
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.
Bumps terraform-aws-modules/s3-bucket/aws from 4.1.2 to 4.2.1.
Release notes
Sourced from terraform-aws-modules/s3-bucket/aws's releases.
Changelog
Sourced from terraform-aws-modules/s3-bucket/aws's changelog.
Commits
d8ad14f
chore(release): version 4.2.1 [skip ci]522fcff
fix: Update CI workflow versions to latest (#293)5b923af
chore(release): version 4.2.0 [skip ci]f6fda8c
feat: Supporttransition_default_minimum_object_size
(#290)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditions
will show all of the ignore conditions of the specified dependency@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)