Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trivy ignore AVD-AWS-0102 for subnet NACLs #8262

Merged
merged 2 commits into from
Oct 16, 2024

Conversation

richgreen-moj
Copy link
Contributor

@richgreen-moj richgreen-moj commented Oct 14, 2024

A reference to the issue / Description of it

Daily run of the Static Code Analysis job is failing...
https://github.com/ministryofjustice/modernisation-platform/actions/runs/11340947819/job/31538282534#step:4:3094

How does this PR fix the problem?

Added an ignore on a few resources in the vpc-nacls module for avd-aws-0102 as the rules are open to all ports by design.

As suggested, I've also removed the tfsec ignores as that is no longer in use.

How has this been tested?

Status checks are passing.

Deployment Plan / Instructions

Will this deployment impact the platform and / or services on it?

{Please write here}

Checklist (check x in [ ] of list items)

  • I have performed a self-review of my own code
  • All checks have passed
  • I have made corresponding changes to the documentation
  • Plan and discussed how it should be deployed to PROD (If needed)

Additional comments (if any)

{Please write here}

Copy link
Contributor

Trivy Scan Success

Show Output ```hcl

Trivy will check the following folders:
terraform/environments/core-vpc


Running Trivy in terraform/environments/core-vpc
2024-10-14T13:18:20Z INFO [vulndb] Need to update DB
2024-10-14T13:18:20Z INFO [vulndb] Downloading vulnerability DB...
2024-10-14T13:18:20Z INFO [vulndb] Downloading artifact... repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-14T13:18:23Z INFO [vulndb] Artifact successfully downloaded repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-14T13:18:23Z INFO [vuln] Vulnerability scanning is enabled
2024-10-14T13:18:23Z INFO [misconfig] Misconfiguration scanning is enabled
2024-10-14T13:18:23Z INFO [misconfig] Need to update the built-in checks
2024-10-14T13:18:23Z INFO [misconfig] Downloading the built-in checks...
156.02 KiB / 156.02 KiB [---------------------------------------------------------] 100.00% ? p/s 0s2024-10-14T13:18:23Z INFO [secret] Secret scanning is enabled
2024-10-14T13:18:23Z INFO [secret] If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-10-14T13:18:23Z INFO [secret] Please see also https://aquasecurity.github.io/trivy/v0.56/docs/scanner/secret#recommendation for faster secret detection
2024-10-14T13:18:24Z INFO [terraform scanner] Scanning root module file_path="."
2024-10-14T13:18:24Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="aws_iam_role.member-delegation" value="cty.NilVal"
2024-10-14T13:18:24Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="aws_iam_role_policy.member-delegation" value="cty.NilVal"
2024-10-14T13:18:24Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.dns-zone" value="cty.NilVal"
2024-10-14T13:18:24Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.dns_zone_extend" value="cty.NilVal"
2024-10-14T13:18:24Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.dns_zone_extend_private" value="cty.NilVal"
2024-10-14T13:18:24Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.resource-share" value="cty.NilVal"
2024-10-14T13:18:24Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.vpc" value="cty.NilVal"
2024-10-14T13:18:24Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.vpc_attachment" value="cty.NilVal"
2024-10-14T13:18:24Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.vpc_nacls" value="cty.NilVal"
2024-10-14T13:18:26Z INFO [terraform executor] Ignore finding rule="aws-sns-enable-topic-encryption" range="monitoring.tf:9-15"
2024-10-14T13:18:26Z INFO Number of language-specific files num=0
2024-10-14T13:18:26Z INFO Detected config files num=2
trivy_exitcode=0

</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>

```hcl

*****************************

Checkov will check the following folders:
terraform/environments/core-vpc

*****************************

Running Checkov in terraform/environments/core-vpc
Excluding the following checks: CKV_GIT_1,CKV_AWS_126,CKV2_AWS_38,CKV2_AWS_39
2024-10-14 13:18:29,071 [MainThread  ] [WARNI]  Failed to download module github.com/ministryofjustice/terraform-aws-observability-platform-tenant?ref=fbbe5c8282786bcc0a00c969fe598e14f12eea9b:None (for external modules, the --download-external-modules flag is required)
2024-10-14 13:18:29,071 [MainThread  ] [WARNI]  Failed to download module github.com/ministryofjustice/modernisation-platform-terraform-pagerduty-integration?ref=0179859e6fafc567843cd55c0b05d325d5012dc4:None (for external modules, the --download-external-modules flag is required)
2024-10-14 13:18:29,071 [MainThread  ] [WARNI]  Failed to download module github.com/ministryofjustice/modernisation-platform-terraform-member-vpc?ref=0ba18bb790c4259512768ffb6db9c2852654b82f:None (for external modules, the --download-external-modules flag is required)
terraform scan results:

Passed checks: 116, Failed checks: 0, Skipped checks: 24


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/core-vpc

*****************************

Running tflint in terraform/environments/core-vpc
Excluding the following checks: terraform_unused_declarations
tflint_exitcode=0

Trivy Scan Success

Show Output
*****************************

Trivy will check the following folders:
terraform/environments/core-vpc

*****************************

Running Trivy in terraform/environments/core-vpc
2024-10-14T13:18:20Z	INFO	[vulndb] Need to update DB
2024-10-14T13:18:20Z	INFO	[vulndb] Downloading vulnerability DB...
2024-10-14T13:18:20Z	INFO	[vulndb] Downloading artifact...	repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-14T13:18:23Z	INFO	[vulndb] Artifact successfully downloaded	repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-14T13:18:23Z	INFO	[vuln] Vulnerability scanning is enabled
2024-10-14T13:18:23Z	INFO	[misconfig] Misconfiguration scanning is enabled
2024-10-14T13:18:23Z	INFO	[misconfig] Need to update the built-in checks
2024-10-14T13:18:23Z	INFO	[misconfig] Downloading the built-in checks...
156.02 KiB / 156.02 KiB [---------------------------------------------------------] 100.00% ? p/s 0s2024-10-14T13:18:23Z	INFO	[secret] Secret scanning is enabled
2024-10-14T13:18:23Z	INFO	[secret] If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-10-14T13:18:23Z	INFO	[secret] Please see also https://aquasecurity.github.io/trivy/v0.56/docs/scanner/secret#recommendation for faster secret detection
2024-10-14T13:18:24Z	INFO	[terraform scanner] Scanning root module	file_path="."
2024-10-14T13:18:24Z	ERROR	[terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.	block="aws_iam_role.member-delegation" value="cty.NilVal"
2024-10-14T13:18:24Z	ERROR	[terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.	block="aws_iam_role_policy.member-delegation" value="cty.NilVal"
2024-10-14T13:18:24Z	ERROR	[terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.	block="module.dns-zone" value="cty.NilVal"
2024-10-14T13:18:24Z	ERROR	[terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.	block="module.dns_zone_extend" value="cty.NilVal"
2024-10-14T13:18:24Z	ERROR	[terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.	block="module.dns_zone_extend_private" value="cty.NilVal"
2024-10-14T13:18:24Z	ERROR	[terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.	block="module.resource-share" value="cty.NilVal"
2024-10-14T13:18:24Z	ERROR	[terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.	block="module.vpc" value="cty.NilVal"
2024-10-14T13:18:24Z	ERROR	[terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.	block="module.vpc_attachment" value="cty.NilVal"
2024-10-14T13:18:24Z	ERROR	[terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.	block="module.vpc_nacls" value="cty.NilVal"
2024-10-14T13:18:26Z	INFO	[terraform executor] Ignore finding	rule="aws-sns-enable-topic-encryption" range="monitoring.tf:9-15"
2024-10-14T13:18:26Z	INFO	Number of language-specific files	num=0
2024-10-14T13:18:26Z	INFO	Detected config files	num=2
trivy_exitcode=0

@richgreen-moj richgreen-moj marked this pull request as ready for review October 15, 2024 08:47
@richgreen-moj richgreen-moj requested a review from a team as a code owner October 15, 2024 08:47
Copy link
Contributor

Trivy Scan Success

Show Output ```hcl

Trivy will check the following folders:
terraform/environments/core-vpc


Running Trivy in terraform/environments/core-vpc
2024-10-15T08:48:27Z INFO [vulndb] Need to update DB
2024-10-15T08:48:27Z INFO [vulndb] Downloading vulnerability DB...
2024-10-15T08:48:27Z INFO [vulndb] Downloading artifact... repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-15T08:48:29Z INFO [vulndb] Artifact successfully downloaded repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-15T08:48:29Z INFO [vuln] Vulnerability scanning is enabled
2024-10-15T08:48:29Z INFO [misconfig] Misconfiguration scanning is enabled
2024-10-15T08:48:29Z INFO [misconfig] Need to update the built-in checks
2024-10-15T08:48:29Z INFO [misconfig] Downloading the built-in checks...
156.02 KiB / 156.02 KiB [---------------------------------------------------------] 100.00% ? p/s 0s2024-10-15T08:48:29Z INFO [secret] Secret scanning is enabled
2024-10-15T08:48:29Z INFO [secret] If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-10-15T08:48:29Z INFO [secret] Please see also https://aquasecurity.github.io/trivy/v0.56/docs/scanner/secret#recommendation for faster secret detection
2024-10-15T08:48:30Z INFO [terraform scanner] Scanning root module file_path="."
2024-10-15T08:48:30Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="aws_iam_role.member-delegation" value="cty.NilVal"
2024-10-15T08:48:30Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="aws_iam_role_policy.member-delegation" value="cty.NilVal"
2024-10-15T08:48:30Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.dns-zone" value="cty.NilVal"
2024-10-15T08:48:30Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.dns_zone_extend" value="cty.NilVal"
2024-10-15T08:48:30Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.dns_zone_extend_private" value="cty.NilVal"
2024-10-15T08:48:30Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.resource-share" value="cty.NilVal"
2024-10-15T08:48:30Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.vpc" value="cty.NilVal"
2024-10-15T08:48:30Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.vpc_attachment" value="cty.NilVal"
2024-10-15T08:48:30Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="module.vpc_nacls" value="cty.NilVal"
2024-10-15T08:48:32Z INFO [terraform executor] Ignore finding rule="aws-sns-enable-topic-encryption" range="monitoring.tf:9-15"
2024-10-15T08:48:32Z INFO Number of language-specific files num=0
2024-10-15T08:48:32Z INFO Detected config files num=2
trivy_exitcode=0

</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>

```hcl

*****************************

Checkov will check the following folders:
terraform/environments/core-vpc

*****************************

Running Checkov in terraform/environments/core-vpc
Excluding the following checks: CKV_GIT_1,CKV_AWS_126,CKV2_AWS_38,CKV2_AWS_39
2024-10-15 08:48:35,115 [MainThread  ] [WARNI]  Failed to download module github.com/ministryofjustice/terraform-aws-observability-platform-tenant?ref=fbbe5c8282786bcc0a00c969fe598e14f12eea9b:None (for external modules, the --download-external-modules flag is required)
2024-10-15 08:48:35,115 [MainThread  ] [WARNI]  Failed to download module github.com/ministryofjustice/modernisation-platform-terraform-pagerduty-integration?ref=0179859e6fafc567843cd55c0b05d325d5012dc4:None (for external modules, the --download-external-modules flag is required)
2024-10-15 08:48:35,115 [MainThread  ] [WARNI]  Failed to download module github.com/ministryofjustice/modernisation-platform-terraform-member-vpc?ref=0ba18bb790c4259512768ffb6db9c2852654b82f:None (for external modules, the --download-external-modules flag is required)
terraform scan results:

Passed checks: 116, Failed checks: 0, Skipped checks: 24


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/core-vpc

*****************************

Running tflint in terraform/environments/core-vpc
Excluding the following checks: terraform_unused_declarations
tflint_exitcode=0

Trivy Scan Success

Show Output
*****************************

Trivy will check the following folders:
terraform/environments/core-vpc

*****************************

Running Trivy in terraform/environments/core-vpc
2024-10-15T08:48:27Z	INFO	[vulndb] Need to update DB
2024-10-15T08:48:27Z	INFO	[vulndb] Downloading vulnerability DB...
2024-10-15T08:48:27Z	INFO	[vulndb] Downloading artifact...	repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-15T08:48:29Z	INFO	[vulndb] Artifact successfully downloaded	repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-15T08:48:29Z	INFO	[vuln] Vulnerability scanning is enabled
2024-10-15T08:48:29Z	INFO	[misconfig] Misconfiguration scanning is enabled
2024-10-15T08:48:29Z	INFO	[misconfig] Need to update the built-in checks
2024-10-15T08:48:29Z	INFO	[misconfig] Downloading the built-in checks...
156.02 KiB / 156.02 KiB [---------------------------------------------------------] 100.00% ? p/s 0s2024-10-15T08:48:29Z	INFO	[secret] Secret scanning is enabled
2024-10-15T08:48:29Z	INFO	[secret] If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-10-15T08:48:29Z	INFO	[secret] Please see also https://aquasecurity.github.io/trivy/v0.56/docs/scanner/secret#recommendation for faster secret detection
2024-10-15T08:48:30Z	INFO	[terraform scanner] Scanning root module	file_path="."
2024-10-15T08:48:30Z	ERROR	[terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.	block="aws_iam_role.member-delegation" value="cty.NilVal"
2024-10-15T08:48:30Z	ERROR	[terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.	block="aws_iam_role_policy.member-delegation" value="cty.NilVal"
2024-10-15T08:48:30Z	ERROR	[terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.	block="module.dns-zone" value="cty.NilVal"
2024-10-15T08:48:30Z	ERROR	[terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.	block="module.dns_zone_extend" value="cty.NilVal"
2024-10-15T08:48:30Z	ERROR	[terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.	block="module.dns_zone_extend_private" value="cty.NilVal"
2024-10-15T08:48:30Z	ERROR	[terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.	block="module.resource-share" value="cty.NilVal"
2024-10-15T08:48:30Z	ERROR	[terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.	block="module.vpc" value="cty.NilVal"
2024-10-15T08:48:30Z	ERROR	[terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.	block="module.vpc_attachment" value="cty.NilVal"
2024-10-15T08:48:30Z	ERROR	[terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.	block="module.vpc_nacls" value="cty.NilVal"
2024-10-15T08:48:32Z	INFO	[terraform executor] Ignore finding	rule="aws-sns-enable-topic-encryption" range="monitoring.tf:9-15"
2024-10-15T08:48:32Z	INFO	Number of language-specific files	num=0
2024-10-15T08:48:32Z	INFO	Detected config files	num=2
trivy_exitcode=0

Copy link
Contributor

Trivy Scan Failed

Show Output ```hcl

Trivy will check the following folders:
terraform/modules/vpc-nacls


Running Trivy in terraform/modules/vpc-nacls
2024-10-15T09:37:28Z INFO [vulndb] Need to update DB
2024-10-15T09:37:28Z INFO [vulndb] Downloading vulnerability DB...
2024-10-15T09:37:28Z INFO [vulndb] Downloading artifact... repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-15T09:37:30Z INFO [vulndb] Artifact successfully downloaded repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-15T09:37:30Z INFO [vuln] Vulnerability scanning is enabled
2024-10-15T09:37:30Z INFO [misconfig] Misconfiguration scanning is enabled
2024-10-15T09:37:30Z INFO [misconfig] Need to update the built-in checks
2024-10-15T09:37:30Z INFO [misconfig] Downloading the built-in checks...
156.02 KiB / 156.02 KiB [------------------------------------------------------] 100.00% ? p/s 100ms2024-10-15T09:37:31Z INFO [secret] Secret scanning is enabled
2024-10-15T09:37:31Z INFO [secret] If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-10-15T09:37:31Z INFO [secret] Please see also https://aquasecurity.github.io/trivy/v0.56/docs/scanner/secret#recommendation for faster secret detection
2024-10-15T09:37:31Z INFO [terraform scanner] Scanning root module file_path="."
2024-10-15T09:37:32Z WARN [terraform parser] Variable values was not found in the environment or variable files. Evaluating may not work correctly. module="root" variables="tags_prefix, vpc_name"
2024-10-15T09:37:32Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="data.aws_subnet.subnets_all" value="cty.NilVal"
2024-10-15T09:37:32Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-public-ingress-acl" range="main.tf:44"
2024-10-15T09:37:32Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-public-ingress-acl" range="main.tf:60"
2024-10-15T09:37:32Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-public-ingress-acl" range="main.tf:75"
2024-10-15T09:37:32Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-public-ingress-acl" range="main.tf:90"
2024-10-15T09:37:32Z INFO Number of language-specific files num=0
2024-10-15T09:37:32Z INFO Detected config files num=2

main.tf (terraform)

Tests: 31 (SUCCESSES: 0, FAILURES: 31, EXCEPTIONS: 0)
Failures: 31 (HIGH: 0, CRITICAL: 31)

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
────────────────────────────────────────
main.tf:48
via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_10-0-0-0_in"])
────────────────────────────────────────
39 resource "aws_network_acl_rule" "data_subnet_static_rules" {
..
48 [ protocol = each.value.protocol
..
52 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:48
via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_10-0-0-0_out"])
────────────────────────────────────────
39 resource "aws_network_acl_rule" "data_subnet_static_rules" {
..
48 [ protocol = each.value.protocol
..
52 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:48
via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_10-27-136-0_in"])
────────────────────────────────────────
39 resource "aws_network_acl_rule" "data_subnet_static_rules" {
..
48 [ protocol = each.value.protocol
..
52 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:48
via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_10-27-136-0_out"])
────────────────────────────────────────
39 resource "aws_network_acl_rule" "data_subnet_static_rules" {
..
48 [ protocol = each.value.protocol
..
52 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:48
via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_172-16-0-0_in"])
────────────────────────────────────────
39 resource "aws_network_acl_rule" "data_subnet_static_rules" {
..
48 [ protocol = each.value.protocol
..
52 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:48
via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_172-16-0-0_out"])
────────────────────────────────────────
39 resource "aws_network_acl_rule" "data_subnet_static_rules" {
..
48 [ protocol = each.value.protocol
..
52 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:48
via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_192-168-0-0_in"])
────────────────────────────────────────
39 resource "aws_network_acl_rule" "data_subnet_static_rules" {
..
48 [ protocol = each.value.protocol
..
52 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:48
via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_192-168-0-0_out"])
────────────────────────────────────────
39 resource "aws_network_acl_rule" "data_subnet_static_rules" {
..
48 [ protocol = each.value.protocol
..
52 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:48
via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_vpc_cidr_in"])
────────────────────────────────────────
39 resource "aws_network_acl_rule" "data_subnet_static_rules" {
..
48 [ protocol = each.value.protocol
..
52 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:48
via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_vpc_cidr_out"])
────────────────────────────────────────
39 resource "aws_network_acl_rule" "data_subnet_static_rules" {
..
48 [ protocol = each.value.protocol
..
52 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:64
via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_10-0-0-0_in"])
────────────────────────────────────────
55 resource "aws_network_acl_rule" "private_subnet_static_rules" {
..
64 [ protocol = each.value.protocol
..
68 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:64
via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_10-0-0-0_out"])
────────────────────────────────────────
55 resource "aws_network_acl_rule" "private_subnet_static_rules" {
..
64 [ protocol = each.value.protocol
..
68 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:64
via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_10-27-136-0_in"])
────────────────────────────────────────
55 resource "aws_network_acl_rule" "private_subnet_static_rules" {
..
64 [ protocol = each.value.protocol
..
68 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:64
via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_10-27-136-0_out"])
────────────────────────────────────────
55 resource "aws_network_acl_rule" "private_subnet_static_rules" {
..
64 [ protocol = each.value.protocol
..
68 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:64
via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_172-16-0-0_in"])
────────────────────────────────────────
55 resource "aws_network_acl_rule" "private_subnet_static_rules" {
..
64 [ protocol = each.value.protocol
..
68 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:64
via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_172-16-0-0_out"])
────────────────────────────────────────
55 resource "aws_network_acl_rule" "private_subnet_static_rules" {
..
64 [ protocol = each.value.protocol
..
68 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:64
via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_192-168-0-0_in"])
────────────────────────────────────────
55 resource "aws_network_acl_rule" "private_subnet_static_rules" {
..
64 [ protocol = each.value.protocol
..
68 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:64
via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_192-168-0-0_out"])
────────────────────────────────────────
55 resource "aws_network_acl_rule" "private_subnet_static_rules" {
..
64 [ protocol = each.value.protocol
..
68 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:64
via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_vpc_cidr_in"])
────────────────────────────────────────
55 resource "aws_network_acl_rule" "private_subnet_static_rules" {
..
64 [ protocol = each.value.protocol
..
68 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:64
via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_vpc_cidr_out"])
────────────────────────────────────────
55 resource "aws_network_acl_rule" "private_subnet_static_rules" {
..
64 [ protocol = each.value.protocol
..
68 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:94
via main.tf:86-98 (aws_network_acl_rule.public_subnet_internet_access_rules["allow_any_out"])
────────────────────────────────────────
86 resource "aws_network_acl_rule" "public_subnet_internet_access_rules" {
..
94 [ protocol = each.value.protocol
..
98 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:79
via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_10-0-0-0_in"])
────────────────────────────────────────
71 resource "aws_network_acl_rule" "public_subnet_static_rules" {
..
79 [ protocol = each.value.protocol
..
83 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:79
via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_10-0-0-0_out"])
────────────────────────────────────────
71 resource "aws_network_acl_rule" "public_subnet_static_rules" {
..
79 [ protocol = each.value.protocol
..
83 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:79
via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_10-27-136-0_in"])
────────────────────────────────────────
71 resource "aws_network_acl_rule" "public_subnet_static_rules" {
..
79 [ protocol = each.value.protocol
..
83 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:79
via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_10-27-136-0_out"])
────────────────────────────────────────
71 resource "aws_network_acl_rule" "public_subnet_static_rules" {
..
79 [ protocol = each.value.protocol
..
83 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:79
via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_172-16-0-0_in"])
────────────────────────────────────────
71 resource "aws_network_acl_rule" "public_subnet_static_rules" {
..
79 [ protocol = each.value.protocol
..
83 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:79
via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_172-16-0-0_out"])
────────────────────────────────────────
71 resource "aws_network_acl_rule" "public_subnet_static_rules" {
..
79 [ protocol = each.value.protocol
..
83 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:79
via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_192-168-0-0_in"])
────────────────────────────────────────
71 resource "aws_network_acl_rule" "public_subnet_static_rules" {
..
79 [ protocol = each.value.protocol
..
83 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:79
via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_192-168-0-0_out"])
────────────────────────────────────────
71 resource "aws_network_acl_rule" "public_subnet_static_rules" {
..
79 [ protocol = each.value.protocol
..
83 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:79
via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_vpc_cidr_in"])
────────────────────────────────────────
71 resource "aws_network_acl_rule" "public_subnet_static_rules" {
..
79 [ protocol = each.value.protocol
..
83 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:79
via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_vpc_cidr_out"])
────────────────────────────────────────
71 resource "aws_network_acl_rule" "public_subnet_static_rules" {
..
79 [ protocol = each.value.protocol
..
83 }
────────────────────────────────────────

trivy_exitcode=1

</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>

```hcl

*****************************

Checkov will check the following folders:
terraform/modules/vpc-nacls

*****************************

Running Checkov in terraform/modules/vpc-nacls
Excluding the following checks: CKV_GIT_1,CKV_AWS_126,CKV2_AWS_38,CKV2_AWS_39
terraform scan results:

Passed checks: 64, Failed checks: 0, Skipped checks: 17


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/modules/vpc-nacls

*****************************

Running tflint in terraform/modules/vpc-nacls
Excluding the following checks: terraform_unused_declarations
tflint_exitcode=0

Trivy Scan Failed

Show Output
*****************************

Trivy will check the following folders:
terraform/modules/vpc-nacls

*****************************

Running Trivy in terraform/modules/vpc-nacls
2024-10-15T09:37:28Z	INFO	[vulndb] Need to update DB
2024-10-15T09:37:28Z	INFO	[vulndb] Downloading vulnerability DB...
2024-10-15T09:37:28Z	INFO	[vulndb] Downloading artifact...	repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-15T09:37:30Z	INFO	[vulndb] Artifact successfully downloaded	repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-15T09:37:30Z	INFO	[vuln] Vulnerability scanning is enabled
2024-10-15T09:37:30Z	INFO	[misconfig] Misconfiguration scanning is enabled
2024-10-15T09:37:30Z	INFO	[misconfig] Need to update the built-in checks
2024-10-15T09:37:30Z	INFO	[misconfig] Downloading the built-in checks...
156.02 KiB / 156.02 KiB [------------------------------------------------------] 100.00% ? p/s 100ms2024-10-15T09:37:31Z	INFO	[secret] Secret scanning is enabled
2024-10-15T09:37:31Z	INFO	[secret] If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-10-15T09:37:31Z	INFO	[secret] Please see also https://aquasecurity.github.io/trivy/v0.56/docs/scanner/secret#recommendation for faster secret detection
2024-10-15T09:37:31Z	INFO	[terraform scanner] Scanning root module	file_path="."
2024-10-15T09:37:32Z	WARN	[terraform parser] Variable values was not found in the environment or variable files. Evaluating may not work correctly.	module="root" variables="tags_prefix, vpc_name"
2024-10-15T09:37:32Z	ERROR	[terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.	block="data.aws_subnet.subnets_all" value="cty.NilVal"
2024-10-15T09:37:32Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-public-ingress-acl" range="main.tf:44"
2024-10-15T09:37:32Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-public-ingress-acl" range="main.tf:60"
2024-10-15T09:37:32Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-public-ingress-acl" range="main.tf:75"
2024-10-15T09:37:32Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-public-ingress-acl" range="main.tf:90"
2024-10-15T09:37:32Z	INFO	Number of language-specific files	num=0
2024-10-15T09:37:32Z	INFO	Detected config files	num=2

main.tf (terraform)
===================
Tests: 31 (SUCCESSES: 0, FAILURES: 31, EXCEPTIONS: 0)
Failures: 31 (HIGH: 0, CRITICAL: 31)

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
────────────────────────────────────────
 main.tf:48
   via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_10-0-0-0_in"])
────────────────────────────────────────
  39   resource "aws_network_acl_rule" "data_subnet_static_rules" {
  ..   
  48 [   protocol       = each.value.protocol
  ..   
  52   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:48
   via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_10-0-0-0_out"])
────────────────────────────────────────
  39   resource "aws_network_acl_rule" "data_subnet_static_rules" {
  ..   
  48 [   protocol       = each.value.protocol
  ..   
  52   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:48
   via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_10-27-136-0_in"])
────────────────────────────────────────
  39   resource "aws_network_acl_rule" "data_subnet_static_rules" {
  ..   
  48 [   protocol       = each.value.protocol
  ..   
  52   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:48
   via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_10-27-136-0_out"])
────────────────────────────────────────
  39   resource "aws_network_acl_rule" "data_subnet_static_rules" {
  ..   
  48 [   protocol       = each.value.protocol
  ..   
  52   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:48
   via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_172-16-0-0_in"])
────────────────────────────────────────
  39   resource "aws_network_acl_rule" "data_subnet_static_rules" {
  ..   
  48 [   protocol       = each.value.protocol
  ..   
  52   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:48
   via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_172-16-0-0_out"])
────────────────────────────────────────
  39   resource "aws_network_acl_rule" "data_subnet_static_rules" {
  ..   
  48 [   protocol       = each.value.protocol
  ..   
  52   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:48
   via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_192-168-0-0_in"])
────────────────────────────────────────
  39   resource "aws_network_acl_rule" "data_subnet_static_rules" {
  ..   
  48 [   protocol       = each.value.protocol
  ..   
  52   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:48
   via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_192-168-0-0_out"])
────────────────────────────────────────
  39   resource "aws_network_acl_rule" "data_subnet_static_rules" {
  ..   
  48 [   protocol       = each.value.protocol
  ..   
  52   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:48
   via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_vpc_cidr_in"])
────────────────────────────────────────
  39   resource "aws_network_acl_rule" "data_subnet_static_rules" {
  ..   
  48 [   protocol       = each.value.protocol
  ..   
  52   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:48
   via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_vpc_cidr_out"])
────────────────────────────────────────
  39   resource "aws_network_acl_rule" "data_subnet_static_rules" {
  ..   
  48 [   protocol       = each.value.protocol
  ..   
  52   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:64
   via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_10-0-0-0_in"])
────────────────────────────────────────
  55   resource "aws_network_acl_rule" "private_subnet_static_rules" {
  ..   
  64 [   protocol       = each.value.protocol
  ..   
  68   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:64
   via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_10-0-0-0_out"])
────────────────────────────────────────
  55   resource "aws_network_acl_rule" "private_subnet_static_rules" {
  ..   
  64 [   protocol       = each.value.protocol
  ..   
  68   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:64
   via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_10-27-136-0_in"])
────────────────────────────────────────
  55   resource "aws_network_acl_rule" "private_subnet_static_rules" {
  ..   
  64 [   protocol       = each.value.protocol
  ..   
  68   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:64
   via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_10-27-136-0_out"])
────────────────────────────────────────
  55   resource "aws_network_acl_rule" "private_subnet_static_rules" {
  ..   
  64 [   protocol       = each.value.protocol
  ..   
  68   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:64
   via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_172-16-0-0_in"])
────────────────────────────────────────
  55   resource "aws_network_acl_rule" "private_subnet_static_rules" {
  ..   
  64 [   protocol       = each.value.protocol
  ..   
  68   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:64
   via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_172-16-0-0_out"])
────────────────────────────────────────
  55   resource "aws_network_acl_rule" "private_subnet_static_rules" {
  ..   
  64 [   protocol       = each.value.protocol
  ..   
  68   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:64
   via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_192-168-0-0_in"])
────────────────────────────────────────
  55   resource "aws_network_acl_rule" "private_subnet_static_rules" {
  ..   
  64 [   protocol       = each.value.protocol
  ..   
  68   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:64
   via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_192-168-0-0_out"])
────────────────────────────────────────
  55   resource "aws_network_acl_rule" "private_subnet_static_rules" {
  ..   
  64 [   protocol       = each.value.protocol
  ..   
  68   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:64
   via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_vpc_cidr_in"])
────────────────────────────────────────
  55   resource "aws_network_acl_rule" "private_subnet_static_rules" {
  ..   
  64 [   protocol       = each.value.protocol
  ..   
  68   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:64
   via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_vpc_cidr_out"])
────────────────────────────────────────
  55   resource "aws_network_acl_rule" "private_subnet_static_rules" {
  ..   
  64 [   protocol       = each.value.protocol
  ..   
  68   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:94
   via main.tf:86-98 (aws_network_acl_rule.public_subnet_internet_access_rules["allow_any_out"])
────────────────────────────────────────
  86   resource "aws_network_acl_rule" "public_subnet_internet_access_rules" {
  ..   
  94 [   protocol       = each.value.protocol
  ..   
  98   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:79
   via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_10-0-0-0_in"])
────────────────────────────────────────
  71   resource "aws_network_acl_rule" "public_subnet_static_rules" {
  ..   
  79 [   protocol       = each.value.protocol
  ..   
  83   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:79
   via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_10-0-0-0_out"])
────────────────────────────────────────
  71   resource "aws_network_acl_rule" "public_subnet_static_rules" {
  ..   
  79 [   protocol       = each.value.protocol
  ..   
  83   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:79
   via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_10-27-136-0_in"])
────────────────────────────────────────
  71   resource "aws_network_acl_rule" "public_subnet_static_rules" {
  ..   
  79 [   protocol       = each.value.protocol
  ..   
  83   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:79
   via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_10-27-136-0_out"])
────────────────────────────────────────
  71   resource "aws_network_acl_rule" "public_subnet_static_rules" {
  ..   
  79 [   protocol       = each.value.protocol
  ..   
  83   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:79
   via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_172-16-0-0_in"])
────────────────────────────────────────
  71   resource "aws_network_acl_rule" "public_subnet_static_rules" {
  ..   
  79 [   protocol       = each.value.protocol
  ..   
  83   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:79
   via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_172-16-0-0_out"])
────────────────────────────────────────
  71   resource "aws_network_acl_rule" "public_subnet_static_rules" {
  ..   
  79 [   protocol       = each.value.protocol
  ..   
  83   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:79
   via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_192-168-0-0_in"])
────────────────────────────────────────
  71   resource "aws_network_acl_rule" "public_subnet_static_rules" {
  ..   
  79 [   protocol       = each.value.protocol
  ..   
  83   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:79
   via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_192-168-0-0_out"])
────────────────────────────────────────
  71   resource "aws_network_acl_rule" "public_subnet_static_rules" {
  ..   
  79 [   protocol       = each.value.protocol
  ..   
  83   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:79
   via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_vpc_cidr_in"])
────────────────────────────────────────
  71   resource "aws_network_acl_rule" "public_subnet_static_rules" {
  ..   
  79 [   protocol       = each.value.protocol
  ..   
  83   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:79
   via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_vpc_cidr_out"])
────────────────────────────────────────
  71   resource "aws_network_acl_rule" "public_subnet_static_rules" {
  ..   
  79 [   protocol       = each.value.protocol
  ..   
  83   }
────────────────────────────────────────


trivy_exitcode=1

Copy link
Contributor

Trivy Scan Failed

Show Output ```hcl

Trivy will check the following folders:
terraform/modules/vpc-nacls


Running Trivy in terraform/modules/vpc-nacls
2024-10-15T14:14:49Z INFO [vulndb] Need to update DB
2024-10-15T14:14:49Z INFO [vulndb] Downloading vulnerability DB...
2024-10-15T14:14:49Z INFO [vulndb] Downloading artifact... repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-15T14:14:49Z ERROR [vulndb] Failed to download artifact repo="ghcr.io/aquasecurity/trivy-db:2" err="oci download error: failed to fetch the layer: GET https://ghcr.io/v2/aquasecurity/trivy-db/blobs/sha256:12507e5d35ed9dcaa337be9dc419ec149b406f78ab4b6e3dc3ce14154151f482: TOOMANYREQUESTS: retry-after: 998.497µs, allowed: 44000/minute"
2024-10-15T14:14:49Z 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/modules/vpc-nacls

*****************************

Running Checkov in terraform/modules/vpc-nacls
Excluding the following checks: CKV_GIT_1,CKV_AWS_126,CKV2_AWS_38,CKV2_AWS_39
terraform scan results:

Passed checks: 64, Failed checks: 0, Skipped checks: 17


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/modules/vpc-nacls

*****************************

Running tflint in terraform/modules/vpc-nacls
Excluding the following checks: terraform_unused_declarations
tflint_exitcode=0

Trivy Scan Failed

Show Output
*****************************

Trivy will check the following folders:
terraform/modules/vpc-nacls

*****************************

Running Trivy in terraform/modules/vpc-nacls
2024-10-15T14:14:49Z	INFO	[vulndb] Need to update DB
2024-10-15T14:14:49Z	INFO	[vulndb] Downloading vulnerability DB...
2024-10-15T14:14:49Z	INFO	[vulndb] Downloading artifact...	repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-15T14:14:49Z	ERROR	[vulndb] Failed to download artifact	repo="ghcr.io/aquasecurity/trivy-db:2" err="oci download error: failed to fetch the layer: GET https://ghcr.io/v2/aquasecurity/trivy-db/blobs/sha256:12507e5d35ed9dcaa337be9dc419ec149b406f78ab4b6e3dc3ce14154151f482: TOOMANYREQUESTS: retry-after: 998.497µs, allowed: 44000/minute"
2024-10-15T14:14:49Z	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

Copy link
Contributor

Trivy Scan Failed

Show Output ```hcl

Trivy will check the following folders:
terraform/environments/core-vpc
terraform/modules/vpc-nacls


Running Trivy in terraform/environments/core-vpc
2024-10-15T14:35:36Z INFO [vulndb] Need to update DB
2024-10-15T14:35:36Z INFO [vulndb] Downloading vulnerability DB...
2024-10-15T14:35:36Z INFO [vulndb] Downloading artifact... repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-15T14:35:36Z 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: 146.001µs, allowed: 44000/minute\n\n"
2024-10-15T14:35:36Z 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


Running Trivy in terraform/modules/vpc-nacls
2024-10-15T14:35:36Z INFO [vulndb] Need to update DB
2024-10-15T14:35:36Z INFO [vulndb] Downloading vulnerability DB...
2024-10-15T14:35:36Z INFO [vulndb] Downloading artifact... repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-15T14:35:37Z 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: 894.188µs, allowed: 44000/minute\n\n"
2024-10-15T14:35:37Z 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=2

</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>

```hcl

*****************************

Checkov will check the following folders:
terraform/environments/core-vpc
terraform/modules/vpc-nacls

*****************************

Running Checkov in terraform/environments/core-vpc
Excluding the following checks: CKV_GIT_1,CKV_AWS_126,CKV2_AWS_38,CKV2_AWS_39
2024-10-15 14:35:39,574 [MainThread  ] [WARNI]  Failed to download module github.com/ministryofjustice/terraform-aws-observability-platform-tenant?ref=fbbe5c8282786bcc0a00c969fe598e14f12eea9b:None (for external modules, the --download-external-modules flag is required)
2024-10-15 14:35:39,574 [MainThread  ] [WARNI]  Failed to download module github.com/ministryofjustice/modernisation-platform-terraform-pagerduty-integration?ref=0179859e6fafc567843cd55c0b05d325d5012dc4:None (for external modules, the --download-external-modules flag is required)
2024-10-15 14:35:39,574 [MainThread  ] [WARNI]  Failed to download module github.com/ministryofjustice/modernisation-platform-terraform-member-vpc?ref=0ba18bb790c4259512768ffb6db9c2852654b82f:None (for external modules, the --download-external-modules flag is required)
terraform scan results:

Passed checks: 116, Failed checks: 0, Skipped checks: 24


checkov_exitcode=0

*****************************

Running Checkov in terraform/modules/vpc-nacls
Excluding the following checks: CKV_GIT_1,CKV_AWS_126,CKV2_AWS_38,CKV2_AWS_39
terraform scan results:

Passed checks: 64, Failed checks: 0, Skipped checks: 17


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/core-vpc
terraform/modules/vpc-nacls

*****************************

Running tflint in terraform/environments/core-vpc
Excluding the following checks: terraform_unused_declarations
tflint_exitcode=0

*****************************

Running tflint in terraform/modules/vpc-nacls
Excluding the following checks: terraform_unused_declarations
tflint_exitcode=0

Trivy Scan Failed

Show Output
*****************************

Trivy will check the following folders:
terraform/environments/core-vpc
terraform/modules/vpc-nacls

*****************************

Running Trivy in terraform/environments/core-vpc
2024-10-15T14:35:36Z	INFO	[vulndb] Need to update DB
2024-10-15T14:35:36Z	INFO	[vulndb] Downloading vulnerability DB...
2024-10-15T14:35:36Z	INFO	[vulndb] Downloading artifact...	repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-15T14:35:36Z	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: 146.001µs, allowed: 44000/minute\n\n"
2024-10-15T14:35:36Z	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

*****************************

Running Trivy in terraform/modules/vpc-nacls
2024-10-15T14:35:36Z	INFO	[vulndb] Need to update DB
2024-10-15T14:35:36Z	INFO	[vulndb] Downloading vulnerability DB...
2024-10-15T14:35:36Z	INFO	[vulndb] Downloading artifact...	repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-15T14:35:37Z	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: 894.188µs, allowed: 44000/minute\n\n"
2024-10-15T14:35:37Z	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=2

Copy link
Contributor

@dms1981 dms1981 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you try removing the ignore from core-vpc/vpc.tf, and moving the ignore so that it's before the resource declaration down in the module please?
https://aquasecurity.github.io/trivy/v0.41/docs/configuration/filtering/#by-inline-comments
Since we've migrated from tfsec we can probably remove those tfsec ignores too 😄

Copy link
Contributor

Trivy Scan Failed

Show Output ```hcl

Trivy will check the following folders:
terraform/modules/vpc-nacls


Running Trivy in terraform/modules/vpc-nacls
2024-10-16T08:29:38Z INFO [vulndb] Need to update DB
2024-10-16T08:29:38Z INFO [vulndb] Downloading vulnerability DB...
2024-10-16T08:29:38Z INFO [vulndb] Downloading artifact... repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-16T08:29:40Z INFO [vulndb] Artifact successfully downloaded repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-16T08:29:40Z INFO [vuln] Vulnerability scanning is enabled
2024-10-16T08:29:40Z INFO [misconfig] Misconfiguration scanning is enabled
2024-10-16T08:29:40Z INFO [misconfig] Need to update the built-in checks
2024-10-16T08:29:40Z INFO [misconfig] Downloading the built-in checks...
156.02 KiB / 156.02 KiB [---------------------------------------------------------] 100.00% ? p/s 0s2024-10-16T08:29:40Z INFO [secret] Secret scanning is enabled
2024-10-16T08:29:40Z INFO [secret] If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-10-16T08:29:40Z INFO [secret] Please see also https://aquasecurity.github.io/trivy/v0.56/docs/scanner/secret#recommendation for faster secret detection
2024-10-16T08:29:41Z INFO [terraform scanner] Scanning root module file_path="."
2024-10-16T08:29:41Z WARN [terraform parser] Variable values was not found in the environment or variable files. Evaluating may not work correctly. module="root" variables="tags_prefix, vpc_name"
2024-10-16T08:29:41Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="data.aws_subnet.subnets_all" value="cty.NilVal"
2024-10-16T08:29:42Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-public-ingress-acl" range="main.tf:44"
2024-10-16T08:29:42Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-public-ingress-acl" range="main.tf:60"
2024-10-16T08:29:42Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-public-ingress-acl" range="main.tf:75"
2024-10-16T08:29:42Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-public-ingress-acl" range="main.tf:90"
2024-10-16T08:29:42Z INFO Number of language-specific files num=0
2024-10-16T08:29:42Z INFO Detected config files num=2

main.tf (terraform)

Tests: 31 (SUCCESSES: 0, FAILURES: 31, EXCEPTIONS: 0)
Failures: 31 (HIGH: 0, CRITICAL: 31)

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
────────────────────────────────────────
main.tf:48
via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_10-0-0-0_in"])
────────────────────────────────────────
39 resource "aws_network_acl_rule" "data_subnet_static_rules" {
..
48 [ protocol = each.value.protocol
..
52 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:48
via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_10-0-0-0_out"])
────────────────────────────────────────
39 resource "aws_network_acl_rule" "data_subnet_static_rules" {
..
48 [ protocol = each.value.protocol
..
52 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:48
via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_10-27-136-0_in"])
────────────────────────────────────────
39 resource "aws_network_acl_rule" "data_subnet_static_rules" {
..
48 [ protocol = each.value.protocol
..
52 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:48
via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_10-27-136-0_out"])
────────────────────────────────────────
39 resource "aws_network_acl_rule" "data_subnet_static_rules" {
..
48 [ protocol = each.value.protocol
..
52 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:48
via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_172-16-0-0_in"])
────────────────────────────────────────
39 resource "aws_network_acl_rule" "data_subnet_static_rules" {
..
48 [ protocol = each.value.protocol
..
52 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:48
via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_172-16-0-0_out"])
────────────────────────────────────────
39 resource "aws_network_acl_rule" "data_subnet_static_rules" {
..
48 [ protocol = each.value.protocol
..
52 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:48
via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_192-168-0-0_in"])
────────────────────────────────────────
39 resource "aws_network_acl_rule" "data_subnet_static_rules" {
..
48 [ protocol = each.value.protocol
..
52 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:48
via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_192-168-0-0_out"])
────────────────────────────────────────
39 resource "aws_network_acl_rule" "data_subnet_static_rules" {
..
48 [ protocol = each.value.protocol
..
52 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:48
via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_vpc_cidr_in"])
────────────────────────────────────────
39 resource "aws_network_acl_rule" "data_subnet_static_rules" {
..
48 [ protocol = each.value.protocol
..
52 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:48
via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_vpc_cidr_out"])
────────────────────────────────────────
39 resource "aws_network_acl_rule" "data_subnet_static_rules" {
..
48 [ protocol = each.value.protocol
..
52 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:64
via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_10-0-0-0_in"])
────────────────────────────────────────
55 resource "aws_network_acl_rule" "private_subnet_static_rules" {
..
64 [ protocol = each.value.protocol
..
68 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:64
via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_10-0-0-0_out"])
────────────────────────────────────────
55 resource "aws_network_acl_rule" "private_subnet_static_rules" {
..
64 [ protocol = each.value.protocol
..
68 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:64
via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_10-27-136-0_in"])
────────────────────────────────────────
55 resource "aws_network_acl_rule" "private_subnet_static_rules" {
..
64 [ protocol = each.value.protocol
..
68 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:64
via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_10-27-136-0_out"])
────────────────────────────────────────
55 resource "aws_network_acl_rule" "private_subnet_static_rules" {
..
64 [ protocol = each.value.protocol
..
68 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:64
via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_172-16-0-0_in"])
────────────────────────────────────────
55 resource "aws_network_acl_rule" "private_subnet_static_rules" {
..
64 [ protocol = each.value.protocol
..
68 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:64
via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_172-16-0-0_out"])
────────────────────────────────────────
55 resource "aws_network_acl_rule" "private_subnet_static_rules" {
..
64 [ protocol = each.value.protocol
..
68 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:64
via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_192-168-0-0_in"])
────────────────────────────────────────
55 resource "aws_network_acl_rule" "private_subnet_static_rules" {
..
64 [ protocol = each.value.protocol
..
68 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:64
via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_192-168-0-0_out"])
────────────────────────────────────────
55 resource "aws_network_acl_rule" "private_subnet_static_rules" {
..
64 [ protocol = each.value.protocol
..
68 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:64
via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_vpc_cidr_in"])
────────────────────────────────────────
55 resource "aws_network_acl_rule" "private_subnet_static_rules" {
..
64 [ protocol = each.value.protocol
..
68 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:64
via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_vpc_cidr_out"])
────────────────────────────────────────
55 resource "aws_network_acl_rule" "private_subnet_static_rules" {
..
64 [ protocol = each.value.protocol
..
68 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:94
via main.tf:86-98 (aws_network_acl_rule.public_subnet_internet_access_rules["allow_any_out"])
────────────────────────────────────────
86 resource "aws_network_acl_rule" "public_subnet_internet_access_rules" {
..
94 [ protocol = each.value.protocol
..
98 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:79
via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_10-0-0-0_in"])
────────────────────────────────────────
71 resource "aws_network_acl_rule" "public_subnet_static_rules" {
..
79 [ protocol = each.value.protocol
..
83 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:79
via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_10-0-0-0_out"])
────────────────────────────────────────
71 resource "aws_network_acl_rule" "public_subnet_static_rules" {
..
79 [ protocol = each.value.protocol
..
83 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:79
via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_10-27-136-0_in"])
────────────────────────────────────────
71 resource "aws_network_acl_rule" "public_subnet_static_rules" {
..
79 [ protocol = each.value.protocol
..
83 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:79
via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_10-27-136-0_out"])
────────────────────────────────────────
71 resource "aws_network_acl_rule" "public_subnet_static_rules" {
..
79 [ protocol = each.value.protocol
..
83 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:79
via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_172-16-0-0_in"])
────────────────────────────────────────
71 resource "aws_network_acl_rule" "public_subnet_static_rules" {
..
79 [ protocol = each.value.protocol
..
83 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:79
via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_172-16-0-0_out"])
────────────────────────────────────────
71 resource "aws_network_acl_rule" "public_subnet_static_rules" {
..
79 [ protocol = each.value.protocol
..
83 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:79
via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_192-168-0-0_in"])
────────────────────────────────────────
71 resource "aws_network_acl_rule" "public_subnet_static_rules" {
..
79 [ protocol = each.value.protocol
..
83 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:79
via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_192-168-0-0_out"])
────────────────────────────────────────
71 resource "aws_network_acl_rule" "public_subnet_static_rules" {
..
79 [ protocol = each.value.protocol
..
83 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:79
via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_vpc_cidr_in"])
────────────────────────────────────────
71 resource "aws_network_acl_rule" "public_subnet_static_rules" {
..
79 [ protocol = each.value.protocol
..
83 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:79
via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_vpc_cidr_out"])
────────────────────────────────────────
71 resource "aws_network_acl_rule" "public_subnet_static_rules" {
..
79 [ protocol = each.value.protocol
..
83 }
────────────────────────────────────────

trivy_exitcode=1

</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>

```hcl

*****************************

Checkov will check the following folders:
terraform/modules/vpc-nacls

*****************************

Running Checkov in terraform/modules/vpc-nacls
Excluding the following checks: CKV_GIT_1,CKV_AWS_126,CKV2_AWS_38,CKV2_AWS_39
terraform scan results:

Passed checks: 64, Failed checks: 0, Skipped checks: 17


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/modules/vpc-nacls

*****************************

Running tflint in terraform/modules/vpc-nacls
Excluding the following checks: terraform_unused_declarations
tflint_exitcode=0

Trivy Scan Failed

Show Output
*****************************

Trivy will check the following folders:
terraform/modules/vpc-nacls

*****************************

Running Trivy in terraform/modules/vpc-nacls
2024-10-16T08:29:38Z	INFO	[vulndb] Need to update DB
2024-10-16T08:29:38Z	INFO	[vulndb] Downloading vulnerability DB...
2024-10-16T08:29:38Z	INFO	[vulndb] Downloading artifact...	repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-16T08:29:40Z	INFO	[vulndb] Artifact successfully downloaded	repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-16T08:29:40Z	INFO	[vuln] Vulnerability scanning is enabled
2024-10-16T08:29:40Z	INFO	[misconfig] Misconfiguration scanning is enabled
2024-10-16T08:29:40Z	INFO	[misconfig] Need to update the built-in checks
2024-10-16T08:29:40Z	INFO	[misconfig] Downloading the built-in checks...
156.02 KiB / 156.02 KiB [---------------------------------------------------------] 100.00% ? p/s 0s2024-10-16T08:29:40Z	INFO	[secret] Secret scanning is enabled
2024-10-16T08:29:40Z	INFO	[secret] If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-10-16T08:29:40Z	INFO	[secret] Please see also https://aquasecurity.github.io/trivy/v0.56/docs/scanner/secret#recommendation for faster secret detection
2024-10-16T08:29:41Z	INFO	[terraform scanner] Scanning root module	file_path="."
2024-10-16T08:29:41Z	WARN	[terraform parser] Variable values was not found in the environment or variable files. Evaluating may not work correctly.	module="root" variables="tags_prefix, vpc_name"
2024-10-16T08:29:41Z	ERROR	[terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.	block="data.aws_subnet.subnets_all" value="cty.NilVal"
2024-10-16T08:29:42Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-public-ingress-acl" range="main.tf:44"
2024-10-16T08:29:42Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-public-ingress-acl" range="main.tf:60"
2024-10-16T08:29:42Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-public-ingress-acl" range="main.tf:75"
2024-10-16T08:29:42Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-public-ingress-acl" range="main.tf:90"
2024-10-16T08:29:42Z	INFO	Number of language-specific files	num=0
2024-10-16T08:29:42Z	INFO	Detected config files	num=2

main.tf (terraform)
===================
Tests: 31 (SUCCESSES: 0, FAILURES: 31, EXCEPTIONS: 0)
Failures: 31 (HIGH: 0, CRITICAL: 31)

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
────────────────────────────────────────
 main.tf:48
   via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_10-0-0-0_in"])
────────────────────────────────────────
  39   resource "aws_network_acl_rule" "data_subnet_static_rules" {
  ..   
  48 [   protocol       = each.value.protocol
  ..   
  52   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:48
   via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_10-0-0-0_out"])
────────────────────────────────────────
  39   resource "aws_network_acl_rule" "data_subnet_static_rules" {
  ..   
  48 [   protocol       = each.value.protocol
  ..   
  52   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:48
   via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_10-27-136-0_in"])
────────────────────────────────────────
  39   resource "aws_network_acl_rule" "data_subnet_static_rules" {
  ..   
  48 [   protocol       = each.value.protocol
  ..   
  52   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:48
   via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_10-27-136-0_out"])
────────────────────────────────────────
  39   resource "aws_network_acl_rule" "data_subnet_static_rules" {
  ..   
  48 [   protocol       = each.value.protocol
  ..   
  52   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:48
   via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_172-16-0-0_in"])
────────────────────────────────────────
  39   resource "aws_network_acl_rule" "data_subnet_static_rules" {
  ..   
  48 [   protocol       = each.value.protocol
  ..   
  52   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:48
   via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_172-16-0-0_out"])
────────────────────────────────────────
  39   resource "aws_network_acl_rule" "data_subnet_static_rules" {
  ..   
  48 [   protocol       = each.value.protocol
  ..   
  52   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:48
   via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_192-168-0-0_in"])
────────────────────────────────────────
  39   resource "aws_network_acl_rule" "data_subnet_static_rules" {
  ..   
  48 [   protocol       = each.value.protocol
  ..   
  52   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:48
   via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_192-168-0-0_out"])
────────────────────────────────────────
  39   resource "aws_network_acl_rule" "data_subnet_static_rules" {
  ..   
  48 [   protocol       = each.value.protocol
  ..   
  52   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:48
   via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_vpc_cidr_in"])
────────────────────────────────────────
  39   resource "aws_network_acl_rule" "data_subnet_static_rules" {
  ..   
  48 [   protocol       = each.value.protocol
  ..   
  52   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:48
   via main.tf:39-52 (aws_network_acl_rule.data_subnet_static_rules["allow_vpc_cidr_out"])
────────────────────────────────────────
  39   resource "aws_network_acl_rule" "data_subnet_static_rules" {
  ..   
  48 [   protocol       = each.value.protocol
  ..   
  52   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:64
   via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_10-0-0-0_in"])
────────────────────────────────────────
  55   resource "aws_network_acl_rule" "private_subnet_static_rules" {
  ..   
  64 [   protocol       = each.value.protocol
  ..   
  68   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:64
   via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_10-0-0-0_out"])
────────────────────────────────────────
  55   resource "aws_network_acl_rule" "private_subnet_static_rules" {
  ..   
  64 [   protocol       = each.value.protocol
  ..   
  68   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:64
   via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_10-27-136-0_in"])
────────────────────────────────────────
  55   resource "aws_network_acl_rule" "private_subnet_static_rules" {
  ..   
  64 [   protocol       = each.value.protocol
  ..   
  68   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:64
   via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_10-27-136-0_out"])
────────────────────────────────────────
  55   resource "aws_network_acl_rule" "private_subnet_static_rules" {
  ..   
  64 [   protocol       = each.value.protocol
  ..   
  68   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:64
   via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_172-16-0-0_in"])
────────────────────────────────────────
  55   resource "aws_network_acl_rule" "private_subnet_static_rules" {
  ..   
  64 [   protocol       = each.value.protocol
  ..   
  68   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:64
   via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_172-16-0-0_out"])
────────────────────────────────────────
  55   resource "aws_network_acl_rule" "private_subnet_static_rules" {
  ..   
  64 [   protocol       = each.value.protocol
  ..   
  68   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:64
   via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_192-168-0-0_in"])
────────────────────────────────────────
  55   resource "aws_network_acl_rule" "private_subnet_static_rules" {
  ..   
  64 [   protocol       = each.value.protocol
  ..   
  68   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:64
   via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_192-168-0-0_out"])
────────────────────────────────────────
  55   resource "aws_network_acl_rule" "private_subnet_static_rules" {
  ..   
  64 [   protocol       = each.value.protocol
  ..   
  68   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:64
   via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_vpc_cidr_in"])
────────────────────────────────────────
  55   resource "aws_network_acl_rule" "private_subnet_static_rules" {
  ..   
  64 [   protocol       = each.value.protocol
  ..   
  68   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:64
   via main.tf:55-68 (aws_network_acl_rule.private_subnet_static_rules["allow_vpc_cidr_out"])
────────────────────────────────────────
  55   resource "aws_network_acl_rule" "private_subnet_static_rules" {
  ..   
  64 [   protocol       = each.value.protocol
  ..   
  68   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:94
   via main.tf:86-98 (aws_network_acl_rule.public_subnet_internet_access_rules["allow_any_out"])
────────────────────────────────────────
  86   resource "aws_network_acl_rule" "public_subnet_internet_access_rules" {
  ..   
  94 [   protocol       = each.value.protocol
  ..   
  98   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:79
   via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_10-0-0-0_in"])
────────────────────────────────────────
  71   resource "aws_network_acl_rule" "public_subnet_static_rules" {
  ..   
  79 [   protocol       = each.value.protocol
  ..   
  83   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:79
   via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_10-0-0-0_out"])
────────────────────────────────────────
  71   resource "aws_network_acl_rule" "public_subnet_static_rules" {
  ..   
  79 [   protocol       = each.value.protocol
  ..   
  83   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:79
   via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_10-27-136-0_in"])
────────────────────────────────────────
  71   resource "aws_network_acl_rule" "public_subnet_static_rules" {
  ..   
  79 [   protocol       = each.value.protocol
  ..   
  83   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:79
   via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_10-27-136-0_out"])
────────────────────────────────────────
  71   resource "aws_network_acl_rule" "public_subnet_static_rules" {
  ..   
  79 [   protocol       = each.value.protocol
  ..   
  83   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:79
   via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_172-16-0-0_in"])
────────────────────────────────────────
  71   resource "aws_network_acl_rule" "public_subnet_static_rules" {
  ..   
  79 [   protocol       = each.value.protocol
  ..   
  83   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:79
   via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_172-16-0-0_out"])
────────────────────────────────────────
  71   resource "aws_network_acl_rule" "public_subnet_static_rules" {
  ..   
  79 [   protocol       = each.value.protocol
  ..   
  83   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:79
   via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_192-168-0-0_in"])
────────────────────────────────────────
  71   resource "aws_network_acl_rule" "public_subnet_static_rules" {
  ..   
  79 [   protocol       = each.value.protocol
  ..   
  83   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:79
   via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_192-168-0-0_out"])
────────────────────────────────────────
  71   resource "aws_network_acl_rule" "public_subnet_static_rules" {
  ..   
  79 [   protocol       = each.value.protocol
  ..   
  83   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:79
   via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_vpc_cidr_in"])
────────────────────────────────────────
  71   resource "aws_network_acl_rule" "public_subnet_static_rules" {
  ..   
  79 [   protocol       = each.value.protocol
  ..   
  83   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:79
   via main.tf:71-83 (aws_network_acl_rule.public_subnet_static_rules["allow_vpc_cidr_out"])
────────────────────────────────────────
  71   resource "aws_network_acl_rule" "public_subnet_static_rules" {
  ..   
  79 [   protocol       = each.value.protocol
  ..   
  83   }
────────────────────────────────────────


trivy_exitcode=1

Copy link
Contributor

Trivy Scan Failed

Show Output ```hcl

Trivy will check the following folders:
terraform/modules/vpc-nacls


Running Trivy in terraform/modules/vpc-nacls
2024-10-16T08:30:34Z INFO [vulndb] Need to update DB
2024-10-16T08:30:34Z INFO [vulndb] Downloading vulnerability DB...
2024-10-16T08:30:34Z INFO [vulndb] Downloading artifact... repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-16T08:30:34Z 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: 701.278µs, allowed: 44000/minute\n\n"
2024-10-16T08:30:34Z 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/modules/vpc-nacls

*****************************

Running Checkov in terraform/modules/vpc-nacls
Excluding the following checks: CKV_GIT_1,CKV_AWS_126,CKV2_AWS_38,CKV2_AWS_39
terraform scan results:

Passed checks: 64, Failed checks: 0, Skipped checks: 17


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/modules/vpc-nacls

*****************************

Running tflint in terraform/modules/vpc-nacls
Excluding the following checks: terraform_unused_declarations
tflint_exitcode=0

Trivy Scan Failed

Show Output
*****************************

Trivy will check the following folders:
terraform/modules/vpc-nacls

*****************************

Running Trivy in terraform/modules/vpc-nacls
2024-10-16T08:30:34Z	INFO	[vulndb] Need to update DB
2024-10-16T08:30:34Z	INFO	[vulndb] Downloading vulnerability DB...
2024-10-16T08:30:34Z	INFO	[vulndb] Downloading artifact...	repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-16T08:30:34Z	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: 701.278µs, allowed: 44000/minute\n\n"
2024-10-16T08:30:34Z	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

Copy link
Contributor

Trivy Scan Failed

Show Output ```hcl

Trivy will check the following folders:
terraform/modules/vpc-nacls


Running Trivy in terraform/modules/vpc-nacls
2024-10-16T08:35:29Z INFO [vulndb] Need to update DB
2024-10-16T08:35:29Z INFO [vulndb] Downloading vulnerability DB...
2024-10-16T08:35:29Z INFO [vulndb] Downloading artifact... repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-16T08:35:32Z INFO [vulndb] Artifact successfully downloaded repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-16T08:35:32Z INFO [vuln] Vulnerability scanning is enabled
2024-10-16T08:35:32Z INFO [misconfig] Misconfiguration scanning is enabled
2024-10-16T08:35:32Z INFO [misconfig] Need to update the built-in checks
2024-10-16T08:35:32Z INFO [misconfig] Downloading the built-in checks...
156.02 KiB / 156.02 KiB [------------------------------------------------------] 100.00% ? p/s 100ms2024-10-16T08:35:32Z INFO [secret] Secret scanning is enabled
2024-10-16T08:35:32Z INFO [secret] If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-10-16T08:35:32Z INFO [secret] Please see also https://aquasecurity.github.io/trivy/v0.56/docs/scanner/secret#recommendation for faster secret detection
2024-10-16T08:35:33Z INFO [terraform scanner] Scanning root module file_path="."
2024-10-16T08:35:33Z WARN [terraform parser] Variable values was not found in the environment or variable files. Evaluating may not work correctly. module="root" variables="tags_prefix, vpc_name"
2024-10-16T08:35:33Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="data.aws_subnet.subnets_all" value="cty.NilVal"
2024-10-16T08:35:34Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:35:34Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:35:34Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:35:34Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:35:34Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:35:34Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:35:34Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:35:34Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:35:34Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:35:34Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:35:34Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:35:34Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:35:34Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:35:34Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:35:34Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:35:34Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:35:34Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:35:34Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:35:34Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:35:34Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:35:34Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:90"
2024-10-16T08:35:34Z INFO Number of language-specific files num=0
2024-10-16T08:35:34Z INFO Detected config files num=2

main.tf (terraform)

Tests: 31 (SUCCESSES: 0, FAILURES: 10, EXCEPTIONS: 21)
Failures: 10 (HIGH: 0, CRITICAL: 10)

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
────────────────────────────────────────
main.tf:76
via main.tf:68-80 (aws_network_acl_rule.public_subnet_static_rules["allow_10-0-0-0_in"])
────────────────────────────────────────
68 resource "aws_network_acl_rule" "public_subnet_static_rules" {
..
76 [ protocol = each.value.protocol
..
80 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:76
via main.tf:68-80 (aws_network_acl_rule.public_subnet_static_rules["allow_10-0-0-0_out"])
────────────────────────────────────────
68 resource "aws_network_acl_rule" "public_subnet_static_rules" {
..
76 [ protocol = each.value.protocol
..
80 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:76
via main.tf:68-80 (aws_network_acl_rule.public_subnet_static_rules["allow_10-27-136-0_in"])
────────────────────────────────────────
68 resource "aws_network_acl_rule" "public_subnet_static_rules" {
..
76 [ protocol = each.value.protocol
..
80 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:76
via main.tf:68-80 (aws_network_acl_rule.public_subnet_static_rules["allow_10-27-136-0_out"])
────────────────────────────────────────
68 resource "aws_network_acl_rule" "public_subnet_static_rules" {
..
76 [ protocol = each.value.protocol
..
80 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:76
via main.tf:68-80 (aws_network_acl_rule.public_subnet_static_rules["allow_172-16-0-0_in"])
────────────────────────────────────────
68 resource "aws_network_acl_rule" "public_subnet_static_rules" {
..
76 [ protocol = each.value.protocol
..
80 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:76
via main.tf:68-80 (aws_network_acl_rule.public_subnet_static_rules["allow_172-16-0-0_out"])
────────────────────────────────────────
68 resource "aws_network_acl_rule" "public_subnet_static_rules" {
..
76 [ protocol = each.value.protocol
..
80 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:76
via main.tf:68-80 (aws_network_acl_rule.public_subnet_static_rules["allow_192-168-0-0_in"])
────────────────────────────────────────
68 resource "aws_network_acl_rule" "public_subnet_static_rules" {
..
76 [ protocol = each.value.protocol
..
80 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:76
via main.tf:68-80 (aws_network_acl_rule.public_subnet_static_rules["allow_192-168-0-0_out"])
────────────────────────────────────────
68 resource "aws_network_acl_rule" "public_subnet_static_rules" {
..
76 [ protocol = each.value.protocol
..
80 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:76
via main.tf:68-80 (aws_network_acl_rule.public_subnet_static_rules["allow_vpc_cidr_in"])
────────────────────────────────────────
68 resource "aws_network_acl_rule" "public_subnet_static_rules" {
..
76 [ protocol = each.value.protocol
..
80 }
────────────────────────────────────────

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
────────────────────────────────────────
main.tf:76
via main.tf:68-80 (aws_network_acl_rule.public_subnet_static_rules["allow_vpc_cidr_out"])
────────────────────────────────────────
68 resource "aws_network_acl_rule" "public_subnet_static_rules" {
..
76 [ protocol = each.value.protocol
..
80 }
────────────────────────────────────────

trivy_exitcode=1

</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>

```hcl

*****************************

Checkov will check the following folders:
terraform/modules/vpc-nacls

*****************************

Running Checkov in terraform/modules/vpc-nacls
Excluding the following checks: CKV_GIT_1,CKV_AWS_126,CKV2_AWS_38,CKV2_AWS_39
terraform scan results:

Passed checks: 64, Failed checks: 0, Skipped checks: 17


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/modules/vpc-nacls

*****************************

Running tflint in terraform/modules/vpc-nacls
Excluding the following checks: terraform_unused_declarations
tflint_exitcode=0

Trivy Scan Failed

Show Output
*****************************

Trivy will check the following folders:
terraform/modules/vpc-nacls

*****************************

Running Trivy in terraform/modules/vpc-nacls
2024-10-16T08:35:29Z	INFO	[vulndb] Need to update DB
2024-10-16T08:35:29Z	INFO	[vulndb] Downloading vulnerability DB...
2024-10-16T08:35:29Z	INFO	[vulndb] Downloading artifact...	repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-16T08:35:32Z	INFO	[vulndb] Artifact successfully downloaded	repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-16T08:35:32Z	INFO	[vuln] Vulnerability scanning is enabled
2024-10-16T08:35:32Z	INFO	[misconfig] Misconfiguration scanning is enabled
2024-10-16T08:35:32Z	INFO	[misconfig] Need to update the built-in checks
2024-10-16T08:35:32Z	INFO	[misconfig] Downloading the built-in checks...
156.02 KiB / 156.02 KiB [------------------------------------------------------] 100.00% ? p/s 100ms2024-10-16T08:35:32Z	INFO	[secret] Secret scanning is enabled
2024-10-16T08:35:32Z	INFO	[secret] If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-10-16T08:35:32Z	INFO	[secret] Please see also https://aquasecurity.github.io/trivy/v0.56/docs/scanner/secret#recommendation for faster secret detection
2024-10-16T08:35:33Z	INFO	[terraform scanner] Scanning root module	file_path="."
2024-10-16T08:35:33Z	WARN	[terraform parser] Variable values was not found in the environment or variable files. Evaluating may not work correctly.	module="root" variables="tags_prefix, vpc_name"
2024-10-16T08:35:33Z	ERROR	[terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.	block="data.aws_subnet.subnets_all" value="cty.NilVal"
2024-10-16T08:35:34Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:35:34Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:35:34Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:35:34Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:35:34Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:35:34Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:35:34Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:35:34Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:35:34Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:35:34Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:35:34Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:35:34Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:35:34Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:35:34Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:35:34Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:35:34Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:35:34Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:35:34Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:35:34Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:35:34Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:35:34Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:90"
2024-10-16T08:35:34Z	INFO	Number of language-specific files	num=0
2024-10-16T08:35:34Z	INFO	Detected config files	num=2

main.tf (terraform)
===================
Tests: 31 (SUCCESSES: 0, FAILURES: 10, EXCEPTIONS: 21)
Failures: 10 (HIGH: 0, CRITICAL: 10)

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
────────────────────────────────────────
 main.tf:76
   via main.tf:68-80 (aws_network_acl_rule.public_subnet_static_rules["allow_10-0-0-0_in"])
────────────────────────────────────────
  68   resource "aws_network_acl_rule" "public_subnet_static_rules" {
  ..   
  76 [   protocol       = each.value.protocol
  ..   
  80   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:76
   via main.tf:68-80 (aws_network_acl_rule.public_subnet_static_rules["allow_10-0-0-0_out"])
────────────────────────────────────────
  68   resource "aws_network_acl_rule" "public_subnet_static_rules" {
  ..   
  76 [   protocol       = each.value.protocol
  ..   
  80   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:76
   via main.tf:68-80 (aws_network_acl_rule.public_subnet_static_rules["allow_10-27-136-0_in"])
────────────────────────────────────────
  68   resource "aws_network_acl_rule" "public_subnet_static_rules" {
  ..   
  76 [   protocol       = each.value.protocol
  ..   
  80   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:76
   via main.tf:68-80 (aws_network_acl_rule.public_subnet_static_rules["allow_10-27-136-0_out"])
────────────────────────────────────────
  68   resource "aws_network_acl_rule" "public_subnet_static_rules" {
  ..   
  76 [   protocol       = each.value.protocol
  ..   
  80   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:76
   via main.tf:68-80 (aws_network_acl_rule.public_subnet_static_rules["allow_172-16-0-0_in"])
────────────────────────────────────────
  68   resource "aws_network_acl_rule" "public_subnet_static_rules" {
  ..   
  76 [   protocol       = each.value.protocol
  ..   
  80   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:76
   via main.tf:68-80 (aws_network_acl_rule.public_subnet_static_rules["allow_172-16-0-0_out"])
────────────────────────────────────────
  68   resource "aws_network_acl_rule" "public_subnet_static_rules" {
  ..   
  76 [   protocol       = each.value.protocol
  ..   
  80   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:76
   via main.tf:68-80 (aws_network_acl_rule.public_subnet_static_rules["allow_192-168-0-0_in"])
────────────────────────────────────────
  68   resource "aws_network_acl_rule" "public_subnet_static_rules" {
  ..   
  76 [   protocol       = each.value.protocol
  ..   
  80   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:76
   via main.tf:68-80 (aws_network_acl_rule.public_subnet_static_rules["allow_192-168-0-0_out"])
────────────────────────────────────────
  68   resource "aws_network_acl_rule" "public_subnet_static_rules" {
  ..   
  76 [   protocol       = each.value.protocol
  ..   
  80   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:76
   via main.tf:68-80 (aws_network_acl_rule.public_subnet_static_rules["allow_vpc_cidr_in"])
────────────────────────────────────────
  68   resource "aws_network_acl_rule" "public_subnet_static_rules" {
  ..   
  76 [   protocol       = each.value.protocol
  ..   
  80   }
────────────────────────────────────────


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
────────────────────────────────────────
 main.tf:76
   via main.tf:68-80 (aws_network_acl_rule.public_subnet_static_rules["allow_vpc_cidr_out"])
────────────────────────────────────────
  68   resource "aws_network_acl_rule" "public_subnet_static_rules" {
  ..   
  76 [   protocol       = each.value.protocol
  ..   
  80   }
────────────────────────────────────────


trivy_exitcode=1

Copy link
Contributor

Trivy Scan Success

Show Output ```hcl

Trivy will check the following folders:
terraform/modules/vpc-nacls


Running Trivy in terraform/modules/vpc-nacls
2024-10-16T08:37:57Z INFO [vulndb] Need to update DB
2024-10-16T08:37:57Z INFO [vulndb] Downloading vulnerability DB...
2024-10-16T08:37:57Z INFO [vulndb] Downloading artifact... repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-16T08:37:59Z INFO [vulndb] Artifact successfully downloaded repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-16T08:37:59Z INFO [vuln] Vulnerability scanning is enabled
2024-10-16T08:37:59Z INFO [misconfig] Misconfiguration scanning is enabled
2024-10-16T08:37:59Z INFO [misconfig] Need to update the built-in checks
2024-10-16T08:37:59Z INFO [misconfig] Downloading the built-in checks...
156.02 KiB / 156.02 KiB [---------------------------------------------------------] 100.00% ? p/s 0s2024-10-16T08:37:59Z INFO [secret] Secret scanning is enabled
2024-10-16T08:37:59Z INFO [secret] If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-10-16T08:37:59Z INFO [secret] Please see also https://aquasecurity.github.io/trivy/v0.56/docs/scanner/secret#recommendation for faster secret detection
2024-10-16T08:38:00Z INFO [terraform scanner] Scanning root module file_path="."
2024-10-16T08:38:00Z WARN [terraform parser] Variable values was not found in the environment or variable files. Evaluating may not work correctly. module="root" variables="tags_prefix, vpc_name"
2024-10-16T08:38:00Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="data.aws_subnet.subnets_all" value="cty.NilVal"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T08:38:01Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:91"
2024-10-16T08:38:01Z INFO Number of language-specific files num=0
2024-10-16T08:38:01Z INFO Detected config files num=2
trivy_exitcode=0

</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>

```hcl

*****************************

Checkov will check the following folders:
terraform/modules/vpc-nacls

*****************************

Running Checkov in terraform/modules/vpc-nacls
Excluding the following checks: CKV_GIT_1,CKV_AWS_126,CKV2_AWS_38,CKV2_AWS_39
terraform scan results:

Passed checks: 64, Failed checks: 0, Skipped checks: 17


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/modules/vpc-nacls

*****************************

Running tflint in terraform/modules/vpc-nacls
Excluding the following checks: terraform_unused_declarations
tflint_exitcode=0

Trivy Scan Success

Show Output
*****************************

Trivy will check the following folders:
terraform/modules/vpc-nacls

*****************************

Running Trivy in terraform/modules/vpc-nacls
2024-10-16T08:37:57Z	INFO	[vulndb] Need to update DB
2024-10-16T08:37:57Z	INFO	[vulndb] Downloading vulnerability DB...
2024-10-16T08:37:57Z	INFO	[vulndb] Downloading artifact...	repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-16T08:37:59Z	INFO	[vulndb] Artifact successfully downloaded	repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-16T08:37:59Z	INFO	[vuln] Vulnerability scanning is enabled
2024-10-16T08:37:59Z	INFO	[misconfig] Misconfiguration scanning is enabled
2024-10-16T08:37:59Z	INFO	[misconfig] Need to update the built-in checks
2024-10-16T08:37:59Z	INFO	[misconfig] Downloading the built-in checks...
156.02 KiB / 156.02 KiB [---------------------------------------------------------] 100.00% ? p/s 0s2024-10-16T08:37:59Z	INFO	[secret] Secret scanning is enabled
2024-10-16T08:37:59Z	INFO	[secret] If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-10-16T08:37:59Z	INFO	[secret] Please see also https://aquasecurity.github.io/trivy/v0.56/docs/scanner/secret#recommendation for faster secret detection
2024-10-16T08:38:00Z	INFO	[terraform scanner] Scanning root module	file_path="."
2024-10-16T08:38:00Z	WARN	[terraform parser] Variable values was not found in the environment or variable files. Evaluating may not work correctly.	module="root" variables="tags_prefix, vpc_name"
2024-10-16T08:38:00Z	ERROR	[terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.	block="data.aws_subnet.subnets_all" value="cty.NilVal"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T08:38:01Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:91"
2024-10-16T08:38:01Z	INFO	Number of language-specific files	num=0
2024-10-16T08:38:01Z	INFO	Detected config files	num=2
trivy_exitcode=0

dms1981
dms1981 previously approved these changes Oct 16, 2024
Copy link
Contributor

@dms1981 dms1981 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGMT - thanks!

Copy link
Contributor

Trivy Scan Success

Show Output ```hcl

Trivy will check the following folders:
terraform/modules/vpc-nacls


Running Trivy in terraform/modules/vpc-nacls
2024-10-16T10:32:51Z INFO [vulndb] Need to update DB
2024-10-16T10:32:51Z INFO [vulndb] Downloading vulnerability DB...
2024-10-16T10:32:51Z INFO [vulndb] Downloading artifact... repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-16T10:32:53Z INFO [vulndb] Artifact successfully downloaded repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-16T10:32:53Z INFO [vuln] Vulnerability scanning is enabled
2024-10-16T10:32:53Z INFO [misconfig] Misconfiguration scanning is enabled
2024-10-16T10:32:53Z INFO [misconfig] Need to update the built-in checks
2024-10-16T10:32:53Z INFO [misconfig] Downloading the built-in checks...
156.02 KiB / 156.02 KiB [---------------------------------------------------------] 100.00% ? p/s 0s2024-10-16T10:32:53Z INFO [secret] Secret scanning is enabled
2024-10-16T10:32:53Z INFO [secret] If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-10-16T10:32:53Z INFO [secret] Please see also https://aquasecurity.github.io/trivy/v0.56/docs/scanner/secret#recommendation for faster secret detection
2024-10-16T10:32:54Z INFO [terraform scanner] Scanning root module file_path="."
2024-10-16T10:32:54Z WARN [terraform parser] Variable values was not found in the environment or variable files. Evaluating may not work correctly. module="root" variables="tags_prefix, vpc_name"
2024-10-16T10:32:54Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="data.aws_subnet.subnets_all" value="cty.NilVal"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T10:32:55Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:91"
2024-10-16T10:32:55Z INFO Number of language-specific files num=0
2024-10-16T10:32:55Z INFO Detected config files num=2
trivy_exitcode=0

</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>

```hcl

*****************************

Checkov will check the following folders:
terraform/modules/vpc-nacls

*****************************

Running Checkov in terraform/modules/vpc-nacls
Excluding the following checks: CKV_GIT_1,CKV_AWS_126,CKV2_AWS_38,CKV2_AWS_39
terraform scan results:

Passed checks: 64, Failed checks: 0, Skipped checks: 17


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/modules/vpc-nacls

*****************************

Running tflint in terraform/modules/vpc-nacls
Excluding the following checks: terraform_unused_declarations
tflint_exitcode=0

Trivy Scan Success

Show Output
*****************************

Trivy will check the following folders:
terraform/modules/vpc-nacls

*****************************

Running Trivy in terraform/modules/vpc-nacls
2024-10-16T10:32:51Z	INFO	[vulndb] Need to update DB
2024-10-16T10:32:51Z	INFO	[vulndb] Downloading vulnerability DB...
2024-10-16T10:32:51Z	INFO	[vulndb] Downloading artifact...	repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-16T10:32:53Z	INFO	[vulndb] Artifact successfully downloaded	repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-16T10:32:53Z	INFO	[vuln] Vulnerability scanning is enabled
2024-10-16T10:32:53Z	INFO	[misconfig] Misconfiguration scanning is enabled
2024-10-16T10:32:53Z	INFO	[misconfig] Need to update the built-in checks
2024-10-16T10:32:53Z	INFO	[misconfig] Downloading the built-in checks...
156.02 KiB / 156.02 KiB [---------------------------------------------------------] 100.00% ? p/s 0s2024-10-16T10:32:53Z	INFO	[secret] Secret scanning is enabled
2024-10-16T10:32:53Z	INFO	[secret] If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-10-16T10:32:53Z	INFO	[secret] Please see also https://aquasecurity.github.io/trivy/v0.56/docs/scanner/secret#recommendation for faster secret detection
2024-10-16T10:32:54Z	INFO	[terraform scanner] Scanning root module	file_path="."
2024-10-16T10:32:54Z	WARN	[terraform parser] Variable values was not found in the environment or variable files. Evaluating may not work correctly.	module="root" variables="tags_prefix, vpc_name"
2024-10-16T10:32:54Z	ERROR	[terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.	block="data.aws_subnet.subnets_all" value="cty.NilVal"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T10:32:55Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:91"
2024-10-16T10:32:55Z	INFO	Number of language-specific files	num=0
2024-10-16T10:32:55Z	INFO	Detected config files	num=2
trivy_exitcode=0

Copy link
Contributor

Trivy Scan Success

Show Output ```hcl

Trivy will check the following folders:
terraform/modules/vpc-nacls


Running Trivy in terraform/modules/vpc-nacls
2024-10-16T11:03:02Z INFO [vulndb] Need to update DB
2024-10-16T11:03:02Z INFO [vulndb] Downloading vulnerability DB...
2024-10-16T11:03:02Z INFO [vulndb] Downloading artifact... repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-16T11:03:04Z INFO [vulndb] Artifact successfully downloaded repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-16T11:03:04Z INFO [vuln] Vulnerability scanning is enabled
2024-10-16T11:03:04Z INFO [misconfig] Misconfiguration scanning is enabled
2024-10-16T11:03:04Z INFO [misconfig] Need to update the built-in checks
2024-10-16T11:03:04Z INFO [misconfig] Downloading the built-in checks...
2024-10-16T11:03:04Z ERROR [misconfig] Falling back to embedded checks err="failed to download built-in policies: download error: oci download error: failed to fetch the layer: GET https://ghcr.io/v2/aquasecurity/trivy-checks/blobs/sha256:16957b935ef82529bc26f3ceeeb60d798c90ef142d25e3715ab4478b204ed1bb: TOOMANYREQUESTS: retry-after: 929.415µs, allowed: 44000/minute"
2024-10-16T11:03:04Z INFO [secret] Secret scanning is enabled
2024-10-16T11:03:04Z INFO [secret] If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-10-16T11:03:04Z INFO [secret] Please see also https://aquasecurity.github.io/trivy/v0.56/docs/scanner/secret#recommendation for faster secret detection
2024-10-16T11:03:05Z INFO [terraform scanner] Scanning root module file_path="."
2024-10-16T11:03:05Z WARN [terraform parser] Variable values was not found in the environment or variable files. Evaluating may not work correctly. module="root" variables="tags_prefix, vpc_name"
2024-10-16T11:03:05Z ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="data.aws_subnet.subnets_all" value="cty.NilVal"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T11:03:06Z INFO [terraform executor] Ignore finding rule="aws-ec2-no-excessive-port-access" range="main.tf:91"
2024-10-16T11:03:06Z INFO Number of language-specific files num=0
2024-10-16T11:03:06Z INFO Detected config files num=2
trivy_exitcode=0

</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>

```hcl

*****************************

Checkov will check the following folders:
terraform/modules/vpc-nacls

*****************************

Running Checkov in terraform/modules/vpc-nacls
Excluding the following checks: CKV_GIT_1,CKV_AWS_126,CKV2_AWS_38,CKV2_AWS_39
terraform scan results:

Passed checks: 64, Failed checks: 0, Skipped checks: 17


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/modules/vpc-nacls

*****************************

Running tflint in terraform/modules/vpc-nacls
Excluding the following checks: terraform_unused_declarations
tflint_exitcode=0

Trivy Scan Success

Show Output
*****************************

Trivy will check the following folders:
terraform/modules/vpc-nacls

*****************************

Running Trivy in terraform/modules/vpc-nacls
2024-10-16T11:03:02Z	INFO	[vulndb] Need to update DB
2024-10-16T11:03:02Z	INFO	[vulndb] Downloading vulnerability DB...
2024-10-16T11:03:02Z	INFO	[vulndb] Downloading artifact...	repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-16T11:03:04Z	INFO	[vulndb] Artifact successfully downloaded	repo="ghcr.io/aquasecurity/trivy-db:2"
2024-10-16T11:03:04Z	INFO	[vuln] Vulnerability scanning is enabled
2024-10-16T11:03:04Z	INFO	[misconfig] Misconfiguration scanning is enabled
2024-10-16T11:03:04Z	INFO	[misconfig] Need to update the built-in checks
2024-10-16T11:03:04Z	INFO	[misconfig] Downloading the built-in checks...
2024-10-16T11:03:04Z	ERROR	[misconfig] Falling back to embedded checks	err="failed to download built-in policies: download error: oci download error: failed to fetch the layer: GET https://ghcr.io/v2/aquasecurity/trivy-checks/blobs/sha256:16957b935ef82529bc26f3ceeeb60d798c90ef142d25e3715ab4478b204ed1bb: TOOMANYREQUESTS: retry-after: 929.415µs, allowed: 44000/minute"
2024-10-16T11:03:04Z	INFO	[secret] Secret scanning is enabled
2024-10-16T11:03:04Z	INFO	[secret] If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-10-16T11:03:04Z	INFO	[secret] Please see also https://aquasecurity.github.io/trivy/v0.56/docs/scanner/secret#recommendation for faster secret detection
2024-10-16T11:03:05Z	INFO	[terraform scanner] Scanning root module	file_path="."
2024-10-16T11:03:05Z	WARN	[terraform parser] Variable values was not found in the environment or variable files. Evaluating may not work correctly.	module="root" variables="tags_prefix, vpc_name"
2024-10-16T11:03:05Z	ERROR	[terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable.	block="data.aws_subnet.subnets_all" value="cty.NilVal"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:47"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:62"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:77"
2024-10-16T11:03:06Z	INFO	[terraform executor] Ignore finding	rule="aws-ec2-no-excessive-port-access" range="main.tf:91"
2024-10-16T11:03:06Z	INFO	Number of language-specific files	num=0
2024-10-16T11:03:06Z	INFO	Detected config files	num=2
trivy_exitcode=0

Copy link
Contributor

@ewastempel ewastempel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for adding the comments

@richgreen-moj richgreen-moj added this pull request to the merge queue Oct 16, 2024
Merged via the queue into main with commit 9141d13 Oct 16, 2024
12 checks passed
@richgreen-moj richgreen-moj deleted the bug/8244-static-analysis branch October 16, 2024 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants