You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Trivy will check the following folders:
terraform/environments/cdpt-ifs
Running Trivy in terraform/environments/cdpt-ifs
2024-07-04T11:36:38Z INFO Need to update DB
2024-07-04T11:36:38Z INFO Downloading DB... repository="ghcr.io/aquasecurity/trivy-db:2"
2024-07-04T11:36:40Z INFO Vulnerability scanning is enabled
2024-07-04T11:36:40Z INFO Misconfiguration scanning is enabled
2024-07-04T11:36:40Z INFO Need to update the built-in policies
2024-07-04T11:36:40Z INFO Downloading the built-in policies...
74.86 KiB / 74.86 KiB [-----------------------------------------------------------] 100.00% ? p/s 0s2024-07-04T11:36:40Z INFO Secret scanning is enabled
2024-07-04T11:36:40Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-04T11:36:40Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection
2024-07-04T11:36:42Z INFO Number of language-specific files num=0
2024-07-04T11:36:42Z INFO Detected config files num=9
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33 resource "aws_security_group" "db" {
..
47 [ cidr_blocks = ["0.0.0.0/0"]
..
49 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349
via ecs.tf:344-350 (egress)
via ecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323 resource "aws_security_group" "cluster_ec2" {
...
349 [ cidr_blocks = ["0.0.0.0/0"]
...
358 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489
via ecs.tf:485-490 (egress)
via ecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473 resource "aws_security_group" "ecs_service" {
...
489 [ cidr_blocks = ["0.0.0.0/0"]
...
491 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
202 [ cidr_blocks = lookup(egress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
190 [ cidr_blocks = lookup(ingress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152
via loadbalancer.tf:147-153 (egress)
via loadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134 resource "aws_security_group" "ifs_lb_sc" {
...
152 [ cidr_blocks = ["0.0.0.0/0"]
...
154 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174
via loadbalancer.tf:169-175 (egress)
via loadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156 resource "aws_security_group" "ifs_target_sc" {
...
174 [ cidr_blocks = ["0.0.0.0/0"]
...
176 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running tflint in terraform/environments/cdpt-ifs
Excluding the following checks: terraform_unused_declarations
Failed to load configurations; terraform/environments/cdpt-ifs/monitoring.tf:11,56-57: Unclosed configuration block; There is no closing brace for this block before the end of the file. This may be caused by incorrect brace nesting elsewhere in this file.:
�[31mError�[0m:Unclosedconfigurationblockonterraform/environments/cdpt-ifs/monitoring.tfline11, inresource"aws_cloudwatch_metric_alarm""lb_5xx_errors":11:resource"aws_cloudwatch_metric_alarm""lb_5xx_errors" �[1;4m{�[0m
There is no closing brace forthisblockbeforetheendofthefile.Thismaybecausedbyincorrectbracenestingelsewhereinthisfile.
tflint_exitcode=1
Trivy Scan Failed
Show Output
*****************************
Trivy will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running Trivy in terraform/environments/cdpt-ifs
2024-07-04T11:36:38Z INFO Need to update DB
2024-07-04T11:36:38Z INFO Downloading DB...repository="ghcr.io/aquasecurity/trivy-db:2"2024-07-04T11:36:40Z INFO Vulnerability scanning is enabled
2024-07-04T11:36:40Z INFO Misconfiguration scanning is enabled
2024-07-04T11:36:40Z INFO Need to update the built-in policies
2024-07-04T11:36:40Z INFO Downloading the built-in policies...74.86 KiB /74.86 KiB [-----------------------------------------------------------] 100.00%? p/s 0s2024-07-04T11:36:40Z INFO Secret scanning is enabled
2024-07-04T11:36:40Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-04T11:36:40Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection2024-07-04T11:36:42Z INFO Number of language-specific files num=02024-07-04T11:36:42Z INFO Detected config files num=9
database.tf (terraform)
=======================
Tests:3 (SUCCESSES:1, FAILURES:2, EXCEPTIONS:0)
Failures:2 (HIGH:1, CRITICAL:1)
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
See https://avd.aquasec.com/misconfig/avd-aws-0080
────────────────────────────────────────
database.tf:5-20
────────────────────────────────────────
5 ┌ resource"aws_db_instance""database" {
6 │ allocated_storage=local.application_data.accounts[local.environment].db_allocated_storage7 │ storage_type="gp2"8 │ engine="sqlserver-web"9 │ engine_version="14.00.3381.3.v1"10 │ instance_class=local.application_data.accounts[local.environment].db_instance_class11 │ identifier=local.application_data.accounts[local.environment].db_instance_identifier12 │ username=local.application_data.accounts[local.environment].db_user13 └ password=aws_secretsmanager_secret_version.dbase_password.secret_string..
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33resource"aws_security_group""db" {
..47 [ cidr_blocks = ["0.0.0.0/0"]
..49 }
────────────────────────────────────────
ecs.tf (terraform)
==================Tests:75 (SUCCESSES:5, FAILURES:2, EXCEPTIONS:68)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349viaecs.tf:344-350 (egress)
viaecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323resource"aws_security_group""cluster_ec2" {
...349 [ cidr_blocks = ["0.0.0.0/0"]
...358 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489viaecs.tf:485-490 (egress)
viaecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473resource"aws_security_group""ecs_service" {
...489 [ cidr_blocks = ["0.0.0.0/0"]
...491 }
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-bastion-linux?ref=v4.2.1/main.tf (terraform)
==========================================================================================================Tests:16 (SUCCESSES:5, FAILURES:0, EXCEPTIONS:11)
Failures:0 (HIGH:0, CRITICAL:0)
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf (terraform)
===========================================================================================================================================
Tests:7 (SUCCESSES:3, FAILURES:2, EXCEPTIONS:2)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...202 [ cidr_blocks =lookup(egress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...190 [ cidr_blocks =lookup(ingress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
loadbalancer.tf (terraform)
===========================
Tests:6 (SUCCESSES:3, FAILURES:3, EXCEPTIONS:0)
Failures:3 (HIGH:0, CRITICAL:3)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152vialoadbalancer.tf:147-153 (egress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...152 [ cidr_blocks = ["0.0.0.0/0"]
...154 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174vialoadbalancer.tf:169-175 (egress)
vialoadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156resource"aws_security_group""ifs_target_sc" {
...174 [ cidr_blocks = ["0.0.0.0/0"]
...176 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
loadbalancer.tf:144vialoadbalancer.tf:139-145 (ingress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...144 [ cidr_blocks = ["188.214.15.75/32", "192.168.5.101/32", "81.134.202.29/32", "79.152.189.104/32", "179.50.12.212/32", "188.172.252.34/32", "194.33.192.0/25", "194.33.193.0/25", "194.33.196.0/25", "194.33.197.0/25", "195.59.75.0/24", "201.33.21.5/32", "213.121.161.112/28", "52.67.148.55/32", "54.94.206.111/32", "178.248.34.42/32", "178.248.34.43/32", "178.248.34.44/32", "178.248.34.45/32", "178.248.34.46/32", "178.248.34.47/32", "89.32.121.144/32", "185.191.249.100/32", "2.138.20.8/32", "18.169.147.172/32", "35.176.93.186/32", "18.130.148.126/32", "35.176.148.126/32", "51.149.250.0/24", "51.149.249.0/29", "194.33.249.0/29", "51.149.249.32/29", "194.33.248.0/29", "20.49.214.199/32", "20.49.214.228/32", "20.26.11.71/32", "20.26.11.108/32", "128.77.75.128/26"]
...154 }
────────────────────────────────────────
trivy_exitcode=1
Trivy will check the following folders:
terraform/environments/cdpt-ifs
Running Trivy in terraform/environments/cdpt-ifs
2024-07-04T11:38:05Z INFO Need to update DB
2024-07-04T11:38:05Z INFO Downloading DB... repository="ghcr.io/aquasecurity/trivy-db:2"
2024-07-04T11:38:07Z INFO Vulnerability scanning is enabled
2024-07-04T11:38:07Z INFO Misconfiguration scanning is enabled
2024-07-04T11:38:07Z INFO Need to update the built-in policies
2024-07-04T11:38:07Z INFO Downloading the built-in policies...
74.86 KiB / 74.86 KiB [-----------------------------------------------------------] 100.00% ? p/s 0s2024-07-04T11:38:07Z INFO Secret scanning is enabled
2024-07-04T11:38:07Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-04T11:38:07Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection
2024-07-04T11:38:09Z INFO Number of language-specific files num=0
2024-07-04T11:38:09Z INFO Detected config files num=10
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33 resource "aws_security_group" "db" {
..
47 [ cidr_blocks = ["0.0.0.0/0"]
..
49 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349
via ecs.tf:344-350 (egress)
via ecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323 resource "aws_security_group" "cluster_ec2" {
...
349 [ cidr_blocks = ["0.0.0.0/0"]
...
358 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489
via ecs.tf:485-490 (egress)
via ecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473 resource "aws_security_group" "ecs_service" {
...
489 [ cidr_blocks = ["0.0.0.0/0"]
...
491 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
202 [ cidr_blocks = lookup(egress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
190 [ cidr_blocks = lookup(ingress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152
via loadbalancer.tf:147-153 (egress)
via loadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134 resource "aws_security_group" "ifs_lb_sc" {
...
152 [ cidr_blocks = ["0.0.0.0/0"]
...
154 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174
via loadbalancer.tf:169-175 (egress)
via loadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156 resource "aws_security_group" "ifs_target_sc" {
...
174 [ cidr_blocks = ["0.0.0.0/0"]
...
176 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running tflint in terraform/environments/cdpt-ifs
Excluding the following checks: terraform_unused_declarations
7issue(s) found:
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 121:121:value="${aws_db_instance.database.address}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 125:125:value="${aws_db_instance.database.username}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 129:129:value="${local.application_data.accounts[local.environment].db_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 133:133:value="${local.application_data.accounts[local.environment].client_id}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 137:137:value="${local.application_data.accounts[local.environment].env_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 406:406:Name="${local.application_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Missing version constraint for provider "random" in `required_providers` (terraform_required_providers)
on terraform/environments/cdpt-ifs/secrets.tf line 5:5:resource"random_password""password_long" {
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_required_providers.mdtflint_exitcode=2
Trivy Scan Failed
Show Output
*****************************
Trivy will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running Trivy in terraform/environments/cdpt-ifs
2024-07-04T11:38:05Z INFO Need to update DB
2024-07-04T11:38:05Z INFO Downloading DB...repository="ghcr.io/aquasecurity/trivy-db:2"2024-07-04T11:38:07Z INFO Vulnerability scanning is enabled
2024-07-04T11:38:07Z INFO Misconfiguration scanning is enabled
2024-07-04T11:38:07Z INFO Need to update the built-in policies
2024-07-04T11:38:07Z INFO Downloading the built-in policies...74.86 KiB /74.86 KiB [-----------------------------------------------------------] 100.00%? p/s 0s2024-07-04T11:38:07Z INFO Secret scanning is enabled
2024-07-04T11:38:07Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-04T11:38:07Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection2024-07-04T11:38:09Z INFO Number of language-specific files num=02024-07-04T11:38:09Z INFO Detected config files num=10
database.tf (terraform)
=======================
Tests:3 (SUCCESSES:1, FAILURES:2, EXCEPTIONS:0)
Failures:2 (HIGH:1, CRITICAL:1)
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
See https://avd.aquasec.com/misconfig/avd-aws-0080
────────────────────────────────────────
database.tf:5-20
────────────────────────────────────────
5 ┌ resource"aws_db_instance""database" {
6 │ allocated_storage=local.application_data.accounts[local.environment].db_allocated_storage7 │ storage_type="gp2"8 │ engine="sqlserver-web"9 │ engine_version="14.00.3381.3.v1"10 │ instance_class=local.application_data.accounts[local.environment].db_instance_class11 │ identifier=local.application_data.accounts[local.environment].db_instance_identifier12 │ username=local.application_data.accounts[local.environment].db_user13 └ password=aws_secretsmanager_secret_version.dbase_password.secret_string..
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33resource"aws_security_group""db" {
..47 [ cidr_blocks = ["0.0.0.0/0"]
..49 }
────────────────────────────────────────
ecs.tf (terraform)
==================Tests:75 (SUCCESSES:5, FAILURES:2, EXCEPTIONS:68)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349viaecs.tf:344-350 (egress)
viaecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323resource"aws_security_group""cluster_ec2" {
...349 [ cidr_blocks = ["0.0.0.0/0"]
...358 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489viaecs.tf:485-490 (egress)
viaecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473resource"aws_security_group""ecs_service" {
...489 [ cidr_blocks = ["0.0.0.0/0"]
...491 }
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-bastion-linux?ref=v4.2.1/main.tf (terraform)
==========================================================================================================Tests:16 (SUCCESSES:5, FAILURES:0, EXCEPTIONS:11)
Failures:0 (HIGH:0, CRITICAL:0)
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf (terraform)
===========================================================================================================================================
Tests:7 (SUCCESSES:3, FAILURES:2, EXCEPTIONS:2)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...202 [ cidr_blocks =lookup(egress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...190 [ cidr_blocks =lookup(ingress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
loadbalancer.tf (terraform)
===========================
Tests:6 (SUCCESSES:3, FAILURES:3, EXCEPTIONS:0)
Failures:3 (HIGH:0, CRITICAL:3)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152vialoadbalancer.tf:147-153 (egress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...152 [ cidr_blocks = ["0.0.0.0/0"]
...154 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174vialoadbalancer.tf:169-175 (egress)
vialoadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156resource"aws_security_group""ifs_target_sc" {
...174 [ cidr_blocks = ["0.0.0.0/0"]
...176 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
loadbalancer.tf:144vialoadbalancer.tf:139-145 (ingress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...144 [ cidr_blocks = ["188.214.15.75/32", "192.168.5.101/32", "81.134.202.29/32", "79.152.189.104/32", "179.50.12.212/32", "188.172.252.34/32", "194.33.192.0/25", "194.33.193.0/25", "194.33.196.0/25", "194.33.197.0/25", "195.59.75.0/24", "201.33.21.5/32", "213.121.161.112/28", "52.67.148.55/32", "54.94.206.111/32", "178.248.34.42/32", "178.248.34.43/32", "178.248.34.44/32", "178.248.34.45/32", "178.248.34.46/32", "178.248.34.47/32", "89.32.121.144/32", "185.191.249.100/32", "2.138.20.8/32", "18.169.147.172/32", "35.176.93.186/32", "18.130.148.126/32", "35.176.148.126/32", "51.149.250.0/24", "51.149.249.0/29", "194.33.249.0/29", "51.149.249.32/29", "194.33.248.0/29", "20.49.214.199/32", "20.49.214.228/32", "20.26.11.71/32", "20.26.11.108/32", "128.77.75.128/26"]
...154 }
────────────────────────────────────────
monitoring.tf (terraform)
=========================
Tests:2 (SUCCESSES:1, FAILURES:1, EXCEPTIONS:0)
Failures:1 (HIGH:1, CRITICAL:0)
HIGH:Topicdoesnothaveencryptionenabled.
════════════════════════════════════════
Topicsshouldbeencryptedtoprotecttheircontents.Seehttps://avd.aquasec.com/misconfig/avd-aws-0095
────────────────────────────────────────
monitoring.tf:1-3
────────────────────────────────────────
1 ┌ resource"aws_sns_topic""lb_alarm_topic" {
2 │ name ="lb_alarm_topic"3 └ }
────────────────────────────────────────
trivy_exitcode=1
Trivy will check the following folders:
terraform/environments/cdpt-ifs
Running Trivy in terraform/environments/cdpt-ifs
2024-07-04T11:45:16Z INFO Need to update DB
2024-07-04T11:45:16Z INFO Downloading DB... repository="ghcr.io/aquasecurity/trivy-db:2"
2024-07-04T11:45:18Z INFO Vulnerability scanning is enabled
2024-07-04T11:45:18Z INFO Misconfiguration scanning is enabled
2024-07-04T11:45:18Z INFO Need to update the built-in policies
2024-07-04T11:45:18Z INFO Downloading the built-in policies...
74.86 KiB / 74.86 KiB [-----------------------------------------------------------] 100.00% ? p/s 0s2024-07-04T11:45:18Z INFO Secret scanning is enabled
2024-07-04T11:45:18Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-04T11:45:18Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection
2024-07-04T11:45:22Z INFO Number of language-specific files num=0
2024-07-04T11:45:22Z INFO Detected config files num=10
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33 resource "aws_security_group" "db" {
..
47 [ cidr_blocks = ["0.0.0.0/0"]
..
49 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349
via ecs.tf:344-350 (egress)
via ecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323 resource "aws_security_group" "cluster_ec2" {
...
349 [ cidr_blocks = ["0.0.0.0/0"]
...
358 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489
via ecs.tf:485-490 (egress)
via ecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473 resource "aws_security_group" "ecs_service" {
...
489 [ cidr_blocks = ["0.0.0.0/0"]
...
491 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
202 [ cidr_blocks = lookup(egress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
190 [ cidr_blocks = lookup(ingress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152
via loadbalancer.tf:147-153 (egress)
via loadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134 resource "aws_security_group" "ifs_lb_sc" {
...
152 [ cidr_blocks = ["0.0.0.0/0"]
...
154 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174
via loadbalancer.tf:169-175 (egress)
via loadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156 resource "aws_security_group" "ifs_target_sc" {
...
174 [ cidr_blocks = ["0.0.0.0/0"]
...
176 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running tflint in terraform/environments/cdpt-ifs
Excluding the following checks: terraform_unused_declarations
7issue(s) found:
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 121:121:value="${aws_db_instance.database.address}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 125:125:value="${aws_db_instance.database.username}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 129:129:value="${local.application_data.accounts[local.environment].db_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 133:133:value="${local.application_data.accounts[local.environment].client_id}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 137:137:value="${local.application_data.accounts[local.environment].env_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 406:406:Name="${local.application_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Missing version constraint for provider "random" in `required_providers` (terraform_required_providers)
on terraform/environments/cdpt-ifs/loadbalancer.tf line 97:97:resource"random_string""ifs_target_group_name" {
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_required_providers.mdtflint_exitcode=2
Trivy Scan Failed
Show Output
*****************************
Trivy will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running Trivy in terraform/environments/cdpt-ifs
2024-07-04T11:45:16Z INFO Need to update DB
2024-07-04T11:45:16Z INFO Downloading DB...repository="ghcr.io/aquasecurity/trivy-db:2"2024-07-04T11:45:18Z INFO Vulnerability scanning is enabled
2024-07-04T11:45:18Z INFO Misconfiguration scanning is enabled
2024-07-04T11:45:18Z INFO Need to update the built-in policies
2024-07-04T11:45:18Z INFO Downloading the built-in policies...74.86 KiB /74.86 KiB [-----------------------------------------------------------] 100.00%? p/s 0s2024-07-04T11:45:18Z INFO Secret scanning is enabled
2024-07-04T11:45:18Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-04T11:45:18Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection2024-07-04T11:45:22Z INFO Number of language-specific files num=02024-07-04T11:45:22Z INFO Detected config files num=10
database.tf (terraform)
=======================
Tests:3 (SUCCESSES:1, FAILURES:2, EXCEPTIONS:0)
Failures:2 (HIGH:1, CRITICAL:1)
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
See https://avd.aquasec.com/misconfig/avd-aws-0080
────────────────────────────────────────
database.tf:5-20
────────────────────────────────────────
5 ┌ resource"aws_db_instance""database" {
6 │ allocated_storage=local.application_data.accounts[local.environment].db_allocated_storage7 │ storage_type="gp2"8 │ engine="sqlserver-web"9 │ engine_version="14.00.3381.3.v1"10 │ instance_class=local.application_data.accounts[local.environment].db_instance_class11 │ identifier=local.application_data.accounts[local.environment].db_instance_identifier12 │ username=local.application_data.accounts[local.environment].db_user13 └ password=aws_secretsmanager_secret_version.dbase_password.secret_string..
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33resource"aws_security_group""db" {
..47 [ cidr_blocks = ["0.0.0.0/0"]
..49 }
────────────────────────────────────────
ecs.tf (terraform)
==================Tests:75 (SUCCESSES:5, FAILURES:2, EXCEPTIONS:68)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349viaecs.tf:344-350 (egress)
viaecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323resource"aws_security_group""cluster_ec2" {
...349 [ cidr_blocks = ["0.0.0.0/0"]
...358 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489viaecs.tf:485-490 (egress)
viaecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473resource"aws_security_group""ecs_service" {
...489 [ cidr_blocks = ["0.0.0.0/0"]
...491 }
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-bastion-linux?ref=v4.2.1/main.tf (terraform)
==========================================================================================================Tests:16 (SUCCESSES:5, FAILURES:0, EXCEPTIONS:11)
Failures:0 (HIGH:0, CRITICAL:0)
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf (terraform)
===========================================================================================================================================
Tests:7 (SUCCESSES:3, FAILURES:2, EXCEPTIONS:2)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...202 [ cidr_blocks =lookup(egress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...190 [ cidr_blocks =lookup(ingress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
loadbalancer.tf (terraform)
===========================
Tests:6 (SUCCESSES:3, FAILURES:3, EXCEPTIONS:0)
Failures:3 (HIGH:0, CRITICAL:3)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152vialoadbalancer.tf:147-153 (egress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...152 [ cidr_blocks = ["0.0.0.0/0"]
...154 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174vialoadbalancer.tf:169-175 (egress)
vialoadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156resource"aws_security_group""ifs_target_sc" {
...174 [ cidr_blocks = ["0.0.0.0/0"]
...176 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
loadbalancer.tf:144vialoadbalancer.tf:139-145 (ingress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...144 [ cidr_blocks = ["188.214.15.75/32", "192.168.5.101/32", "81.134.202.29/32", "79.152.189.104/32", "179.50.12.212/32", "188.172.252.34/32", "194.33.192.0/25", "194.33.193.0/25", "194.33.196.0/25", "194.33.197.0/25", "195.59.75.0/24", "201.33.21.5/32", "213.121.161.112/28", "52.67.148.55/32", "54.94.206.111/32", "178.248.34.42/32", "178.248.34.43/32", "178.248.34.44/32", "178.248.34.45/32", "178.248.34.46/32", "178.248.34.47/32", "89.32.121.144/32", "185.191.249.100/32", "2.138.20.8/32", "18.169.147.172/32", "35.176.93.186/32", "18.130.148.126/32", "35.176.148.126/32", "51.149.250.0/24", "51.149.249.0/29", "194.33.249.0/29", "51.149.249.32/29", "194.33.248.0/29", "20.49.214.199/32", "20.49.214.228/32", "20.26.11.71/32", "20.26.11.108/32", "128.77.75.128/26"]
...154 }
────────────────────────────────────────
monitoring.tf (terraform)
=========================
Tests:2 (SUCCESSES:1, FAILURES:1, EXCEPTIONS:0)
Failures:1 (HIGH:1, CRITICAL:0)
HIGH:Topicdoesnothaveencryptionenabled.
════════════════════════════════════════
Topicsshouldbeencryptedtoprotecttheircontents.Seehttps://avd.aquasec.com/misconfig/avd-aws-0095
────────────────────────────────────────
monitoring.tf:1-3
────────────────────────────────────────
1 ┌ resource"aws_sns_topic""lb_alarm_topic" {
2 │ name ="lb_alarm_topic"3 └ }
────────────────────────────────────────
trivy_exitcode=1
Trivy will check the following folders:
terraform/environments/cdpt-ifs
Running Trivy in terraform/environments/cdpt-ifs
2024-07-04T13:06:49Z INFO Need to update DB
2024-07-04T13:06:49Z INFO Downloading DB... repository="ghcr.io/aquasecurity/trivy-db:2"
2024-07-04T13:06:51Z INFO Vulnerability scanning is enabled
2024-07-04T13:06:51Z INFO Misconfiguration scanning is enabled
2024-07-04T13:06:51Z INFO Need to update the built-in policies
2024-07-04T13:06:51Z INFO Downloading the built-in policies...
74.86 KiB / 74.86 KiB [-----------------------------------------------------------] 100.00% ? p/s 0s2024-07-04T13:06:51Z INFO Secret scanning is enabled
2024-07-04T13:06:51Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-04T13:06:51Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection
2024-07-04T13:06:53Z INFO Number of language-specific files num=0
2024-07-04T13:06:53Z INFO Detected config files num=10
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33 resource "aws_security_group" "db" {
..
47 [ cidr_blocks = ["0.0.0.0/0"]
..
49 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349
via ecs.tf:344-350 (egress)
via ecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323 resource "aws_security_group" "cluster_ec2" {
...
349 [ cidr_blocks = ["0.0.0.0/0"]
...
358 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489
via ecs.tf:485-490 (egress)
via ecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473 resource "aws_security_group" "ecs_service" {
...
489 [ cidr_blocks = ["0.0.0.0/0"]
...
491 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
202 [ cidr_blocks = lookup(egress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
190 [ cidr_blocks = lookup(ingress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152
via loadbalancer.tf:147-153 (egress)
via loadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134 resource "aws_security_group" "ifs_lb_sc" {
...
152 [ cidr_blocks = ["0.0.0.0/0"]
...
154 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174
via loadbalancer.tf:169-175 (egress)
via loadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156 resource "aws_security_group" "ifs_target_sc" {
...
174 [ cidr_blocks = ["0.0.0.0/0"]
...
176 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running tflint in terraform/environments/cdpt-ifs
Excluding the following checks: terraform_unused_declarations
7issue(s) found:
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 121:121:value="${aws_db_instance.database.address}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 125:125:value="${aws_db_instance.database.username}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 129:129:value="${local.application_data.accounts[local.environment].db_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 133:133:value="${local.application_data.accounts[local.environment].client_id}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 137:137:value="${local.application_data.accounts[local.environment].env_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 406:406:Name="${local.application_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Missing version constraint for provider "random" in `required_providers` (terraform_required_providers)
on terraform/environments/cdpt-ifs/loadbalancer.tf line 97:97:resource"random_string""ifs_target_group_name" {
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_required_providers.mdtflint_exitcode=2
Trivy Scan Failed
Show Output
*****************************
Trivy will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running Trivy in terraform/environments/cdpt-ifs
2024-07-04T13:06:49Z INFO Need to update DB
2024-07-04T13:06:49Z INFO Downloading DB...repository="ghcr.io/aquasecurity/trivy-db:2"2024-07-04T13:06:51Z INFO Vulnerability scanning is enabled
2024-07-04T13:06:51Z INFO Misconfiguration scanning is enabled
2024-07-04T13:06:51Z INFO Need to update the built-in policies
2024-07-04T13:06:51Z INFO Downloading the built-in policies...74.86 KiB /74.86 KiB [-----------------------------------------------------------] 100.00%? p/s 0s2024-07-04T13:06:51Z INFO Secret scanning is enabled
2024-07-04T13:06:51Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-04T13:06:51Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection2024-07-04T13:06:53Z INFO Number of language-specific files num=02024-07-04T13:06:53Z INFO Detected config files num=10
database.tf (terraform)
=======================
Tests:3 (SUCCESSES:1, FAILURES:2, EXCEPTIONS:0)
Failures:2 (HIGH:1, CRITICAL:1)
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
See https://avd.aquasec.com/misconfig/avd-aws-0080
────────────────────────────────────────
database.tf:5-20
────────────────────────────────────────
5 ┌ resource"aws_db_instance""database" {
6 │ allocated_storage=local.application_data.accounts[local.environment].db_allocated_storage7 │ storage_type="gp2"8 │ engine="sqlserver-web"9 │ engine_version="14.00.3381.3.v1"10 │ instance_class=local.application_data.accounts[local.environment].db_instance_class11 │ identifier=local.application_data.accounts[local.environment].db_instance_identifier12 │ username=local.application_data.accounts[local.environment].db_user13 └ password=aws_secretsmanager_secret_version.dbase_password.secret_string..
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33resource"aws_security_group""db" {
..47 [ cidr_blocks = ["0.0.0.0/0"]
..49 }
────────────────────────────────────────
ecs.tf (terraform)
==================Tests:75 (SUCCESSES:5, FAILURES:2, EXCEPTIONS:68)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349viaecs.tf:344-350 (egress)
viaecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323resource"aws_security_group""cluster_ec2" {
...349 [ cidr_blocks = ["0.0.0.0/0"]
...358 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489viaecs.tf:485-490 (egress)
viaecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473resource"aws_security_group""ecs_service" {
...489 [ cidr_blocks = ["0.0.0.0/0"]
...491 }
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-bastion-linux?ref=v4.2.1/main.tf (terraform)
==========================================================================================================Tests:16 (SUCCESSES:5, FAILURES:0, EXCEPTIONS:11)
Failures:0 (HIGH:0, CRITICAL:0)
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf (terraform)
===========================================================================================================================================
Tests:7 (SUCCESSES:3, FAILURES:2, EXCEPTIONS:2)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...202 [ cidr_blocks =lookup(egress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...190 [ cidr_blocks =lookup(ingress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
loadbalancer.tf (terraform)
===========================
Tests:6 (SUCCESSES:3, FAILURES:3, EXCEPTIONS:0)
Failures:3 (HIGH:0, CRITICAL:3)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152vialoadbalancer.tf:147-153 (egress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...152 [ cidr_blocks = ["0.0.0.0/0"]
...154 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174vialoadbalancer.tf:169-175 (egress)
vialoadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156resource"aws_security_group""ifs_target_sc" {
...174 [ cidr_blocks = ["0.0.0.0/0"]
...176 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
loadbalancer.tf:144vialoadbalancer.tf:139-145 (ingress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...144 [ cidr_blocks = ["188.214.15.75/32", "192.168.5.101/32", "81.134.202.29/32", "79.152.189.104/32", "179.50.12.212/32", "188.172.252.34/32", "194.33.192.0/25", "194.33.193.0/25", "194.33.196.0/25", "194.33.197.0/25", "195.59.75.0/24", "201.33.21.5/32", "213.121.161.112/28", "52.67.148.55/32", "54.94.206.111/32", "178.248.34.42/32", "178.248.34.43/32", "178.248.34.44/32", "178.248.34.45/32", "178.248.34.46/32", "178.248.34.47/32", "89.32.121.144/32", "185.191.249.100/32", "2.138.20.8/32", "18.169.147.172/32", "35.176.93.186/32", "18.130.148.126/32", "35.176.148.126/32", "51.149.250.0/24", "51.149.249.0/29", "194.33.249.0/29", "51.149.249.32/29", "194.33.248.0/29", "20.49.214.199/32", "20.49.214.228/32", "20.26.11.71/32", "20.26.11.108/32", "128.77.75.128/26"]
...154 }
────────────────────────────────────────
monitoring.tf (terraform)
=========================
Tests:2 (SUCCESSES:1, FAILURES:1, EXCEPTIONS:0)
Failures:1 (HIGH:1, CRITICAL:0)
HIGH:Topicdoesnothaveencryptionenabled.
════════════════════════════════════════
Topicsshouldbeencryptedtoprotecttheircontents.Seehttps://avd.aquasec.com/misconfig/avd-aws-0095
────────────────────────────────────────
monitoring.tf:1-3
────────────────────────────────────────
1 ┌ resource"aws_sns_topic""lb_alarm_topic" {
2 │ name ="lb_alarm_topic"3 └ }
────────────────────────────────────────
trivy_exitcode=1
Trivy will check the following folders:
terraform/environments/cdpt-ifs
Running Trivy in terraform/environments/cdpt-ifs
2024-07-04T13:19:04Z INFO Need to update DB
2024-07-04T13:19:04Z INFO Downloading DB... repository="ghcr.io/aquasecurity/trivy-db:2"
2024-07-04T13:19:06Z INFO Vulnerability scanning is enabled
2024-07-04T13:19:06Z INFO Misconfiguration scanning is enabled
2024-07-04T13:19:06Z INFO Need to update the built-in policies
2024-07-04T13:19:06Z INFO Downloading the built-in policies...
74.86 KiB / 74.86 KiB [-----------------------------------------------------------] 100.00% ? p/s 0s2024-07-04T13:19:07Z INFO Secret scanning is enabled
2024-07-04T13:19:07Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-04T13:19:07Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection
2024-07-04T13:19:10Z INFO Number of language-specific files num=0
2024-07-04T13:19:10Z INFO Detected config files num=10
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33 resource "aws_security_group" "db" {
..
47 [ cidr_blocks = ["0.0.0.0/0"]
..
49 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349
via ecs.tf:344-350 (egress)
via ecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323 resource "aws_security_group" "cluster_ec2" {
...
349 [ cidr_blocks = ["0.0.0.0/0"]
...
358 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489
via ecs.tf:485-490 (egress)
via ecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473 resource "aws_security_group" "ecs_service" {
...
489 [ cidr_blocks = ["0.0.0.0/0"]
...
491 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
202 [ cidr_blocks = lookup(egress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
190 [ cidr_blocks = lookup(ingress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152
via loadbalancer.tf:147-153 (egress)
via loadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134 resource "aws_security_group" "ifs_lb_sc" {
...
152 [ cidr_blocks = ["0.0.0.0/0"]
...
154 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174
via loadbalancer.tf:169-175 (egress)
via loadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156 resource "aws_security_group" "ifs_target_sc" {
...
174 [ cidr_blocks = ["0.0.0.0/0"]
...
176 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running tflint in terraform/environments/cdpt-ifs
Excluding the following checks: terraform_unused_declarations
7issue(s) found:
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 121:121:value="${aws_db_instance.database.address}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 125:125:value="${aws_db_instance.database.username}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 129:129:value="${local.application_data.accounts[local.environment].db_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 133:133:value="${local.application_data.accounts[local.environment].client_id}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 137:137:value="${local.application_data.accounts[local.environment].env_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 406:406:Name="${local.application_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Missing version constraint for provider "random" in `required_providers` (terraform_required_providers)
on terraform/environments/cdpt-ifs/loadbalancer.tf line 97:97:resource"random_string""ifs_target_group_name" {
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_required_providers.mdtflint_exitcode=2
Trivy Scan Failed
Show Output
*****************************
Trivy will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running Trivy in terraform/environments/cdpt-ifs
2024-07-04T13:19:04Z INFO Need to update DB
2024-07-04T13:19:04Z INFO Downloading DB...repository="ghcr.io/aquasecurity/trivy-db:2"2024-07-04T13:19:06Z INFO Vulnerability scanning is enabled
2024-07-04T13:19:06Z INFO Misconfiguration scanning is enabled
2024-07-04T13:19:06Z INFO Need to update the built-in policies
2024-07-04T13:19:06Z INFO Downloading the built-in policies...74.86 KiB /74.86 KiB [-----------------------------------------------------------] 100.00%? p/s 0s2024-07-04T13:19:07Z INFO Secret scanning is enabled
2024-07-04T13:19:07Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-04T13:19:07Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection2024-07-04T13:19:10Z INFO Number of language-specific files num=02024-07-04T13:19:10Z INFO Detected config files num=10
database.tf (terraform)
=======================
Tests:3 (SUCCESSES:1, FAILURES:2, EXCEPTIONS:0)
Failures:2 (HIGH:1, CRITICAL:1)
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
See https://avd.aquasec.com/misconfig/avd-aws-0080
────────────────────────────────────────
database.tf:5-20
────────────────────────────────────────
5 ┌ resource"aws_db_instance""database" {
6 │ allocated_storage=local.application_data.accounts[local.environment].db_allocated_storage7 │ storage_type="gp2"8 │ engine="sqlserver-web"9 │ engine_version="14.00.3381.3.v1"10 │ instance_class=local.application_data.accounts[local.environment].db_instance_class11 │ identifier=local.application_data.accounts[local.environment].db_instance_identifier12 │ username=local.application_data.accounts[local.environment].db_user13 └ password=aws_secretsmanager_secret_version.dbase_password.secret_string..
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33resource"aws_security_group""db" {
..47 [ cidr_blocks = ["0.0.0.0/0"]
..49 }
────────────────────────────────────────
ecs.tf (terraform)
==================Tests:75 (SUCCESSES:5, FAILURES:2, EXCEPTIONS:68)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349viaecs.tf:344-350 (egress)
viaecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323resource"aws_security_group""cluster_ec2" {
...349 [ cidr_blocks = ["0.0.0.0/0"]
...358 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489viaecs.tf:485-490 (egress)
viaecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473resource"aws_security_group""ecs_service" {
...489 [ cidr_blocks = ["0.0.0.0/0"]
...491 }
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-bastion-linux?ref=v4.2.1/main.tf (terraform)
==========================================================================================================Tests:16 (SUCCESSES:5, FAILURES:0, EXCEPTIONS:11)
Failures:0 (HIGH:0, CRITICAL:0)
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf (terraform)
===========================================================================================================================================
Tests:7 (SUCCESSES:3, FAILURES:2, EXCEPTIONS:2)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...202 [ cidr_blocks =lookup(egress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...190 [ cidr_blocks =lookup(ingress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
loadbalancer.tf (terraform)
===========================
Tests:6 (SUCCESSES:3, FAILURES:3, EXCEPTIONS:0)
Failures:3 (HIGH:0, CRITICAL:3)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152vialoadbalancer.tf:147-153 (egress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...152 [ cidr_blocks = ["0.0.0.0/0"]
...154 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174vialoadbalancer.tf:169-175 (egress)
vialoadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156resource"aws_security_group""ifs_target_sc" {
...174 [ cidr_blocks = ["0.0.0.0/0"]
...176 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
loadbalancer.tf:144vialoadbalancer.tf:139-145 (ingress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...144 [ cidr_blocks = ["188.214.15.75/32", "192.168.5.101/32", "81.134.202.29/32", "79.152.189.104/32", "179.50.12.212/32", "188.172.252.34/32", "194.33.192.0/25", "194.33.193.0/25", "194.33.196.0/25", "194.33.197.0/25", "195.59.75.0/24", "201.33.21.5/32", "213.121.161.112/28", "52.67.148.55/32", "54.94.206.111/32", "178.248.34.42/32", "178.248.34.43/32", "178.248.34.44/32", "178.248.34.45/32", "178.248.34.46/32", "178.248.34.47/32", "89.32.121.144/32", "185.191.249.100/32", "2.138.20.8/32", "18.169.147.172/32", "35.176.93.186/32", "18.130.148.126/32", "35.176.148.126/32", "51.149.250.0/24", "51.149.249.0/29", "194.33.249.0/29", "51.149.249.32/29", "194.33.248.0/29", "20.49.214.199/32", "20.49.214.228/32", "20.26.11.71/32", "20.26.11.108/32", "128.77.75.128/26"]
...154 }
────────────────────────────────────────
monitoring.tf (terraform)
=========================
Tests:2 (SUCCESSES:1, FAILURES:1, EXCEPTIONS:0)
Failures:1 (HIGH:1, CRITICAL:0)
HIGH:Topicdoesnothaveencryptionenabled.
════════════════════════════════════════
Topicsshouldbeencryptedtoprotecttheircontents.Seehttps://avd.aquasec.com/misconfig/avd-aws-0095
────────────────────────────────────────
monitoring.tf:1-3
────────────────────────────────────────
1 ┌ resource"aws_sns_topic""lb_alarm_topic" {
2 │ name ="lb_alarm_topic"3 └ }
────────────────────────────────────────
trivy_exitcode=1
Trivy will check the following folders:
terraform/environments/cdpt-ifs
Running Trivy in terraform/environments/cdpt-ifs
2024-07-04T14:47:50Z INFO Need to update DB
2024-07-04T14:47:50Z INFO Downloading DB... repository="ghcr.io/aquasecurity/trivy-db:2"
2024-07-04T14:47:51Z INFO Vulnerability scanning is enabled
2024-07-04T14:47:51Z INFO Misconfiguration scanning is enabled
2024-07-04T14:47:51Z INFO Need to update the built-in policies
2024-07-04T14:47:51Z INFO Downloading the built-in policies...
74.86 KiB / 74.86 KiB [-----------------------------------------------------------] 100.00% ? p/s 0s2024-07-04T14:47:52Z INFO Secret scanning is enabled
2024-07-04T14:47:52Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-04T14:47:52Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection
2024-07-04T14:47:54Z INFO Number of language-specific files num=0
2024-07-04T14:47:54Z INFO Detected config files num=10
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33 resource "aws_security_group" "db" {
..
47 [ cidr_blocks = ["0.0.0.0/0"]
..
49 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349
via ecs.tf:344-350 (egress)
via ecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323 resource "aws_security_group" "cluster_ec2" {
...
349 [ cidr_blocks = ["0.0.0.0/0"]
...
358 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489
via ecs.tf:485-490 (egress)
via ecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473 resource "aws_security_group" "ecs_service" {
...
489 [ cidr_blocks = ["0.0.0.0/0"]
...
491 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
202 [ cidr_blocks = lookup(egress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
190 [ cidr_blocks = lookup(ingress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152
via loadbalancer.tf:147-153 (egress)
via loadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134 resource "aws_security_group" "ifs_lb_sc" {
...
152 [ cidr_blocks = ["0.0.0.0/0"]
...
154 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174
via loadbalancer.tf:169-175 (egress)
via loadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156 resource "aws_security_group" "ifs_target_sc" {
...
174 [ cidr_blocks = ["0.0.0.0/0"]
...
176 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running tflint in terraform/environments/cdpt-ifs
Excluding the following checks: terraform_unused_declarations
7issue(s) found:
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 121:121:value="${aws_db_instance.database.address}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 125:125:value="${aws_db_instance.database.username}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 129:129:value="${local.application_data.accounts[local.environment].db_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 133:133:value="${local.application_data.accounts[local.environment].client_id}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 137:137:value="${local.application_data.accounts[local.environment].env_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 406:406:Name="${local.application_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Missing version constraint for provider "random" in `required_providers` (terraform_required_providers)
on terraform/environments/cdpt-ifs/secrets.tf line 5:5:resource"random_password""password_long" {
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_required_providers.mdtflint_exitcode=2
Trivy Scan Failed
Show Output
*****************************
Trivy will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running Trivy in terraform/environments/cdpt-ifs
2024-07-04T14:47:50Z INFO Need to update DB
2024-07-04T14:47:50Z INFO Downloading DB...repository="ghcr.io/aquasecurity/trivy-db:2"2024-07-04T14:47:51Z INFO Vulnerability scanning is enabled
2024-07-04T14:47:51Z INFO Misconfiguration scanning is enabled
2024-07-04T14:47:51Z INFO Need to update the built-in policies
2024-07-04T14:47:51Z INFO Downloading the built-in policies...74.86 KiB /74.86 KiB [-----------------------------------------------------------] 100.00%? p/s 0s2024-07-04T14:47:52Z INFO Secret scanning is enabled
2024-07-04T14:47:52Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-04T14:47:52Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection2024-07-04T14:47:54Z INFO Number of language-specific files num=02024-07-04T14:47:54Z INFO Detected config files num=10
database.tf (terraform)
=======================
Tests:3 (SUCCESSES:1, FAILURES:2, EXCEPTIONS:0)
Failures:2 (HIGH:1, CRITICAL:1)
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
See https://avd.aquasec.com/misconfig/avd-aws-0080
────────────────────────────────────────
database.tf:5-20
────────────────────────────────────────
5 ┌ resource"aws_db_instance""database" {
6 │ allocated_storage=local.application_data.accounts[local.environment].db_allocated_storage7 │ storage_type="gp2"8 │ engine="sqlserver-web"9 │ engine_version="14.00.3381.3.v1"10 │ instance_class=local.application_data.accounts[local.environment].db_instance_class11 │ identifier=local.application_data.accounts[local.environment].db_instance_identifier12 │ username=local.application_data.accounts[local.environment].db_user13 └ password=aws_secretsmanager_secret_version.dbase_password.secret_string..
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33resource"aws_security_group""db" {
..47 [ cidr_blocks = ["0.0.0.0/0"]
..49 }
────────────────────────────────────────
ecs.tf (terraform)
==================Tests:75 (SUCCESSES:5, FAILURES:2, EXCEPTIONS:68)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349viaecs.tf:344-350 (egress)
viaecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323resource"aws_security_group""cluster_ec2" {
...349 [ cidr_blocks = ["0.0.0.0/0"]
...358 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489viaecs.tf:485-490 (egress)
viaecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473resource"aws_security_group""ecs_service" {
...489 [ cidr_blocks = ["0.0.0.0/0"]
...491 }
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-bastion-linux?ref=v4.2.1/main.tf (terraform)
==========================================================================================================Tests:16 (SUCCESSES:5, FAILURES:0, EXCEPTIONS:11)
Failures:0 (HIGH:0, CRITICAL:0)
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf (terraform)
===========================================================================================================================================
Tests:7 (SUCCESSES:3, FAILURES:2, EXCEPTIONS:2)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...202 [ cidr_blocks =lookup(egress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...190 [ cidr_blocks =lookup(ingress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
loadbalancer.tf (terraform)
===========================
Tests:6 (SUCCESSES:3, FAILURES:3, EXCEPTIONS:0)
Failures:3 (HIGH:0, CRITICAL:3)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152vialoadbalancer.tf:147-153 (egress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...152 [ cidr_blocks = ["0.0.0.0/0"]
...154 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174vialoadbalancer.tf:169-175 (egress)
vialoadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156resource"aws_security_group""ifs_target_sc" {
...174 [ cidr_blocks = ["0.0.0.0/0"]
...176 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
loadbalancer.tf:144vialoadbalancer.tf:139-145 (ingress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...144 [ cidr_blocks = ["188.214.15.75/32", "192.168.5.101/32", "81.134.202.29/32", "79.152.189.104/32", "179.50.12.212/32", "188.172.252.34/32", "194.33.192.0/25", "194.33.193.0/25", "194.33.196.0/25", "194.33.197.0/25", "195.59.75.0/24", "201.33.21.5/32", "213.121.161.112/28", "52.67.148.55/32", "54.94.206.111/32", "178.248.34.42/32", "178.248.34.43/32", "178.248.34.44/32", "178.248.34.45/32", "178.248.34.46/32", "178.248.34.47/32", "89.32.121.144/32", "185.191.249.100/32", "2.138.20.8/32", "18.169.147.172/32", "35.176.93.186/32", "18.130.148.126/32", "35.176.148.126/32", "51.149.250.0/24", "51.149.249.0/29", "194.33.249.0/29", "51.149.249.32/29", "194.33.248.0/29", "20.49.214.199/32", "20.49.214.228/32", "20.26.11.71/32", "20.26.11.108/32", "128.77.75.128/26"]
...154 }
────────────────────────────────────────
monitoring.tf (terraform)
=========================
Tests:2 (SUCCESSES:1, FAILURES:1, EXCEPTIONS:0)
Failures:1 (HIGH:1, CRITICAL:0)
HIGH:Topicdoesnothaveencryptionenabled.
════════════════════════════════════════
Topicsshouldbeencryptedtoprotecttheircontents.Seehttps://avd.aquasec.com/misconfig/avd-aws-0095
────────────────────────────────────────
monitoring.tf:1-3
────────────────────────────────────────
1 ┌ resource"aws_sns_topic""lb_alarm_topic" {
2 │ name ="lb_alarm_topic"3 └ }
────────────────────────────────────────
trivy_exitcode=1
Trivy will check the following folders:
terraform/environments/cdpt-ifs
Running Trivy in terraform/environments/cdpt-ifs
2024-07-05T11:28:51Z INFO Need to update DB
2024-07-05T11:28:51Z INFO Downloading DB... repository="ghcr.io/aquasecurity/trivy-db:2"
2024-07-05T11:28:53Z INFO Vulnerability scanning is enabled
2024-07-05T11:28:53Z INFO Misconfiguration scanning is enabled
2024-07-05T11:28:53Z INFO Need to update the built-in policies
2024-07-05T11:28:53Z INFO Downloading the built-in policies...
74.86 KiB / 74.86 KiB [-----------------------------------------------------------] 100.00% ? p/s 0s2024-07-05T11:28:54Z INFO Secret scanning is enabled
2024-07-05T11:28:54Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-05T11:28:54Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection
2024-07-05T11:28:56Z INFO Number of language-specific files num=0
2024-07-05T11:28:56Z INFO Detected config files num=10
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33 resource "aws_security_group" "db" {
..
47 [ cidr_blocks = ["0.0.0.0/0"]
..
49 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349
via ecs.tf:344-350 (egress)
via ecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323 resource "aws_security_group" "cluster_ec2" {
...
349 [ cidr_blocks = ["0.0.0.0/0"]
...
358 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489
via ecs.tf:485-490 (egress)
via ecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473 resource "aws_security_group" "ecs_service" {
...
489 [ cidr_blocks = ["0.0.0.0/0"]
...
491 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
202 [ cidr_blocks = lookup(egress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
190 [ cidr_blocks = lookup(ingress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152
via loadbalancer.tf:147-153 (egress)
via loadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134 resource "aws_security_group" "ifs_lb_sc" {
...
152 [ cidr_blocks = ["0.0.0.0/0"]
...
154 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174
via loadbalancer.tf:169-175 (egress)
via loadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156 resource "aws_security_group" "ifs_target_sc" {
...
174 [ cidr_blocks = ["0.0.0.0/0"]
...
176 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running tflint in terraform/environments/cdpt-ifs
Excluding the following checks: terraform_unused_declarations
7issue(s) found:
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 121:121:value="${aws_db_instance.database.address}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 125:125:value="${aws_db_instance.database.username}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 129:129:value="${local.application_data.accounts[local.environment].db_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 133:133:value="${local.application_data.accounts[local.environment].client_id}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 137:137:value="${local.application_data.accounts[local.environment].env_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 406:406:Name="${local.application_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Missing version constraint for provider "random" in `required_providers` (terraform_required_providers)
on terraform/environments/cdpt-ifs/loadbalancer.tf line 97:97:resource"random_string""ifs_target_group_name" {
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_required_providers.mdtflint_exitcode=2
Trivy Scan Failed
Show Output
*****************************
Trivy will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running Trivy in terraform/environments/cdpt-ifs
2024-07-05T11:28:51Z INFO Need to update DB
2024-07-05T11:28:51Z INFO Downloading DB...repository="ghcr.io/aquasecurity/trivy-db:2"2024-07-05T11:28:53Z INFO Vulnerability scanning is enabled
2024-07-05T11:28:53Z INFO Misconfiguration scanning is enabled
2024-07-05T11:28:53Z INFO Need to update the built-in policies
2024-07-05T11:28:53Z INFO Downloading the built-in policies...74.86 KiB /74.86 KiB [-----------------------------------------------------------] 100.00%? p/s 0s2024-07-05T11:28:54Z INFO Secret scanning is enabled
2024-07-05T11:28:54Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-05T11:28:54Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection2024-07-05T11:28:56Z INFO Number of language-specific files num=02024-07-05T11:28:56Z INFO Detected config files num=10
database.tf (terraform)
=======================
Tests:3 (SUCCESSES:1, FAILURES:2, EXCEPTIONS:0)
Failures:2 (HIGH:1, CRITICAL:1)
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
See https://avd.aquasec.com/misconfig/avd-aws-0080
────────────────────────────────────────
database.tf:5-20
────────────────────────────────────────
5 ┌ resource"aws_db_instance""database" {
6 │ allocated_storage=local.application_data.accounts[local.environment].db_allocated_storage7 │ storage_type="gp2"8 │ engine="sqlserver-web"9 │ engine_version="14.00.3381.3.v1"10 │ instance_class=local.application_data.accounts[local.environment].db_instance_class11 │ identifier=local.application_data.accounts[local.environment].db_instance_identifier12 │ username=local.application_data.accounts[local.environment].db_user13 └ password=aws_secretsmanager_secret_version.dbase_password.secret_string..
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33resource"aws_security_group""db" {
..47 [ cidr_blocks = ["0.0.0.0/0"]
..49 }
────────────────────────────────────────
ecs.tf (terraform)
==================Tests:75 (SUCCESSES:5, FAILURES:2, EXCEPTIONS:68)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349viaecs.tf:344-350 (egress)
viaecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323resource"aws_security_group""cluster_ec2" {
...349 [ cidr_blocks = ["0.0.0.0/0"]
...358 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489viaecs.tf:485-490 (egress)
viaecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473resource"aws_security_group""ecs_service" {
...489 [ cidr_blocks = ["0.0.0.0/0"]
...491 }
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-bastion-linux?ref=v4.2.1/main.tf (terraform)
==========================================================================================================Tests:16 (SUCCESSES:5, FAILURES:0, EXCEPTIONS:11)
Failures:0 (HIGH:0, CRITICAL:0)
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf (terraform)
===========================================================================================================================================
Tests:7 (SUCCESSES:3, FAILURES:2, EXCEPTIONS:2)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...202 [ cidr_blocks =lookup(egress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...190 [ cidr_blocks =lookup(ingress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
loadbalancer.tf (terraform)
===========================
Tests:6 (SUCCESSES:3, FAILURES:3, EXCEPTIONS:0)
Failures:3 (HIGH:0, CRITICAL:3)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152vialoadbalancer.tf:147-153 (egress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...152 [ cidr_blocks = ["0.0.0.0/0"]
...154 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174vialoadbalancer.tf:169-175 (egress)
vialoadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156resource"aws_security_group""ifs_target_sc" {
...174 [ cidr_blocks = ["0.0.0.0/0"]
...176 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
loadbalancer.tf:144vialoadbalancer.tf:139-145 (ingress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...144 [ cidr_blocks = ["188.214.15.75/32", "192.168.5.101/32", "81.134.202.29/32", "79.152.189.104/32", "179.50.12.212/32", "188.172.252.34/32", "194.33.192.0/25", "194.33.193.0/25", "194.33.196.0/25", "194.33.197.0/25", "195.59.75.0/24", "201.33.21.5/32", "213.121.161.112/28", "52.67.148.55/32", "54.94.206.111/32", "178.248.34.42/32", "178.248.34.43/32", "178.248.34.44/32", "178.248.34.45/32", "178.248.34.46/32", "178.248.34.47/32", "89.32.121.144/32", "185.191.249.100/32", "2.138.20.8/32", "18.169.147.172/32", "35.176.93.186/32", "18.130.148.126/32", "35.176.148.126/32", "51.149.250.0/24", "51.149.249.0/29", "194.33.249.0/29", "51.149.249.32/29", "194.33.248.0/29", "20.49.214.199/32", "20.49.214.228/32", "20.26.11.71/32", "20.26.11.108/32", "128.77.75.128/26"]
...154 }
────────────────────────────────────────
monitoring.tf (terraform)
=========================
Tests:2 (SUCCESSES:1, FAILURES:1, EXCEPTIONS:0)
Failures:1 (HIGH:1, CRITICAL:0)
HIGH:Topicdoesnothaveencryptionenabled.
════════════════════════════════════════
Topicsshouldbeencryptedtoprotecttheircontents.Seehttps://avd.aquasec.com/misconfig/avd-aws-0095
────────────────────────────────────────
monitoring.tf:1-3
────────────────────────────────────────
1 ┌ resource"aws_sns_topic""lb_alarm_topic" {
2 │ name ="lb_alarm_topic"3 └ }
────────────────────────────────────────
trivy_exitcode=1
Trivy will check the following folders:
terraform/environments/cdpt-ifs
Running Trivy in terraform/environments/cdpt-ifs
2024-07-05T12:26:58Z INFO Need to update DB
2024-07-05T12:26:58Z INFO Downloading DB... repository="ghcr.io/aquasecurity/trivy-db:2"
2024-07-05T12:26:59Z INFO Vulnerability scanning is enabled
2024-07-05T12:26:59Z INFO Misconfiguration scanning is enabled
2024-07-05T12:26:59Z INFO Need to update the built-in policies
2024-07-05T12:26:59Z INFO Downloading the built-in policies...
74.86 KiB / 74.86 KiB [-----------------------------------------------------------] 100.00% ? p/s 0s2024-07-05T12:27:00Z INFO Secret scanning is enabled
2024-07-05T12:27:00Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-05T12:27:00Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection
2024-07-05T12:27:01Z INFO Number of language-specific files num=0
2024-07-05T12:27:01Z INFO Detected config files num=10
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33 resource "aws_security_group" "db" {
..
47 [ cidr_blocks = ["0.0.0.0/0"]
..
49 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349
via ecs.tf:344-350 (egress)
via ecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323 resource "aws_security_group" "cluster_ec2" {
...
349 [ cidr_blocks = ["0.0.0.0/0"]
...
358 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489
via ecs.tf:485-490 (egress)
via ecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473 resource "aws_security_group" "ecs_service" {
...
489 [ cidr_blocks = ["0.0.0.0/0"]
...
491 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
202 [ cidr_blocks = lookup(egress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
190 [ cidr_blocks = lookup(ingress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152
via loadbalancer.tf:147-153 (egress)
via loadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134 resource "aws_security_group" "ifs_lb_sc" {
...
152 [ cidr_blocks = ["0.0.0.0/0"]
...
154 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174
via loadbalancer.tf:169-175 (egress)
via loadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156 resource "aws_security_group" "ifs_target_sc" {
...
174 [ cidr_blocks = ["0.0.0.0/0"]
...
176 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running tflint in terraform/environments/cdpt-ifs
Excluding the following checks: terraform_unused_declarations
7issue(s) found:
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 121:121:value="${aws_db_instance.database.address}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 125:125:value="${aws_db_instance.database.username}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 129:129:value="${local.application_data.accounts[local.environment].db_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 133:133:value="${local.application_data.accounts[local.environment].client_id}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 137:137:value="${local.application_data.accounts[local.environment].env_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 406:406:Name="${local.application_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Missing version constraint for provider "random" in `required_providers` (terraform_required_providers)
on terraform/environments/cdpt-ifs/loadbalancer.tf line 97:97:resource"random_string""ifs_target_group_name" {
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_required_providers.mdtflint_exitcode=2
Trivy Scan Failed
Show Output
*****************************
Trivy will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running Trivy in terraform/environments/cdpt-ifs
2024-07-05T12:26:58Z INFO Need to update DB
2024-07-05T12:26:58Z INFO Downloading DB...repository="ghcr.io/aquasecurity/trivy-db:2"2024-07-05T12:26:59Z INFO Vulnerability scanning is enabled
2024-07-05T12:26:59Z INFO Misconfiguration scanning is enabled
2024-07-05T12:26:59Z INFO Need to update the built-in policies
2024-07-05T12:26:59Z INFO Downloading the built-in policies...74.86 KiB /74.86 KiB [-----------------------------------------------------------] 100.00%? p/s 0s2024-07-05T12:27:00Z INFO Secret scanning is enabled
2024-07-05T12:27:00Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-05T12:27:00Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection2024-07-05T12:27:01Z INFO Number of language-specific files num=02024-07-05T12:27:01Z INFO Detected config files num=10
database.tf (terraform)
=======================
Tests:3 (SUCCESSES:1, FAILURES:2, EXCEPTIONS:0)
Failures:2 (HIGH:1, CRITICAL:1)
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
See https://avd.aquasec.com/misconfig/avd-aws-0080
────────────────────────────────────────
database.tf:5-20
────────────────────────────────────────
5 ┌ resource"aws_db_instance""database" {
6 │ allocated_storage=local.application_data.accounts[local.environment].db_allocated_storage7 │ storage_type="gp2"8 │ engine="sqlserver-web"9 │ engine_version="14.00.3381.3.v1"10 │ instance_class=local.application_data.accounts[local.environment].db_instance_class11 │ identifier=local.application_data.accounts[local.environment].db_instance_identifier12 │ username=local.application_data.accounts[local.environment].db_user13 └ password=aws_secretsmanager_secret_version.dbase_password.secret_string..
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33resource"aws_security_group""db" {
..47 [ cidr_blocks = ["0.0.0.0/0"]
..49 }
────────────────────────────────────────
ecs.tf (terraform)
==================Tests:75 (SUCCESSES:5, FAILURES:2, EXCEPTIONS:68)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349viaecs.tf:344-350 (egress)
viaecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323resource"aws_security_group""cluster_ec2" {
...349 [ cidr_blocks = ["0.0.0.0/0"]
...358 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489viaecs.tf:485-490 (egress)
viaecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473resource"aws_security_group""ecs_service" {
...489 [ cidr_blocks = ["0.0.0.0/0"]
...491 }
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-bastion-linux?ref=v4.2.1/main.tf (terraform)
==========================================================================================================Tests:16 (SUCCESSES:5, FAILURES:0, EXCEPTIONS:11)
Failures:0 (HIGH:0, CRITICAL:0)
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf (terraform)
===========================================================================================================================================
Tests:7 (SUCCESSES:3, FAILURES:2, EXCEPTIONS:2)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...202 [ cidr_blocks =lookup(egress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...190 [ cidr_blocks =lookup(ingress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
loadbalancer.tf (terraform)
===========================
Tests:6 (SUCCESSES:3, FAILURES:3, EXCEPTIONS:0)
Failures:3 (HIGH:0, CRITICAL:3)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152vialoadbalancer.tf:147-153 (egress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...152 [ cidr_blocks = ["0.0.0.0/0"]
...154 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174vialoadbalancer.tf:169-175 (egress)
vialoadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156resource"aws_security_group""ifs_target_sc" {
...174 [ cidr_blocks = ["0.0.0.0/0"]
...176 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
loadbalancer.tf:144vialoadbalancer.tf:139-145 (ingress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...144 [ cidr_blocks = ["188.214.15.75/32", "192.168.5.101/32", "81.134.202.29/32", "79.152.189.104/32", "179.50.12.212/32", "188.172.252.34/32", "194.33.192.0/25", "194.33.193.0/25", "194.33.196.0/25", "194.33.197.0/25", "195.59.75.0/24", "201.33.21.5/32", "213.121.161.112/28", "52.67.148.55/32", "54.94.206.111/32", "178.248.34.42/32", "178.248.34.43/32", "178.248.34.44/32", "178.248.34.45/32", "178.248.34.46/32", "178.248.34.47/32", "89.32.121.144/32", "185.191.249.100/32", "2.138.20.8/32", "18.169.147.172/32", "35.176.93.186/32", "18.130.148.126/32", "35.176.148.126/32", "51.149.250.0/24", "51.149.249.0/29", "194.33.249.0/29", "51.149.249.32/29", "194.33.248.0/29", "20.49.214.199/32", "20.49.214.228/32", "20.26.11.71/32", "20.26.11.108/32", "128.77.75.128/26"]
...154 }
────────────────────────────────────────
monitoring.tf (terraform)
=========================
Tests:2 (SUCCESSES:1, FAILURES:1, EXCEPTIONS:0)
Failures:1 (HIGH:1, CRITICAL:0)
HIGH:Topicdoesnothaveencryptionenabled.
════════════════════════════════════════
Topicsshouldbeencryptedtoprotecttheircontents.Seehttps://avd.aquasec.com/misconfig/avd-aws-0095
────────────────────────────────────────
monitoring.tf:1-3
────────────────────────────────────────
1 ┌ resource"aws_sns_topic""lb_alarm_topic" {
2 │ name ="lb_alarm_topic"3 └ }
────────────────────────────────────────
trivy_exitcode=1
Trivy will check the following folders:
terraform/environments/cdpt-ifs
Running Trivy in terraform/environments/cdpt-ifs
2024-07-05T12:31:31Z INFO Need to update DB
2024-07-05T12:31:31Z INFO Downloading DB... repository="ghcr.io/aquasecurity/trivy-db:2"
2024-07-05T12:31:33Z INFO Vulnerability scanning is enabled
2024-07-05T12:31:33Z INFO Misconfiguration scanning is enabled
2024-07-05T12:31:33Z INFO Need to update the built-in policies
2024-07-05T12:31:33Z INFO Downloading the built-in policies...
74.86 KiB / 74.86 KiB [-----------------------------------------------------------] 100.00% ? p/s 0s2024-07-05T12:31:33Z INFO Secret scanning is enabled
2024-07-05T12:31:33Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-05T12:31:33Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection
2024-07-05T12:31:37Z INFO Number of language-specific files num=0
2024-07-05T12:31:37Z INFO Detected config files num=10
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33 resource "aws_security_group" "db" {
..
47 [ cidr_blocks = ["0.0.0.0/0"]
..
49 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349
via ecs.tf:344-350 (egress)
via ecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323 resource "aws_security_group" "cluster_ec2" {
...
349 [ cidr_blocks = ["0.0.0.0/0"]
...
358 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489
via ecs.tf:485-490 (egress)
via ecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473 resource "aws_security_group" "ecs_service" {
...
489 [ cidr_blocks = ["0.0.0.0/0"]
...
491 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
202 [ cidr_blocks = lookup(egress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
190 [ cidr_blocks = lookup(ingress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152
via loadbalancer.tf:147-153 (egress)
via loadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134 resource "aws_security_group" "ifs_lb_sc" {
...
152 [ cidr_blocks = ["0.0.0.0/0"]
...
154 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174
via loadbalancer.tf:169-175 (egress)
via loadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156 resource "aws_security_group" "ifs_target_sc" {
...
174 [ cidr_blocks = ["0.0.0.0/0"]
...
176 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running tflint in terraform/environments/cdpt-ifs
Excluding the following checks: terraform_unused_declarations
7issue(s) found:
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 121:121:value="${aws_db_instance.database.address}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 125:125:value="${aws_db_instance.database.username}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 129:129:value="${local.application_data.accounts[local.environment].db_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 133:133:value="${local.application_data.accounts[local.environment].client_id}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 137:137:value="${local.application_data.accounts[local.environment].env_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 406:406:Name="${local.application_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Missing version constraint for provider "random" in `required_providers` (terraform_required_providers)
on terraform/environments/cdpt-ifs/loadbalancer.tf line 97:97:resource"random_string""ifs_target_group_name" {
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_required_providers.mdtflint_exitcode=2
Trivy Scan Failed
Show Output
*****************************
Trivy will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running Trivy in terraform/environments/cdpt-ifs
2024-07-05T12:31:31Z INFO Need to update DB
2024-07-05T12:31:31Z INFO Downloading DB...repository="ghcr.io/aquasecurity/trivy-db:2"2024-07-05T12:31:33Z INFO Vulnerability scanning is enabled
2024-07-05T12:31:33Z INFO Misconfiguration scanning is enabled
2024-07-05T12:31:33Z INFO Need to update the built-in policies
2024-07-05T12:31:33Z INFO Downloading the built-in policies...74.86 KiB /74.86 KiB [-----------------------------------------------------------] 100.00%? p/s 0s2024-07-05T12:31:33Z INFO Secret scanning is enabled
2024-07-05T12:31:33Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-05T12:31:33Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection2024-07-05T12:31:37Z INFO Number of language-specific files num=02024-07-05T12:31:37Z INFO Detected config files num=10
database.tf (terraform)
=======================
Tests:3 (SUCCESSES:1, FAILURES:2, EXCEPTIONS:0)
Failures:2 (HIGH:1, CRITICAL:1)
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
See https://avd.aquasec.com/misconfig/avd-aws-0080
────────────────────────────────────────
database.tf:5-20
────────────────────────────────────────
5 ┌ resource"aws_db_instance""database" {
6 │ allocated_storage=local.application_data.accounts[local.environment].db_allocated_storage7 │ storage_type="gp2"8 │ engine="sqlserver-web"9 │ engine_version="14.00.3381.3.v1"10 │ instance_class=local.application_data.accounts[local.environment].db_instance_class11 │ identifier=local.application_data.accounts[local.environment].db_instance_identifier12 │ username=local.application_data.accounts[local.environment].db_user13 └ password=aws_secretsmanager_secret_version.dbase_password.secret_string..
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33resource"aws_security_group""db" {
..47 [ cidr_blocks = ["0.0.0.0/0"]
..49 }
────────────────────────────────────────
ecs.tf (terraform)
==================Tests:75 (SUCCESSES:5, FAILURES:2, EXCEPTIONS:68)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349viaecs.tf:344-350 (egress)
viaecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323resource"aws_security_group""cluster_ec2" {
...349 [ cidr_blocks = ["0.0.0.0/0"]
...358 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489viaecs.tf:485-490 (egress)
viaecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473resource"aws_security_group""ecs_service" {
...489 [ cidr_blocks = ["0.0.0.0/0"]
...491 }
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-bastion-linux?ref=v4.2.1/main.tf (terraform)
==========================================================================================================Tests:16 (SUCCESSES:5, FAILURES:0, EXCEPTIONS:11)
Failures:0 (HIGH:0, CRITICAL:0)
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf (terraform)
===========================================================================================================================================
Tests:7 (SUCCESSES:3, FAILURES:2, EXCEPTIONS:2)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...202 [ cidr_blocks =lookup(egress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...190 [ cidr_blocks =lookup(ingress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
loadbalancer.tf (terraform)
===========================
Tests:6 (SUCCESSES:3, FAILURES:3, EXCEPTIONS:0)
Failures:3 (HIGH:0, CRITICAL:3)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152vialoadbalancer.tf:147-153 (egress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...152 [ cidr_blocks = ["0.0.0.0/0"]
...154 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174vialoadbalancer.tf:169-175 (egress)
vialoadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156resource"aws_security_group""ifs_target_sc" {
...174 [ cidr_blocks = ["0.0.0.0/0"]
...176 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
loadbalancer.tf:144vialoadbalancer.tf:139-145 (ingress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...144 [ cidr_blocks = ["188.214.15.75/32", "192.168.5.101/32", "81.134.202.29/32", "79.152.189.104/32", "179.50.12.212/32", "188.172.252.34/32", "194.33.192.0/25", "194.33.193.0/25", "194.33.196.0/25", "194.33.197.0/25", "195.59.75.0/24", "201.33.21.5/32", "213.121.161.112/28", "52.67.148.55/32", "54.94.206.111/32", "178.248.34.42/32", "178.248.34.43/32", "178.248.34.44/32", "178.248.34.45/32", "178.248.34.46/32", "178.248.34.47/32", "89.32.121.144/32", "185.191.249.100/32", "2.138.20.8/32", "18.169.147.172/32", "35.176.93.186/32", "18.130.148.126/32", "35.176.148.126/32", "51.149.250.0/24", "51.149.249.0/29", "194.33.249.0/29", "51.149.249.32/29", "194.33.248.0/29", "20.49.214.199/32", "20.49.214.228/32", "20.26.11.71/32", "20.26.11.108/32", "128.77.75.128/26"]
...154 }
────────────────────────────────────────
monitoring.tf (terraform)
=========================
Tests:2 (SUCCESSES:1, FAILURES:1, EXCEPTIONS:0)
Failures:1 (HIGH:1, CRITICAL:0)
HIGH:Topicdoesnothaveencryptionenabled.
════════════════════════════════════════
Topicsshouldbeencryptedtoprotecttheircontents.Seehttps://avd.aquasec.com/misconfig/avd-aws-0095
────────────────────────────────────────
monitoring.tf:1-3
────────────────────────────────────────
1 ┌ resource"aws_sns_topic""lb_alarm_topic" {
2 │ name ="lb_alarm_topic"3 └ }
────────────────────────────────────────
trivy_exitcode=1
Trivy will check the following folders:
terraform/environments/cdpt-ifs
Running Trivy in terraform/environments/cdpt-ifs
2024-07-05T13:59:18Z INFO Need to update DB
2024-07-05T13:59:18Z INFO Downloading DB... repository="ghcr.io/aquasecurity/trivy-db:2"
2024-07-05T13:59:20Z INFO Vulnerability scanning is enabled
2024-07-05T13:59:20Z INFO Misconfiguration scanning is enabled
2024-07-05T13:59:20Z INFO Need to update the built-in policies
2024-07-05T13:59:20Z INFO Downloading the built-in policies...
74.86 KiB / 74.86 KiB [-----------------------------------------------------------] 100.00% ? p/s 0s2024-07-05T13:59:21Z INFO Secret scanning is enabled
2024-07-05T13:59:21Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-05T13:59:21Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection
2024-07-05T13:59:25Z INFO Number of language-specific files num=0
2024-07-05T13:59:25Z INFO Detected config files num=10
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33 resource "aws_security_group" "db" {
..
47 [ cidr_blocks = ["0.0.0.0/0"]
..
49 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349
via ecs.tf:344-350 (egress)
via ecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323 resource "aws_security_group" "cluster_ec2" {
...
349 [ cidr_blocks = ["0.0.0.0/0"]
...
358 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489
via ecs.tf:485-490 (egress)
via ecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473 resource "aws_security_group" "ecs_service" {
...
489 [ cidr_blocks = ["0.0.0.0/0"]
...
491 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
202 [ cidr_blocks = lookup(egress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
190 [ cidr_blocks = lookup(ingress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152
via loadbalancer.tf:147-153 (egress)
via loadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134 resource "aws_security_group" "ifs_lb_sc" {
...
152 [ cidr_blocks = ["0.0.0.0/0"]
...
154 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174
via loadbalancer.tf:169-175 (egress)
via loadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156 resource "aws_security_group" "ifs_target_sc" {
...
174 [ cidr_blocks = ["0.0.0.0/0"]
...
176 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running tflint in terraform/environments/cdpt-ifs
Excluding the following checks: terraform_unused_declarations
7issue(s) found:
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 121:121:value="${aws_db_instance.database.address}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 125:125:value="${aws_db_instance.database.username}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 129:129:value="${local.application_data.accounts[local.environment].db_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 133:133:value="${local.application_data.accounts[local.environment].client_id}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 137:137:value="${local.application_data.accounts[local.environment].env_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 406:406:Name="${local.application_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Missing version constraint for provider "random" in `required_providers` (terraform_required_providers)
on terraform/environments/cdpt-ifs/loadbalancer.tf line 97:97:resource"random_string""ifs_target_group_name" {
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_required_providers.mdtflint_exitcode=2
Trivy Scan Failed
Show Output
*****************************
Trivy will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running Trivy in terraform/environments/cdpt-ifs
2024-07-05T13:59:18Z INFO Need to update DB
2024-07-05T13:59:18Z INFO Downloading DB...repository="ghcr.io/aquasecurity/trivy-db:2"2024-07-05T13:59:20Z INFO Vulnerability scanning is enabled
2024-07-05T13:59:20Z INFO Misconfiguration scanning is enabled
2024-07-05T13:59:20Z INFO Need to update the built-in policies
2024-07-05T13:59:20Z INFO Downloading the built-in policies...74.86 KiB /74.86 KiB [-----------------------------------------------------------] 100.00%? p/s 0s2024-07-05T13:59:21Z INFO Secret scanning is enabled
2024-07-05T13:59:21Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-05T13:59:21Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection2024-07-05T13:59:25Z INFO Number of language-specific files num=02024-07-05T13:59:25Z INFO Detected config files num=10
database.tf (terraform)
=======================
Tests:3 (SUCCESSES:1, FAILURES:2, EXCEPTIONS:0)
Failures:2 (HIGH:1, CRITICAL:1)
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
See https://avd.aquasec.com/misconfig/avd-aws-0080
────────────────────────────────────────
database.tf:5-20
────────────────────────────────────────
5 ┌ resource"aws_db_instance""database" {
6 │ allocated_storage=local.application_data.accounts[local.environment].db_allocated_storage7 │ storage_type="gp2"8 │ engine="sqlserver-web"9 │ engine_version="14.00.3381.3.v1"10 │ instance_class=local.application_data.accounts[local.environment].db_instance_class11 │ identifier=local.application_data.accounts[local.environment].db_instance_identifier12 │ username=local.application_data.accounts[local.environment].db_user13 └ password=aws_secretsmanager_secret_version.dbase_password.secret_string..
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33resource"aws_security_group""db" {
..47 [ cidr_blocks = ["0.0.0.0/0"]
..49 }
────────────────────────────────────────
ecs.tf (terraform)
==================Tests:75 (SUCCESSES:5, FAILURES:2, EXCEPTIONS:68)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349viaecs.tf:344-350 (egress)
viaecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323resource"aws_security_group""cluster_ec2" {
...349 [ cidr_blocks = ["0.0.0.0/0"]
...358 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489viaecs.tf:485-490 (egress)
viaecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473resource"aws_security_group""ecs_service" {
...489 [ cidr_blocks = ["0.0.0.0/0"]
...491 }
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-bastion-linux?ref=v4.2.1/main.tf (terraform)
==========================================================================================================Tests:16 (SUCCESSES:5, FAILURES:0, EXCEPTIONS:11)
Failures:0 (HIGH:0, CRITICAL:0)
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf (terraform)
===========================================================================================================================================
Tests:7 (SUCCESSES:3, FAILURES:2, EXCEPTIONS:2)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...202 [ cidr_blocks =lookup(egress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...190 [ cidr_blocks =lookup(ingress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
loadbalancer.tf (terraform)
===========================
Tests:6 (SUCCESSES:3, FAILURES:3, EXCEPTIONS:0)
Failures:3 (HIGH:0, CRITICAL:3)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152vialoadbalancer.tf:147-153 (egress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...152 [ cidr_blocks = ["0.0.0.0/0"]
...154 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174vialoadbalancer.tf:169-175 (egress)
vialoadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156resource"aws_security_group""ifs_target_sc" {
...174 [ cidr_blocks = ["0.0.0.0/0"]
...176 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
loadbalancer.tf:144vialoadbalancer.tf:139-145 (ingress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...144 [ cidr_blocks = ["188.214.15.75/32", "192.168.5.101/32", "81.134.202.29/32", "79.152.189.104/32", "179.50.12.212/32", "188.172.252.34/32", "194.33.192.0/25", "194.33.193.0/25", "194.33.196.0/25", "194.33.197.0/25", "195.59.75.0/24", "201.33.21.5/32", "213.121.161.112/28", "52.67.148.55/32", "54.94.206.111/32", "178.248.34.42/32", "178.248.34.43/32", "178.248.34.44/32", "178.248.34.45/32", "178.248.34.46/32", "178.248.34.47/32", "89.32.121.144/32", "185.191.249.100/32", "2.138.20.8/32", "18.169.147.172/32", "35.176.93.186/32", "18.130.148.126/32", "35.176.148.126/32", "51.149.250.0/24", "51.149.249.0/29", "194.33.249.0/29", "51.149.249.32/29", "194.33.248.0/29", "20.49.214.199/32", "20.49.214.228/32", "20.26.11.71/32", "20.26.11.108/32", "128.77.75.128/26"]
...154 }
────────────────────────────────────────
trivy_exitcode=1
Trivy will check the following folders:
terraform/environments/cdpt-ifs
Running Trivy in terraform/environments/cdpt-ifs
2024-07-05T15:20:04Z INFO Need to update DB
2024-07-05T15:20:04Z INFO Downloading DB... repository="ghcr.io/aquasecurity/trivy-db:2"
2024-07-05T15:20:06Z INFO Vulnerability scanning is enabled
2024-07-05T15:20:06Z INFO Misconfiguration scanning is enabled
2024-07-05T15:20:06Z INFO Need to update the built-in policies
2024-07-05T15:20:06Z INFO Downloading the built-in policies...
74.86 KiB / 74.86 KiB [-----------------------------------------------------------] 100.00% ? p/s 0s2024-07-05T15:20:07Z INFO Secret scanning is enabled
2024-07-05T15:20:07Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-05T15:20:07Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection
2024-07-05T15:20:09Z INFO Number of language-specific files num=0
2024-07-05T15:20:09Z INFO Detected config files num=10
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33 resource "aws_security_group" "db" {
..
47 [ cidr_blocks = ["0.0.0.0/0"]
..
49 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349
via ecs.tf:344-350 (egress)
via ecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323 resource "aws_security_group" "cluster_ec2" {
...
349 [ cidr_blocks = ["0.0.0.0/0"]
...
358 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489
via ecs.tf:485-490 (egress)
via ecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473 resource "aws_security_group" "ecs_service" {
...
489 [ cidr_blocks = ["0.0.0.0/0"]
...
491 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
202 [ cidr_blocks = lookup(egress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
190 [ cidr_blocks = lookup(ingress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152
via loadbalancer.tf:147-153 (egress)
via loadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134 resource "aws_security_group" "ifs_lb_sc" {
...
152 [ cidr_blocks = ["0.0.0.0/0"]
...
154 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174
via loadbalancer.tf:169-175 (egress)
via loadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156 resource "aws_security_group" "ifs_target_sc" {
...
174 [ cidr_blocks = ["0.0.0.0/0"]
...
176 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running tflint in terraform/environments/cdpt-ifs
Excluding the following checks: terraform_unused_declarations
7issue(s) found:
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 121:121:value="${aws_db_instance.database.address}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 125:125:value="${aws_db_instance.database.username}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 129:129:value="${local.application_data.accounts[local.environment].db_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 133:133:value="${local.application_data.accounts[local.environment].client_id}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 137:137:value="${local.application_data.accounts[local.environment].env_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 406:406:Name="${local.application_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Missing version constraint for provider "random" in `required_providers` (terraform_required_providers)
on terraform/environments/cdpt-ifs/loadbalancer.tf line 97:97:resource"random_string""ifs_target_group_name" {
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_required_providers.mdtflint_exitcode=2
Trivy Scan Failed
Show Output
*****************************
Trivy will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running Trivy in terraform/environments/cdpt-ifs
2024-07-05T15:20:04Z INFO Need to update DB
2024-07-05T15:20:04Z INFO Downloading DB...repository="ghcr.io/aquasecurity/trivy-db:2"2024-07-05T15:20:06Z INFO Vulnerability scanning is enabled
2024-07-05T15:20:06Z INFO Misconfiguration scanning is enabled
2024-07-05T15:20:06Z INFO Need to update the built-in policies
2024-07-05T15:20:06Z INFO Downloading the built-in policies...74.86 KiB /74.86 KiB [-----------------------------------------------------------] 100.00%? p/s 0s2024-07-05T15:20:07Z INFO Secret scanning is enabled
2024-07-05T15:20:07Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-05T15:20:07Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection2024-07-05T15:20:09Z INFO Number of language-specific files num=02024-07-05T15:20:09Z INFO Detected config files num=10
database.tf (terraform)
=======================
Tests:3 (SUCCESSES:1, FAILURES:2, EXCEPTIONS:0)
Failures:2 (HIGH:1, CRITICAL:1)
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
See https://avd.aquasec.com/misconfig/avd-aws-0080
────────────────────────────────────────
database.tf:5-20
────────────────────────────────────────
5 ┌ resource"aws_db_instance""database" {
6 │ allocated_storage=local.application_data.accounts[local.environment].db_allocated_storage7 │ storage_type="gp2"8 │ engine="sqlserver-web"9 │ engine_version="14.00.3381.3.v1"10 │ instance_class=local.application_data.accounts[local.environment].db_instance_class11 │ identifier=local.application_data.accounts[local.environment].db_instance_identifier12 │ username=local.application_data.accounts[local.environment].db_user13 └ password=aws_secretsmanager_secret_version.dbase_password.secret_string..
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33resource"aws_security_group""db" {
..47 [ cidr_blocks = ["0.0.0.0/0"]
..49 }
────────────────────────────────────────
ecs.tf (terraform)
==================Tests:75 (SUCCESSES:5, FAILURES:2, EXCEPTIONS:68)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349viaecs.tf:344-350 (egress)
viaecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323resource"aws_security_group""cluster_ec2" {
...349 [ cidr_blocks = ["0.0.0.0/0"]
...358 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489viaecs.tf:485-490 (egress)
viaecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473resource"aws_security_group""ecs_service" {
...489 [ cidr_blocks = ["0.0.0.0/0"]
...491 }
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-bastion-linux?ref=v4.2.1/main.tf (terraform)
==========================================================================================================Tests:16 (SUCCESSES:5, FAILURES:0, EXCEPTIONS:11)
Failures:0 (HIGH:0, CRITICAL:0)
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf (terraform)
===========================================================================================================================================
Tests:7 (SUCCESSES:3, FAILURES:2, EXCEPTIONS:2)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...202 [ cidr_blocks =lookup(egress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...190 [ cidr_blocks =lookup(ingress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
loadbalancer.tf (terraform)
===========================
Tests:6 (SUCCESSES:3, FAILURES:3, EXCEPTIONS:0)
Failures:3 (HIGH:0, CRITICAL:3)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152vialoadbalancer.tf:147-153 (egress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...152 [ cidr_blocks = ["0.0.0.0/0"]
...154 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174vialoadbalancer.tf:169-175 (egress)
vialoadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156resource"aws_security_group""ifs_target_sc" {
...174 [ cidr_blocks = ["0.0.0.0/0"]
...176 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
loadbalancer.tf:144vialoadbalancer.tf:139-145 (ingress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...144 [ cidr_blocks = ["188.214.15.75/32", "192.168.5.101/32", "81.134.202.29/32", "79.152.189.104/32", "179.50.12.212/32", "188.172.252.34/32", "194.33.192.0/25", "194.33.193.0/25", "194.33.196.0/25", "194.33.197.0/25", "195.59.75.0/24", "201.33.21.5/32", "213.121.161.112/28", "52.67.148.55/32", "54.94.206.111/32", "178.248.34.42/32", "178.248.34.43/32", "178.248.34.44/32", "178.248.34.45/32", "178.248.34.46/32", "178.248.34.47/32", "89.32.121.144/32", "185.191.249.100/32", "2.138.20.8/32", "18.169.147.172/32", "35.176.93.186/32", "18.130.148.126/32", "35.176.148.126/32", "51.149.250.0/24", "51.149.249.0/29", "194.33.249.0/29", "51.149.249.32/29", "194.33.248.0/29", "20.49.214.199/32", "20.49.214.228/32", "20.26.11.71/32", "20.26.11.108/32", "128.77.75.128/26"]
...154 }
────────────────────────────────────────
monitoring.tf (terraform)
=========================
Tests:2 (SUCCESSES:1, FAILURES:1, EXCEPTIONS:0)
Failures:1 (HIGH:1, CRITICAL:0)
HIGH:Topicdoesnothaveencryptionenabled.
════════════════════════════════════════
Topicsshouldbeencryptedtoprotecttheircontents.Seehttps://avd.aquasec.com/misconfig/avd-aws-0095
────────────────────────────────────────
monitoring.tf:17-19
────────────────────────────────────────
17 ┌ resource"aws_sns_topic""lb_5xx_alarm_topic" {
18 │ name ="lb_5xx_alarm_topic"19 └ }
────────────────────────────────────────
trivy_exitcode=1
Trivy will check the following folders:
terraform/environments/cdpt-ifs
Running Trivy in terraform/environments/cdpt-ifs
2024-07-08T16:01:05Z INFO Need to update DB
2024-07-08T16:01:05Z INFO Downloading DB... repository="ghcr.io/aquasecurity/trivy-db:2"
2024-07-08T16:01:07Z INFO Vulnerability scanning is enabled
2024-07-08T16:01:07Z INFO Misconfiguration scanning is enabled
2024-07-08T16:01:07Z INFO Need to update the built-in policies
2024-07-08T16:01:07Z INFO Downloading the built-in policies...
74.86 KiB / 74.86 KiB [-----------------------------------------------------------] 100.00% ? p/s 0s2024-07-08T16:01:07Z INFO Secret scanning is enabled
2024-07-08T16:01:07Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-08T16:01:07Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection
2024-07-08T16:01:12Z INFO Number of language-specific files num=0
2024-07-08T16:01:12Z INFO Detected config files num=10
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33 resource "aws_security_group" "db" {
..
47 [ cidr_blocks = ["0.0.0.0/0"]
..
49 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349
via ecs.tf:344-350 (egress)
via ecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323 resource "aws_security_group" "cluster_ec2" {
...
349 [ cidr_blocks = ["0.0.0.0/0"]
...
358 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489
via ecs.tf:485-490 (egress)
via ecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473 resource "aws_security_group" "ecs_service" {
...
489 [ cidr_blocks = ["0.0.0.0/0"]
...
491 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
202 [ cidr_blocks = lookup(egress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
190 [ cidr_blocks = lookup(ingress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152
via loadbalancer.tf:147-153 (egress)
via loadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134 resource "aws_security_group" "ifs_lb_sc" {
...
152 [ cidr_blocks = ["0.0.0.0/0"]
...
154 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174
via loadbalancer.tf:169-175 (egress)
via loadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156 resource "aws_security_group" "ifs_target_sc" {
...
174 [ cidr_blocks = ["0.0.0.0/0"]
...
176 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running tflint in terraform/environments/cdpt-ifs
Excluding the following checks: terraform_unused_declarations
7issue(s) found:
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 121:121:value="${aws_db_instance.database.address}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 125:125:value="${aws_db_instance.database.username}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 129:129:value="${local.application_data.accounts[local.environment].db_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 133:133:value="${local.application_data.accounts[local.environment].client_id}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 137:137:value="${local.application_data.accounts[local.environment].env_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 406:406:Name="${local.application_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Missing version constraint for provider "random" in `required_providers` (terraform_required_providers)
on terraform/environments/cdpt-ifs/loadbalancer.tf line 97:97:resource"random_string""ifs_target_group_name" {
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_required_providers.mdtflint_exitcode=2
Trivy Scan Failed
Show Output
*****************************
Trivy will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running Trivy in terraform/environments/cdpt-ifs
2024-07-08T16:01:05Z INFO Need to update DB
2024-07-08T16:01:05Z INFO Downloading DB...repository="ghcr.io/aquasecurity/trivy-db:2"2024-07-08T16:01:07Z INFO Vulnerability scanning is enabled
2024-07-08T16:01:07Z INFO Misconfiguration scanning is enabled
2024-07-08T16:01:07Z INFO Need to update the built-in policies
2024-07-08T16:01:07Z INFO Downloading the built-in policies...74.86 KiB /74.86 KiB [-----------------------------------------------------------] 100.00%? p/s 0s2024-07-08T16:01:07Z INFO Secret scanning is enabled
2024-07-08T16:01:07Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-08T16:01:07Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection2024-07-08T16:01:12Z INFO Number of language-specific files num=02024-07-08T16:01:12Z INFO Detected config files num=10
database.tf (terraform)
=======================
Tests:3 (SUCCESSES:1, FAILURES:2, EXCEPTIONS:0)
Failures:2 (HIGH:1, CRITICAL:1)
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
See https://avd.aquasec.com/misconfig/avd-aws-0080
────────────────────────────────────────
database.tf:5-20
────────────────────────────────────────
5 ┌ resource"aws_db_instance""database" {
6 │ allocated_storage=local.application_data.accounts[local.environment].db_allocated_storage7 │ storage_type="gp2"8 │ engine="sqlserver-web"9 │ engine_version="14.00.3381.3.v1"10 │ instance_class=local.application_data.accounts[local.environment].db_instance_class11 │ identifier=local.application_data.accounts[local.environment].db_instance_identifier12 │ username=local.application_data.accounts[local.environment].db_user13 └ password=aws_secretsmanager_secret_version.dbase_password.secret_string..
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33resource"aws_security_group""db" {
..47 [ cidr_blocks = ["0.0.0.0/0"]
..49 }
────────────────────────────────────────
ecs.tf (terraform)
==================Tests:75 (SUCCESSES:5, FAILURES:2, EXCEPTIONS:68)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349viaecs.tf:344-350 (egress)
viaecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323resource"aws_security_group""cluster_ec2" {
...349 [ cidr_blocks = ["0.0.0.0/0"]
...358 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489viaecs.tf:485-490 (egress)
viaecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473resource"aws_security_group""ecs_service" {
...489 [ cidr_blocks = ["0.0.0.0/0"]
...491 }
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-bastion-linux?ref=v4.2.1/main.tf (terraform)
==========================================================================================================Tests:16 (SUCCESSES:5, FAILURES:0, EXCEPTIONS:11)
Failures:0 (HIGH:0, CRITICAL:0)
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf (terraform)
===========================================================================================================================================
Tests:7 (SUCCESSES:3, FAILURES:2, EXCEPTIONS:2)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...202 [ cidr_blocks =lookup(egress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...190 [ cidr_blocks =lookup(ingress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
loadbalancer.tf (terraform)
===========================
Tests:6 (SUCCESSES:3, FAILURES:3, EXCEPTIONS:0)
Failures:3 (HIGH:0, CRITICAL:3)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152vialoadbalancer.tf:147-153 (egress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...152 [ cidr_blocks = ["0.0.0.0/0"]
...154 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174vialoadbalancer.tf:169-175 (egress)
vialoadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156resource"aws_security_group""ifs_target_sc" {
...174 [ cidr_blocks = ["0.0.0.0/0"]
...176 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
loadbalancer.tf:144vialoadbalancer.tf:139-145 (ingress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...144 [ cidr_blocks = ["188.214.15.75/32", "192.168.5.101/32", "81.134.202.29/32", "79.152.189.104/32", "179.50.12.212/32", "188.172.252.34/32", "194.33.192.0/25", "194.33.193.0/25", "194.33.196.0/25", "194.33.197.0/25", "195.59.75.0/24", "201.33.21.5/32", "213.121.161.112/28", "52.67.148.55/32", "54.94.206.111/32", "178.248.34.42/32", "178.248.34.43/32", "178.248.34.44/32", "178.248.34.45/32", "178.248.34.46/32", "178.248.34.47/32", "89.32.121.144/32", "185.191.249.100/32", "2.138.20.8/32", "18.169.147.172/32", "35.176.93.186/32", "18.130.148.126/32", "35.176.148.126/32", "51.149.250.0/24", "51.149.249.0/29", "194.33.249.0/29", "51.149.249.32/29", "194.33.248.0/29", "20.49.214.199/32", "20.49.214.228/32", "20.26.11.71/32", "20.26.11.108/32", "128.77.75.128/26"]
...154 }
────────────────────────────────────────
monitoring.tf (terraform)
=========================
Tests:2 (SUCCESSES:1, FAILURES:1, EXCEPTIONS:0)
Failures:1 (HIGH:1, CRITICAL:0)
HIGH:Topicdoesnothaveencryptionenabled.
════════════════════════════════════════
Topicsshouldbeencryptedtoprotecttheircontents.Seehttps://avd.aquasec.com/misconfig/avd-aws-0095
────────────────────────────────────────
monitoring.tf:18-20
────────────────────────────────────────
18 ┌ resource"aws_sns_topic""lb_5xx_alarm_topic" {
19 │ name ="lb_5xx_alarm_topic"20 └ }
────────────────────────────────────────
trivy_exitcode=1
Trivy will check the following folders:
terraform/environments/cdpt-ifs
Running Trivy in terraform/environments/cdpt-ifs
2024-07-09T13:47:48Z INFO Need to update DB
2024-07-09T13:47:48Z INFO Downloading DB... repository="ghcr.io/aquasecurity/trivy-db:2"
2024-07-09T13:47:50Z INFO Vulnerability scanning is enabled
2024-07-09T13:47:50Z INFO Misconfiguration scanning is enabled
2024-07-09T13:47:50Z INFO Need to update the built-in policies
2024-07-09T13:47:50Z INFO Downloading the built-in policies...
74.86 KiB / 74.86 KiB [-----------------------------------------------------------] 100.00% ? p/s 0s2024-07-09T13:47:51Z INFO Secret scanning is enabled
2024-07-09T13:47:51Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-09T13:47:51Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection
2024-07-09T13:47:53Z INFO Number of language-specific files num=0
2024-07-09T13:47:53Z INFO Detected config files num=10
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33 resource "aws_security_group" "db" {
..
47 [ cidr_blocks = ["0.0.0.0/0"]
..
49 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349
via ecs.tf:344-350 (egress)
via ecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323 resource "aws_security_group" "cluster_ec2" {
...
349 [ cidr_blocks = ["0.0.0.0/0"]
...
358 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489
via ecs.tf:485-490 (egress)
via ecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473 resource "aws_security_group" "ecs_service" {
...
489 [ cidr_blocks = ["0.0.0.0/0"]
...
491 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
202 [ cidr_blocks = lookup(egress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
190 [ cidr_blocks = lookup(ingress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152
via loadbalancer.tf:147-153 (egress)
via loadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134 resource "aws_security_group" "ifs_lb_sc" {
...
152 [ cidr_blocks = ["0.0.0.0/0"]
...
154 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174
via loadbalancer.tf:169-175 (egress)
via loadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156 resource "aws_security_group" "ifs_target_sc" {
...
174 [ cidr_blocks = ["0.0.0.0/0"]
...
176 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running tflint in terraform/environments/cdpt-ifs
Excluding the following checks: terraform_unused_declarations
7issue(s) found:
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 121:121:value="${aws_db_instance.database.address}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 125:125:value="${aws_db_instance.database.username}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 129:129:value="${local.application_data.accounts[local.environment].db_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 133:133:value="${local.application_data.accounts[local.environment].client_id}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 137:137:value="${local.application_data.accounts[local.environment].env_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 406:406:Name="${local.application_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Missing version constraint for provider "random" in `required_providers` (terraform_required_providers)
on terraform/environments/cdpt-ifs/loadbalancer.tf line 97:97:resource"random_string""ifs_target_group_name" {
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_required_providers.mdtflint_exitcode=2
Trivy Scan Failed
Show Output
*****************************
Trivy will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running Trivy in terraform/environments/cdpt-ifs
2024-07-09T13:47:48Z INFO Need to update DB
2024-07-09T13:47:48Z INFO Downloading DB...repository="ghcr.io/aquasecurity/trivy-db:2"2024-07-09T13:47:50Z INFO Vulnerability scanning is enabled
2024-07-09T13:47:50Z INFO Misconfiguration scanning is enabled
2024-07-09T13:47:50Z INFO Need to update the built-in policies
2024-07-09T13:47:50Z INFO Downloading the built-in policies...74.86 KiB /74.86 KiB [-----------------------------------------------------------] 100.00%? p/s 0s2024-07-09T13:47:51Z INFO Secret scanning is enabled
2024-07-09T13:47:51Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-09T13:47:51Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection2024-07-09T13:47:53Z INFO Number of language-specific files num=02024-07-09T13:47:53Z INFO Detected config files num=10
database.tf (terraform)
=======================
Tests:3 (SUCCESSES:1, FAILURES:2, EXCEPTIONS:0)
Failures:2 (HIGH:1, CRITICAL:1)
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
See https://avd.aquasec.com/misconfig/avd-aws-0080
────────────────────────────────────────
database.tf:5-20
────────────────────────────────────────
5 ┌ resource"aws_db_instance""database" {
6 │ allocated_storage=local.application_data.accounts[local.environment].db_allocated_storage7 │ storage_type="gp2"8 │ engine="sqlserver-web"9 │ engine_version="14.00.3381.3.v1"10 │ instance_class=local.application_data.accounts[local.environment].db_instance_class11 │ identifier=local.application_data.accounts[local.environment].db_instance_identifier12 │ username=local.application_data.accounts[local.environment].db_user13 └ password=aws_secretsmanager_secret_version.dbase_password.secret_string..
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33resource"aws_security_group""db" {
..47 [ cidr_blocks = ["0.0.0.0/0"]
..49 }
────────────────────────────────────────
ecs.tf (terraform)
==================Tests:75 (SUCCESSES:5, FAILURES:2, EXCEPTIONS:68)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349viaecs.tf:344-350 (egress)
viaecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323resource"aws_security_group""cluster_ec2" {
...349 [ cidr_blocks = ["0.0.0.0/0"]
...358 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489viaecs.tf:485-490 (egress)
viaecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473resource"aws_security_group""ecs_service" {
...489 [ cidr_blocks = ["0.0.0.0/0"]
...491 }
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-bastion-linux?ref=v4.2.1/main.tf (terraform)
==========================================================================================================Tests:16 (SUCCESSES:5, FAILURES:0, EXCEPTIONS:11)
Failures:0 (HIGH:0, CRITICAL:0)
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf (terraform)
===========================================================================================================================================
Tests:7 (SUCCESSES:3, FAILURES:2, EXCEPTIONS:2)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...202 [ cidr_blocks =lookup(egress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...190 [ cidr_blocks =lookup(ingress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
loadbalancer.tf (terraform)
===========================
Tests:6 (SUCCESSES:3, FAILURES:3, EXCEPTIONS:0)
Failures:3 (HIGH:0, CRITICAL:3)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152vialoadbalancer.tf:147-153 (egress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...152 [ cidr_blocks = ["0.0.0.0/0"]
...154 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174vialoadbalancer.tf:169-175 (egress)
vialoadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156resource"aws_security_group""ifs_target_sc" {
...174 [ cidr_blocks = ["0.0.0.0/0"]
...176 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
loadbalancer.tf:144vialoadbalancer.tf:139-145 (ingress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...144 [ cidr_blocks = ["188.214.15.75/32", "192.168.5.101/32", "81.134.202.29/32", "79.152.189.104/32", "179.50.12.212/32", "188.172.252.34/32", "194.33.192.0/25", "194.33.193.0/25", "194.33.196.0/25", "194.33.197.0/25", "195.59.75.0/24", "201.33.21.5/32", "213.121.161.112/28", "52.67.148.55/32", "54.94.206.111/32", "178.248.34.42/32", "178.248.34.43/32", "178.248.34.44/32", "178.248.34.45/32", "178.248.34.46/32", "178.248.34.47/32", "89.32.121.144/32", "185.191.249.100/32", "2.138.20.8/32", "18.169.147.172/32", "35.176.93.186/32", "18.130.148.126/32", "35.176.148.126/32", "51.149.250.0/24", "51.149.249.0/29", "194.33.249.0/29", "51.149.249.32/29", "194.33.248.0/29", "20.49.214.199/32", "20.49.214.228/32", "20.26.11.71/32", "20.26.11.108/32", "128.77.75.128/26"]
...154 }
────────────────────────────────────────
monitoring.tf (terraform)
=========================
Tests:2 (SUCCESSES:1, FAILURES:1, EXCEPTIONS:0)
Failures:1 (HIGH:1, CRITICAL:0)
HIGH:Topicdoesnothaveencryptionenabled.
════════════════════════════════════════
Topicsshouldbeencryptedtoprotecttheircontents.Seehttps://avd.aquasec.com/misconfig/avd-aws-0095
────────────────────────────────────────
monitoring.tf:5-7
────────────────────────────────────────
5 ┌ resource"aws_sns_topic""lb_5xx_alarm_topic" {
6 │ name ="lb_5xx_alarm_topic"7 └ }
────────────────────────────────────────
trivy_exitcode=1
Trivy will check the following folders:
terraform/environments/cdpt-ifs
Running Trivy in terraform/environments/cdpt-ifs
2024-07-09T13:53:50Z INFO Need to update DB
2024-07-09T13:53:50Z INFO Downloading DB... repository="ghcr.io/aquasecurity/trivy-db:2"
2024-07-09T13:53:52Z INFO Vulnerability scanning is enabled
2024-07-09T13:53:52Z INFO Misconfiguration scanning is enabled
2024-07-09T13:53:52Z INFO Need to update the built-in policies
2024-07-09T13:53:52Z INFO Downloading the built-in policies...
74.86 KiB / 74.86 KiB [-----------------------------------------------------------] 100.00% ? p/s 0s2024-07-09T13:53:52Z INFO Secret scanning is enabled
2024-07-09T13:53:52Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-09T13:53:52Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection
2024-07-09T13:53:55Z INFO Number of language-specific files num=0
2024-07-09T13:53:55Z INFO Detected config files num=10
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33 resource "aws_security_group" "db" {
..
47 [ cidr_blocks = ["0.0.0.0/0"]
..
49 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349
via ecs.tf:344-350 (egress)
via ecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323 resource "aws_security_group" "cluster_ec2" {
...
349 [ cidr_blocks = ["0.0.0.0/0"]
...
358 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489
via ecs.tf:485-490 (egress)
via ecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473 resource "aws_security_group" "ecs_service" {
...
489 [ cidr_blocks = ["0.0.0.0/0"]
...
491 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
202 [ cidr_blocks = lookup(egress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
190 [ cidr_blocks = lookup(ingress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152
via loadbalancer.tf:147-153 (egress)
via loadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134 resource "aws_security_group" "ifs_lb_sc" {
...
152 [ cidr_blocks = ["0.0.0.0/0"]
...
154 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174
via loadbalancer.tf:169-175 (egress)
via loadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156 resource "aws_security_group" "ifs_target_sc" {
...
174 [ cidr_blocks = ["0.0.0.0/0"]
...
176 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running tflint in terraform/environments/cdpt-ifs
Excluding the following checks: terraform_unused_declarations
7issue(s) found:
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 121:121:value="${aws_db_instance.database.address}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 125:125:value="${aws_db_instance.database.username}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 129:129:value="${local.application_data.accounts[local.environment].db_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 133:133:value="${local.application_data.accounts[local.environment].client_id}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 137:137:value="${local.application_data.accounts[local.environment].env_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 406:406:Name="${local.application_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Missing version constraint for provider "random" in `required_providers` (terraform_required_providers)
on terraform/environments/cdpt-ifs/loadbalancer.tf line 97:97:resource"random_string""ifs_target_group_name" {
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_required_providers.mdtflint_exitcode=2
Trivy Scan Failed
Show Output
*****************************
Trivy will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running Trivy in terraform/environments/cdpt-ifs
2024-07-09T13:53:50Z INFO Need to update DB
2024-07-09T13:53:50Z INFO Downloading DB...repository="ghcr.io/aquasecurity/trivy-db:2"2024-07-09T13:53:52Z INFO Vulnerability scanning is enabled
2024-07-09T13:53:52Z INFO Misconfiguration scanning is enabled
2024-07-09T13:53:52Z INFO Need to update the built-in policies
2024-07-09T13:53:52Z INFO Downloading the built-in policies...74.86 KiB /74.86 KiB [-----------------------------------------------------------] 100.00%? p/s 0s2024-07-09T13:53:52Z INFO Secret scanning is enabled
2024-07-09T13:53:52Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-09T13:53:52Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection2024-07-09T13:53:55Z INFO Number of language-specific files num=02024-07-09T13:53:55Z INFO Detected config files num=10
database.tf (terraform)
=======================
Tests:3 (SUCCESSES:1, FAILURES:2, EXCEPTIONS:0)
Failures:2 (HIGH:1, CRITICAL:1)
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
See https://avd.aquasec.com/misconfig/avd-aws-0080
────────────────────────────────────────
database.tf:5-20
────────────────────────────────────────
5 ┌ resource"aws_db_instance""database" {
6 │ allocated_storage=local.application_data.accounts[local.environment].db_allocated_storage7 │ storage_type="gp2"8 │ engine="sqlserver-web"9 │ engine_version="14.00.3381.3.v1"10 │ instance_class=local.application_data.accounts[local.environment].db_instance_class11 │ identifier=local.application_data.accounts[local.environment].db_instance_identifier12 │ username=local.application_data.accounts[local.environment].db_user13 └ password=aws_secretsmanager_secret_version.dbase_password.secret_string..
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33resource"aws_security_group""db" {
..47 [ cidr_blocks = ["0.0.0.0/0"]
..49 }
────────────────────────────────────────
ecs.tf (terraform)
==================Tests:75 (SUCCESSES:5, FAILURES:2, EXCEPTIONS:68)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349viaecs.tf:344-350 (egress)
viaecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323resource"aws_security_group""cluster_ec2" {
...349 [ cidr_blocks = ["0.0.0.0/0"]
...358 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489viaecs.tf:485-490 (egress)
viaecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473resource"aws_security_group""ecs_service" {
...489 [ cidr_blocks = ["0.0.0.0/0"]
...491 }
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-bastion-linux?ref=v4.2.1/main.tf (terraform)
==========================================================================================================Tests:16 (SUCCESSES:5, FAILURES:0, EXCEPTIONS:11)
Failures:0 (HIGH:0, CRITICAL:0)
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf (terraform)
===========================================================================================================================================
Tests:7 (SUCCESSES:3, FAILURES:2, EXCEPTIONS:2)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...202 [ cidr_blocks =lookup(egress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...190 [ cidr_blocks =lookup(ingress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
loadbalancer.tf (terraform)
===========================
Tests:6 (SUCCESSES:3, FAILURES:3, EXCEPTIONS:0)
Failures:3 (HIGH:0, CRITICAL:3)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152vialoadbalancer.tf:147-153 (egress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...152 [ cidr_blocks = ["0.0.0.0/0"]
...154 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174vialoadbalancer.tf:169-175 (egress)
vialoadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156resource"aws_security_group""ifs_target_sc" {
...174 [ cidr_blocks = ["0.0.0.0/0"]
...176 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
loadbalancer.tf:144vialoadbalancer.tf:139-145 (ingress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...144 [ cidr_blocks = ["188.214.15.75/32", "192.168.5.101/32", "81.134.202.29/32", "79.152.189.104/32", "179.50.12.212/32", "188.172.252.34/32", "194.33.192.0/25", "194.33.193.0/25", "194.33.196.0/25", "194.33.197.0/25", "195.59.75.0/24", "201.33.21.5/32", "213.121.161.112/28", "52.67.148.55/32", "54.94.206.111/32", "178.248.34.42/32", "178.248.34.43/32", "178.248.34.44/32", "178.248.34.45/32", "178.248.34.46/32", "178.248.34.47/32", "89.32.121.144/32", "185.191.249.100/32", "2.138.20.8/32", "18.169.147.172/32", "35.176.93.186/32", "18.130.148.126/32", "35.176.148.126/32", "51.149.250.0/24", "51.149.249.0/29", "194.33.249.0/29", "51.149.249.32/29", "194.33.248.0/29", "20.49.214.199/32", "20.49.214.228/32", "20.26.11.71/32", "20.26.11.108/32", "128.77.75.128/26"]
...154 }
────────────────────────────────────────
monitoring.tf (terraform)
=========================
Tests:2 (SUCCESSES:1, FAILURES:1, EXCEPTIONS:0)
Failures:1 (HIGH:1, CRITICAL:0)
HIGH:Topicdoesnothaveencryptionenabled.
════════════════════════════════════════
Topicsshouldbeencryptedtoprotecttheircontents.Seehttps://avd.aquasec.com/misconfig/avd-aws-0095
────────────────────────────────────────
monitoring.tf:5-7
────────────────────────────────────────
5 ┌ resource"aws_sns_topic""lb_5xx_alarm_topic" {
6 │ name ="lb_5xx_alarm_topic"7 └ }
────────────────────────────────────────
trivy_exitcode=1
Trivy will check the following folders:
terraform/environments/cdpt-ifs terraform/environments/observability-platform
Running Trivy in terraform/environments/cdpt-ifs
2024-07-09T14:21:08Z INFO Need to update DB
2024-07-09T14:21:08Z INFO Downloading DB... repository="ghcr.io/aquasecurity/trivy-db:2"
2024-07-09T14:21:10Z INFO Vulnerability scanning is enabled
2024-07-09T14:21:10Z INFO Misconfiguration scanning is enabled
2024-07-09T14:21:10Z INFO Need to update the built-in policies
2024-07-09T14:21:10Z INFO Downloading the built-in policies...
74.86 KiB / 74.86 KiB [-----------------------------------------------------------] 100.00% ? p/s 0s2024-07-09T14:21:11Z INFO Secret scanning is enabled
2024-07-09T14:21:11Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-09T14:21:11Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection
2024-07-09T14:21:13Z INFO Number of language-specific files num=0
2024-07-09T14:21:13Z INFO Detected config files num=10
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33 resource "aws_security_group" "db" {
..
47 [ cidr_blocks = ["0.0.0.0/0"]
..
49 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349
via ecs.tf:344-350 (egress)
via ecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323 resource "aws_security_group" "cluster_ec2" {
...
349 [ cidr_blocks = ["0.0.0.0/0"]
...
358 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489
via ecs.tf:485-490 (egress)
via ecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473 resource "aws_security_group" "ecs_service" {
...
489 [ cidr_blocks = ["0.0.0.0/0"]
...
491 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
202 [ cidr_blocks = lookup(egress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
190 [ cidr_blocks = lookup(ingress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152
via loadbalancer.tf:147-153 (egress)
via loadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134 resource "aws_security_group" "ifs_lb_sc" {
...
152 [ cidr_blocks = ["0.0.0.0/0"]
...
154 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174
via loadbalancer.tf:169-175 (egress)
via loadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156 resource "aws_security_group" "ifs_target_sc" {
...
174 [ cidr_blocks = ["0.0.0.0/0"]
...
176 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
HIGH: Topic does not have encryption enabled.
════════════════════════════════════════
Topics should be encrypted to protect their contents.
See https://avd.aquasec.com/misconfig/avd-aws-0095
────────────────────────────────────────
monitoring.tf:5-7
────────────────────────────────────────
5 ┌ resource "aws_sns_topic" "lb_5xx_alarm_topic" {
6 │ name = "lb_5xx_alarm_topic"
7 └ }
────────────────────────────────────────
trivy_exitcode=1
Running Trivy in terraform/environments/observability-platform
2024-07-09T14:21:13Z INFO Vulnerability scanning is enabled
2024-07-09T14:21:13Z INFO Misconfiguration scanning is enabled
2024-07-09T14:21:13Z INFO Secret scanning is enabled
2024-07-09T14:21:13Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-09T14:21:13Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection
2024-07-09T14:21:15Z INFO Number of language-specific files num=0
2024-07-09T14:21:15Z INFO Detected config files num=5
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
terraform/environments/cdpt-ifs terraform/environments/observability-platform
*****************************
Running tflint in terraform/environments/cdpt-ifs
Excluding the following checks: terraform_unused_declarations
7issue(s) found:
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 121:121:value="${aws_db_instance.database.address}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 125:125:value="${aws_db_instance.database.username}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 129:129:value="${local.application_data.accounts[local.environment].db_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 133:133:value="${local.application_data.accounts[local.environment].client_id}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 137:137:value="${local.application_data.accounts[local.environment].env_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 406:406:Name="${local.application_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Missing version constraint for provider "random" in `required_providers` (terraform_required_providers)
on terraform/environments/cdpt-ifs/loadbalancer.tf line 97:97:resource"random_string""ifs_target_group_name" {
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_required_providers.mdtflint_exitcode=2*****************************
Running tflint in terraform/environments/observability-platform
Excluding the following checks: terraform_unused_declarations
tflint_exitcode=2
Trivy Scan Failed
Show Output
*****************************
Trivy will check the following folders:
terraform/environments/cdpt-ifs terraform/environments/observability-platform
*****************************
Running Trivy in terraform/environments/cdpt-ifs
2024-07-09T14:21:08Z INFO Need to update DB
2024-07-09T14:21:08Z INFO Downloading DB...repository="ghcr.io/aquasecurity/trivy-db:2"2024-07-09T14:21:10Z INFO Vulnerability scanning is enabled
2024-07-09T14:21:10Z INFO Misconfiguration scanning is enabled
2024-07-09T14:21:10Z INFO Need to update the built-in policies
2024-07-09T14:21:10Z INFO Downloading the built-in policies...74.86 KiB /74.86 KiB [-----------------------------------------------------------] 100.00%? p/s 0s2024-07-09T14:21:11Z INFO Secret scanning is enabled
2024-07-09T14:21:11Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-09T14:21:11Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection2024-07-09T14:21:13Z INFO Number of language-specific files num=02024-07-09T14:21:13Z INFO Detected config files num=10
database.tf (terraform)
=======================
Tests:3 (SUCCESSES:1, FAILURES:2, EXCEPTIONS:0)
Failures:2 (HIGH:1, CRITICAL:1)
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
See https://avd.aquasec.com/misconfig/avd-aws-0080
────────────────────────────────────────
database.tf:5-20
────────────────────────────────────────
5 ┌ resource"aws_db_instance""database" {
6 │ allocated_storage=local.application_data.accounts[local.environment].db_allocated_storage7 │ storage_type="gp2"8 │ engine="sqlserver-web"9 │ engine_version="14.00.3381.3.v1"10 │ instance_class=local.application_data.accounts[local.environment].db_instance_class11 │ identifier=local.application_data.accounts[local.environment].db_instance_identifier12 │ username=local.application_data.accounts[local.environment].db_user13 └ password=aws_secretsmanager_secret_version.dbase_password.secret_string..
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33resource"aws_security_group""db" {
..47 [ cidr_blocks = ["0.0.0.0/0"]
..49 }
────────────────────────────────────────
ecs.tf (terraform)
==================Tests:75 (SUCCESSES:5, FAILURES:2, EXCEPTIONS:68)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349viaecs.tf:344-350 (egress)
viaecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323resource"aws_security_group""cluster_ec2" {
...349 [ cidr_blocks = ["0.0.0.0/0"]
...358 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489viaecs.tf:485-490 (egress)
viaecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473resource"aws_security_group""ecs_service" {
...489 [ cidr_blocks = ["0.0.0.0/0"]
...491 }
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-bastion-linux?ref=v4.2.1/main.tf (terraform)
==========================================================================================================Tests:16 (SUCCESSES:5, FAILURES:0, EXCEPTIONS:11)
Failures:0 (HIGH:0, CRITICAL:0)
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf (terraform)
===========================================================================================================================================
Tests:7 (SUCCESSES:3, FAILURES:2, EXCEPTIONS:2)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...202 [ cidr_blocks =lookup(egress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...190 [ cidr_blocks =lookup(ingress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
loadbalancer.tf (terraform)
===========================
Tests:6 (SUCCESSES:3, FAILURES:3, EXCEPTIONS:0)
Failures:3 (HIGH:0, CRITICAL:3)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152vialoadbalancer.tf:147-153 (egress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...152 [ cidr_blocks = ["0.0.0.0/0"]
...154 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174vialoadbalancer.tf:169-175 (egress)
vialoadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156resource"aws_security_group""ifs_target_sc" {
...174 [ cidr_blocks = ["0.0.0.0/0"]
...176 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
loadbalancer.tf:144vialoadbalancer.tf:139-145 (ingress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...144 [ cidr_blocks = ["188.214.15.75/32", "192.168.5.101/32", "81.134.202.29/32", "79.152.189.104/32", "179.50.12.212/32", "188.172.252.34/32", "194.33.192.0/25", "194.33.193.0/25", "194.33.196.0/25", "194.33.197.0/25", "195.59.75.0/24", "201.33.21.5/32", "213.121.161.112/28", "52.67.148.55/32", "54.94.206.111/32", "178.248.34.42/32", "178.248.34.43/32", "178.248.34.44/32", "178.248.34.45/32", "178.248.34.46/32", "178.248.34.47/32", "89.32.121.144/32", "185.191.249.100/32", "2.138.20.8/32", "18.169.147.172/32", "35.176.93.186/32", "18.130.148.126/32", "35.176.148.126/32", "51.149.250.0/24", "51.149.249.0/29", "194.33.249.0/29", "51.149.249.32/29", "194.33.248.0/29", "20.49.214.199/32", "20.49.214.228/32", "20.26.11.71/32", "20.26.11.108/32", "128.77.75.128/26"]
...154 }
────────────────────────────────────────
monitoring.tf (terraform)
=========================
Tests:2 (SUCCESSES:1, FAILURES:1, EXCEPTIONS:0)
Failures:1 (HIGH:1, CRITICAL:0)
HIGH:Topicdoesnothaveencryptionenabled.
════════════════════════════════════════
Topicsshouldbeencryptedtoprotecttheircontents.Seehttps://avd.aquasec.com/misconfig/avd-aws-0095
────────────────────────────────────────
monitoring.tf:5-7
────────────────────────────────────────
5 ┌ resource"aws_sns_topic""lb_5xx_alarm_topic" {
6 │ name ="lb_5xx_alarm_topic"7 └ }
────────────────────────────────────────
trivy_exitcode=1*****************************RunningTrivyinterraform/environments/observability-platform2024-07-09T14:21:13Z INFOVulnerabilityscanningisenabled2024-07-09T14:21:13Z INFOMisconfigurationscanningisenabled2024-07-09T14:21:13Z INFOSecretscanningisenabled2024-07-09T14:21:13Z INFOIfyourscanningisslow, pleasetry '--scannersvuln' todisablesecretscanning2024-07-09T14:21:13Z INFOPleaseseealsohttps://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection2024-07-09T14:21:15Z INFONumberoflanguage-specificfilesnum=02024-07-09T14:21:15Z INFODetectedconfigfilesnum=5git::https:/github.com/terraform-aws-modules/terraform-aws-lambda?ref=b88a85627c84a4e9d1ad2a655455d10b386bc63f/iam.tf (terraform)
=================================================================================================================================
Tests:13 (SUCCESSES:0, FAILURES:0, EXCEPTIONS:13)
Failures:0 (HIGH:0, CRITICAL:0)
git::https:/github.com/terraform-aws-modules/terraform-aws-managed-service-grafana?ref=14dc9a17539887d8c92456b6d4464f379d8c7bd1/main.tf (terraform)
===================================================================================================================================================
Tests:29 (SUCCESSES:0, FAILURES:0, EXCEPTIONS:29)
Failures:0 (HIGH:0, CRITICAL:0)
trivy_exitcode=1
Trivy will check the following folders:
terraform/environments/cdpt-ifs
Running Trivy in terraform/environments/cdpt-ifs
2024-07-10T08:10:22Z INFO Need to update DB
2024-07-10T08:10:22Z INFO Downloading DB... repository="ghcr.io/aquasecurity/trivy-db:2"
2024-07-10T08:10:24Z INFO Vulnerability scanning is enabled
2024-07-10T08:10:24Z INFO Misconfiguration scanning is enabled
2024-07-10T08:10:24Z INFO Need to update the built-in policies
2024-07-10T08:10:24Z INFO Downloading the built-in policies...
74.86 KiB / 74.86 KiB [-----------------------------------------------------------] 100.00% ? p/s 0s2024-07-10T08:10:25Z INFO Secret scanning is enabled
2024-07-10T08:10:25Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-10T08:10:25Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection
2024-07-10T08:10:27Z INFO Number of language-specific files num=0
2024-07-10T08:10:27Z INFO Detected config files num=10
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33 resource "aws_security_group" "db" {
..
47 [ cidr_blocks = ["0.0.0.0/0"]
..
49 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349
via ecs.tf:344-350 (egress)
via ecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323 resource "aws_security_group" "cluster_ec2" {
...
349 [ cidr_blocks = ["0.0.0.0/0"]
...
358 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489
via ecs.tf:485-490 (egress)
via ecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473 resource "aws_security_group" "ecs_service" {
...
489 [ cidr_blocks = ["0.0.0.0/0"]
...
491 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
202 [ cidr_blocks = lookup(egress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
190 [ cidr_blocks = lookup(ingress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152
via loadbalancer.tf:147-153 (egress)
via loadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134 resource "aws_security_group" "ifs_lb_sc" {
...
152 [ cidr_blocks = ["0.0.0.0/0"]
...
154 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174
via loadbalancer.tf:169-175 (egress)
via loadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156 resource "aws_security_group" "ifs_target_sc" {
...
174 [ cidr_blocks = ["0.0.0.0/0"]
...
176 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running tflint in terraform/environments/cdpt-ifs
Excluding the following checks: terraform_unused_declarations
7issue(s) found:
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 121:121:value="${aws_db_instance.database.address}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 125:125:value="${aws_db_instance.database.username}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 129:129:value="${local.application_data.accounts[local.environment].db_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 133:133:value="${local.application_data.accounts[local.environment].client_id}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 137:137:value="${local.application_data.accounts[local.environment].env_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 406:406:Name="${local.application_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Missing version constraint for provider "random" in `required_providers` (terraform_required_providers)
on terraform/environments/cdpt-ifs/secrets.tf line 5:5:resource"random_password""password_long" {
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_required_providers.mdtflint_exitcode=2
Trivy Scan Failed
Show Output
*****************************
Trivy will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running Trivy in terraform/environments/cdpt-ifs
2024-07-10T08:10:22Z INFO Need to update DB
2024-07-10T08:10:22Z INFO Downloading DB...repository="ghcr.io/aquasecurity/trivy-db:2"2024-07-10T08:10:24Z INFO Vulnerability scanning is enabled
2024-07-10T08:10:24Z INFO Misconfiguration scanning is enabled
2024-07-10T08:10:24Z INFO Need to update the built-in policies
2024-07-10T08:10:24Z INFO Downloading the built-in policies...74.86 KiB /74.86 KiB [-----------------------------------------------------------] 100.00%? p/s 0s2024-07-10T08:10:25Z INFO Secret scanning is enabled
2024-07-10T08:10:25Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-10T08:10:25Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection2024-07-10T08:10:27Z INFO Number of language-specific files num=02024-07-10T08:10:27Z INFO Detected config files num=10
database.tf (terraform)
=======================
Tests:3 (SUCCESSES:1, FAILURES:2, EXCEPTIONS:0)
Failures:2 (HIGH:1, CRITICAL:1)
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
See https://avd.aquasec.com/misconfig/avd-aws-0080
────────────────────────────────────────
database.tf:5-20
────────────────────────────────────────
5 ┌ resource"aws_db_instance""database" {
6 │ allocated_storage=local.application_data.accounts[local.environment].db_allocated_storage7 │ storage_type="gp2"8 │ engine="sqlserver-web"9 │ engine_version="14.00.3381.3.v1"10 │ instance_class=local.application_data.accounts[local.environment].db_instance_class11 │ identifier=local.application_data.accounts[local.environment].db_instance_identifier12 │ username=local.application_data.accounts[local.environment].db_user13 └ password=aws_secretsmanager_secret_version.dbase_password.secret_string..
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33resource"aws_security_group""db" {
..47 [ cidr_blocks = ["0.0.0.0/0"]
..49 }
────────────────────────────────────────
ecs.tf (terraform)
==================Tests:75 (SUCCESSES:5, FAILURES:2, EXCEPTIONS:68)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349viaecs.tf:344-350 (egress)
viaecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323resource"aws_security_group""cluster_ec2" {
...349 [ cidr_blocks = ["0.0.0.0/0"]
...358 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489viaecs.tf:485-490 (egress)
viaecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473resource"aws_security_group""ecs_service" {
...489 [ cidr_blocks = ["0.0.0.0/0"]
...491 }
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-bastion-linux?ref=v4.2.1/main.tf (terraform)
==========================================================================================================Tests:16 (SUCCESSES:5, FAILURES:0, EXCEPTIONS:11)
Failures:0 (HIGH:0, CRITICAL:0)
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf (terraform)
===========================================================================================================================================
Tests:7 (SUCCESSES:3, FAILURES:2, EXCEPTIONS:2)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...202 [ cidr_blocks =lookup(egress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...190 [ cidr_blocks =lookup(ingress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
loadbalancer.tf (terraform)
===========================
Tests:6 (SUCCESSES:3, FAILURES:3, EXCEPTIONS:0)
Failures:3 (HIGH:0, CRITICAL:3)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152vialoadbalancer.tf:147-153 (egress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...152 [ cidr_blocks = ["0.0.0.0/0"]
...154 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174vialoadbalancer.tf:169-175 (egress)
vialoadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156resource"aws_security_group""ifs_target_sc" {
...174 [ cidr_blocks = ["0.0.0.0/0"]
...176 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
loadbalancer.tf:144vialoadbalancer.tf:139-145 (ingress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...144 [ cidr_blocks = ["188.214.15.75/32", "192.168.5.101/32", "81.134.202.29/32", "79.152.189.104/32", "179.50.12.212/32", "188.172.252.34/32", "194.33.192.0/25", "194.33.193.0/25", "194.33.196.0/25", "194.33.197.0/25", "195.59.75.0/24", "201.33.21.5/32", "213.121.161.112/28", "52.67.148.55/32", "54.94.206.111/32", "178.248.34.42/32", "178.248.34.43/32", "178.248.34.44/32", "178.248.34.45/32", "178.248.34.46/32", "178.248.34.47/32", "89.32.121.144/32", "185.191.249.100/32", "2.138.20.8/32", "18.169.147.172/32", "35.176.93.186/32", "18.130.148.126/32", "35.176.148.126/32", "51.149.250.0/24", "51.149.249.0/29", "194.33.249.0/29", "51.149.249.32/29", "194.33.248.0/29", "20.49.214.199/32", "20.49.214.228/32", "20.26.11.71/32", "20.26.11.108/32", "128.77.75.128/26"]
...154 }
────────────────────────────────────────
monitoring.tf (terraform)
=========================
Tests:2 (SUCCESSES:1, FAILURES:1, EXCEPTIONS:0)
Failures:1 (HIGH:1, CRITICAL:0)
HIGH:Topicdoesnothaveencryptionenabled.
════════════════════════════════════════
Topicsshouldbeencryptedtoprotecttheircontents.Seehttps://avd.aquasec.com/misconfig/avd-aws-0095
────────────────────────────────────────
monitoring.tf:5-7
────────────────────────────────────────
5 ┌ resource"aws_sns_topic""lb_5xx_alarm_topic" {
6 │ name ="lb_5xx_alarm_topic"7 └ }
────────────────────────────────────────
trivy_exitcode=1
Trivy will check the following folders:
terraform/environments/cdpt-ifs
Running Trivy in terraform/environments/cdpt-ifs
2024-07-10T08:13:44Z INFO Need to update DB
2024-07-10T08:13:44Z INFO Downloading DB... repository="ghcr.io/aquasecurity/trivy-db:2"
2024-07-10T08:13:47Z INFO Vulnerability scanning is enabled
2024-07-10T08:13:47Z INFO Misconfiguration scanning is enabled
2024-07-10T08:13:47Z INFO Need to update the built-in policies
2024-07-10T08:13:47Z INFO Downloading the built-in policies...
74.86 KiB / 74.86 KiB [-----------------------------------------------------------] 100.00% ? p/s 0s2024-07-10T08:13:47Z INFO Secret scanning is enabled
2024-07-10T08:13:47Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-10T08:13:47Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection
2024-07-10T08:13:52Z INFO Number of language-specific files num=0
2024-07-10T08:13:52Z INFO Detected config files num=10
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33 resource "aws_security_group" "db" {
..
47 [ cidr_blocks = ["0.0.0.0/0"]
..
49 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349
via ecs.tf:344-350 (egress)
via ecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323 resource "aws_security_group" "cluster_ec2" {
...
349 [ cidr_blocks = ["0.0.0.0/0"]
...
358 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489
via ecs.tf:485-490 (egress)
via ecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473 resource "aws_security_group" "ecs_service" {
...
489 [ cidr_blocks = ["0.0.0.0/0"]
...
491 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
202 [ cidr_blocks = lookup(egress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
190 [ cidr_blocks = lookup(ingress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152
via loadbalancer.tf:147-153 (egress)
via loadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134 resource "aws_security_group" "ifs_lb_sc" {
...
152 [ cidr_blocks = ["0.0.0.0/0"]
...
154 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174
via loadbalancer.tf:169-175 (egress)
via loadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156 resource "aws_security_group" "ifs_target_sc" {
...
174 [ cidr_blocks = ["0.0.0.0/0"]
...
176 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running tflint in terraform/environments/cdpt-ifs
Excluding the following checks: terraform_unused_declarations
7issue(s) found:
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 121:121:value="${aws_db_instance.database.address}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 125:125:value="${aws_db_instance.database.username}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 129:129:value="${local.application_data.accounts[local.environment].db_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 133:133:value="${local.application_data.accounts[local.environment].client_id}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 137:137:value="${local.application_data.accounts[local.environment].env_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 406:406:Name="${local.application_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Missing version constraint for provider "random" in `required_providers` (terraform_required_providers)
on terraform/environments/cdpt-ifs/loadbalancer.tf line 97:97:resource"random_string""ifs_target_group_name" {
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_required_providers.mdtflint_exitcode=2
Trivy Scan Failed
Show Output
*****************************
Trivy will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running Trivy in terraform/environments/cdpt-ifs
2024-07-10T08:13:44Z INFO Need to update DB
2024-07-10T08:13:44Z INFO Downloading DB...repository="ghcr.io/aquasecurity/trivy-db:2"2024-07-10T08:13:47Z INFO Vulnerability scanning is enabled
2024-07-10T08:13:47Z INFO Misconfiguration scanning is enabled
2024-07-10T08:13:47Z INFO Need to update the built-in policies
2024-07-10T08:13:47Z INFO Downloading the built-in policies...74.86 KiB /74.86 KiB [-----------------------------------------------------------] 100.00%? p/s 0s2024-07-10T08:13:47Z INFO Secret scanning is enabled
2024-07-10T08:13:47Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-10T08:13:47Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection2024-07-10T08:13:52Z INFO Number of language-specific files num=02024-07-10T08:13:52Z INFO Detected config files num=10
database.tf (terraform)
=======================
Tests:3 (SUCCESSES:1, FAILURES:2, EXCEPTIONS:0)
Failures:2 (HIGH:1, CRITICAL:1)
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
See https://avd.aquasec.com/misconfig/avd-aws-0080
────────────────────────────────────────
database.tf:5-20
────────────────────────────────────────
5 ┌ resource"aws_db_instance""database" {
6 │ allocated_storage=local.application_data.accounts[local.environment].db_allocated_storage7 │ storage_type="gp2"8 │ engine="sqlserver-web"9 │ engine_version="14.00.3381.3.v1"10 │ instance_class=local.application_data.accounts[local.environment].db_instance_class11 │ identifier=local.application_data.accounts[local.environment].db_instance_identifier12 │ username=local.application_data.accounts[local.environment].db_user13 └ password=aws_secretsmanager_secret_version.dbase_password.secret_string..
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33resource"aws_security_group""db" {
..47 [ cidr_blocks = ["0.0.0.0/0"]
..49 }
────────────────────────────────────────
ecs.tf (terraform)
==================Tests:75 (SUCCESSES:5, FAILURES:2, EXCEPTIONS:68)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349viaecs.tf:344-350 (egress)
viaecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323resource"aws_security_group""cluster_ec2" {
...349 [ cidr_blocks = ["0.0.0.0/0"]
...358 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489viaecs.tf:485-490 (egress)
viaecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473resource"aws_security_group""ecs_service" {
...489 [ cidr_blocks = ["0.0.0.0/0"]
...491 }
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-bastion-linux?ref=v4.2.1/main.tf (terraform)
==========================================================================================================Tests:16 (SUCCESSES:5, FAILURES:0, EXCEPTIONS:11)
Failures:0 (HIGH:0, CRITICAL:0)
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf (terraform)
===========================================================================================================================================
Tests:7 (SUCCESSES:3, FAILURES:2, EXCEPTIONS:2)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...202 [ cidr_blocks =lookup(egress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...190 [ cidr_blocks =lookup(ingress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
loadbalancer.tf (terraform)
===========================
Tests:6 (SUCCESSES:3, FAILURES:3, EXCEPTIONS:0)
Failures:3 (HIGH:0, CRITICAL:3)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152vialoadbalancer.tf:147-153 (egress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...152 [ cidr_blocks = ["0.0.0.0/0"]
...154 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174vialoadbalancer.tf:169-175 (egress)
vialoadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156resource"aws_security_group""ifs_target_sc" {
...174 [ cidr_blocks = ["0.0.0.0/0"]
...176 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
loadbalancer.tf:144vialoadbalancer.tf:139-145 (ingress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...144 [ cidr_blocks = ["188.214.15.75/32", "192.168.5.101/32", "81.134.202.29/32", "79.152.189.104/32", "179.50.12.212/32", "188.172.252.34/32", "194.33.192.0/25", "194.33.193.0/25", "194.33.196.0/25", "194.33.197.0/25", "195.59.75.0/24", "201.33.21.5/32", "213.121.161.112/28", "52.67.148.55/32", "54.94.206.111/32", "178.248.34.42/32", "178.248.34.43/32", "178.248.34.44/32", "178.248.34.45/32", "178.248.34.46/32", "178.248.34.47/32", "89.32.121.144/32", "185.191.249.100/32", "2.138.20.8/32", "18.169.147.172/32", "35.176.93.186/32", "18.130.148.126/32", "35.176.148.126/32", "51.149.250.0/24", "51.149.249.0/29", "194.33.249.0/29", "51.149.249.32/29", "194.33.248.0/29", "20.49.214.199/32", "20.49.214.228/32", "20.26.11.71/32", "20.26.11.108/32", "128.77.75.128/26"]
...154 }
────────────────────────────────────────
monitoring.tf (terraform)
=========================
Tests:2 (SUCCESSES:1, FAILURES:1, EXCEPTIONS:0)
Failures:1 (HIGH:1, CRITICAL:0)
HIGH:Topicdoesnothaveencryptionenabled.
════════════════════════════════════════
Topicsshouldbeencryptedtoprotecttheircontents.Seehttps://avd.aquasec.com/misconfig/avd-aws-0095
────────────────────────────────────────
monitoring.tf:5-7
────────────────────────────────────────
5 ┌ resource"aws_sns_topic""lb_5xx_alarm_topic" {
6 │ name ="lb_5xx_alarm_topic"7 └ }
────────────────────────────────────────
trivy_exitcode=1
Trivy will check the following folders:
terraform/environments/cdpt-ifs
Running Trivy in terraform/environments/cdpt-ifs
2024-07-10T08:44:41Z INFO Need to update DB
2024-07-10T08:44:41Z INFO Downloading DB... repository="ghcr.io/aquasecurity/trivy-db:2"
2024-07-10T08:44:43Z INFO Vulnerability scanning is enabled
2024-07-10T08:44:43Z INFO Misconfiguration scanning is enabled
2024-07-10T08:44:43Z INFO Need to update the built-in policies
2024-07-10T08:44:43Z INFO Downloading the built-in policies...
74.86 KiB / 74.86 KiB [-----------------------------------------------------------] 100.00% ? p/s 0s2024-07-10T08:44:43Z INFO Secret scanning is enabled
2024-07-10T08:44:43Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-10T08:44:43Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection
2024-07-10T08:44:45Z INFO Number of language-specific files num=0
2024-07-10T08:44:45Z INFO Detected config files num=10
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33 resource "aws_security_group" "db" {
..
47 [ cidr_blocks = ["0.0.0.0/0"]
..
49 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349
via ecs.tf:344-350 (egress)
via ecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323 resource "aws_security_group" "cluster_ec2" {
...
349 [ cidr_blocks = ["0.0.0.0/0"]
...
358 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489
via ecs.tf:485-490 (egress)
via ecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473 resource "aws_security_group" "ecs_service" {
...
489 [ cidr_blocks = ["0.0.0.0/0"]
...
491 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
202 [ cidr_blocks = lookup(egress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
190 [ cidr_blocks = lookup(ingress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152
via loadbalancer.tf:147-153 (egress)
via loadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134 resource "aws_security_group" "ifs_lb_sc" {
...
152 [ cidr_blocks = ["0.0.0.0/0"]
...
154 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174
via loadbalancer.tf:169-175 (egress)
via loadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156 resource "aws_security_group" "ifs_target_sc" {
...
174 [ cidr_blocks = ["0.0.0.0/0"]
...
176 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running tflint in terraform/environments/cdpt-ifs
Excluding the following checks: terraform_unused_declarations
7issue(s) found:
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 121:121:value="${aws_db_instance.database.address}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 125:125:value="${aws_db_instance.database.username}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 129:129:value="${local.application_data.accounts[local.environment].db_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 133:133:value="${local.application_data.accounts[local.environment].client_id}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 137:137:value="${local.application_data.accounts[local.environment].env_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 406:406:Name="${local.application_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Missing version constraint for provider "random" in `required_providers` (terraform_required_providers)
on terraform/environments/cdpt-ifs/secrets.tf line 5:5:resource"random_password""password_long" {
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_required_providers.mdtflint_exitcode=2
Trivy Scan Failed
Show Output
*****************************
Trivy will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running Trivy in terraform/environments/cdpt-ifs
2024-07-10T08:44:41Z INFO Need to update DB
2024-07-10T08:44:41Z INFO Downloading DB...repository="ghcr.io/aquasecurity/trivy-db:2"2024-07-10T08:44:43Z INFO Vulnerability scanning is enabled
2024-07-10T08:44:43Z INFO Misconfiguration scanning is enabled
2024-07-10T08:44:43Z INFO Need to update the built-in policies
2024-07-10T08:44:43Z INFO Downloading the built-in policies...74.86 KiB /74.86 KiB [-----------------------------------------------------------] 100.00%? p/s 0s2024-07-10T08:44:43Z INFO Secret scanning is enabled
2024-07-10T08:44:43Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-10T08:44:43Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection2024-07-10T08:44:45Z INFO Number of language-specific files num=02024-07-10T08:44:45Z INFO Detected config files num=10
database.tf (terraform)
=======================
Tests:3 (SUCCESSES:1, FAILURES:2, EXCEPTIONS:0)
Failures:2 (HIGH:1, CRITICAL:1)
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
See https://avd.aquasec.com/misconfig/avd-aws-0080
────────────────────────────────────────
database.tf:5-20
────────────────────────────────────────
5 ┌ resource"aws_db_instance""database" {
6 │ allocated_storage=local.application_data.accounts[local.environment].db_allocated_storage7 │ storage_type="gp2"8 │ engine="sqlserver-web"9 │ engine_version="14.00.3381.3.v1"10 │ instance_class=local.application_data.accounts[local.environment].db_instance_class11 │ identifier=local.application_data.accounts[local.environment].db_instance_identifier12 │ username=local.application_data.accounts[local.environment].db_user13 └ password=aws_secretsmanager_secret_version.dbase_password.secret_string..
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33resource"aws_security_group""db" {
..47 [ cidr_blocks = ["0.0.0.0/0"]
..49 }
────────────────────────────────────────
ecs.tf (terraform)
==================Tests:75 (SUCCESSES:5, FAILURES:2, EXCEPTIONS:68)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349viaecs.tf:344-350 (egress)
viaecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323resource"aws_security_group""cluster_ec2" {
...349 [ cidr_blocks = ["0.0.0.0/0"]
...358 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489viaecs.tf:485-490 (egress)
viaecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473resource"aws_security_group""ecs_service" {
...489 [ cidr_blocks = ["0.0.0.0/0"]
...491 }
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-bastion-linux?ref=v4.2.1/main.tf (terraform)
==========================================================================================================Tests:16 (SUCCESSES:5, FAILURES:0, EXCEPTIONS:11)
Failures:0 (HIGH:0, CRITICAL:0)
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf (terraform)
===========================================================================================================================================
Tests:7 (SUCCESSES:3, FAILURES:2, EXCEPTIONS:2)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...202 [ cidr_blocks =lookup(egress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...190 [ cidr_blocks =lookup(ingress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
loadbalancer.tf (terraform)
===========================
Tests:6 (SUCCESSES:3, FAILURES:3, EXCEPTIONS:0)
Failures:3 (HIGH:0, CRITICAL:3)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152vialoadbalancer.tf:147-153 (egress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...152 [ cidr_blocks = ["0.0.0.0/0"]
...154 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174vialoadbalancer.tf:169-175 (egress)
vialoadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156resource"aws_security_group""ifs_target_sc" {
...174 [ cidr_blocks = ["0.0.0.0/0"]
...176 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
loadbalancer.tf:144vialoadbalancer.tf:139-145 (ingress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...144 [ cidr_blocks = ["188.214.15.75/32", "192.168.5.101/32", "81.134.202.29/32", "79.152.189.104/32", "179.50.12.212/32", "188.172.252.34/32", "194.33.192.0/25", "194.33.193.0/25", "194.33.196.0/25", "194.33.197.0/25", "195.59.75.0/24", "201.33.21.5/32", "213.121.161.112/28", "52.67.148.55/32", "54.94.206.111/32", "178.248.34.42/32", "178.248.34.43/32", "178.248.34.44/32", "178.248.34.45/32", "178.248.34.46/32", "178.248.34.47/32", "89.32.121.144/32", "185.191.249.100/32", "2.138.20.8/32", "18.169.147.172/32", "35.176.93.186/32", "18.130.148.126/32", "35.176.148.126/32", "51.149.250.0/24", "51.149.249.0/29", "194.33.249.0/29", "51.149.249.32/29", "194.33.248.0/29", "20.49.214.199/32", "20.49.214.228/32", "20.26.11.71/32", "20.26.11.108/32", "128.77.75.128/26"]
...154 }
────────────────────────────────────────
monitoring.tf (terraform)
=========================
Tests:2 (SUCCESSES:1, FAILURES:1, EXCEPTIONS:0)
Failures:1 (HIGH:1, CRITICAL:0)
HIGH:Topicdoesnothaveencryptionenabled.
════════════════════════════════════════
Topicsshouldbeencryptedtoprotecttheircontents.Seehttps://avd.aquasec.com/misconfig/avd-aws-0095
────────────────────────────────────────
monitoring.tf:5-7
────────────────────────────────────────
5 ┌ resource"aws_sns_topic""lb_5xx_alarm_topic" {
6 │ name ="lb_5xx_alarm_topic"7 └ }
────────────────────────────────────────
trivy_exitcode=1
Trivy will check the following folders:
terraform/environments/cdpt-ifs
Running Trivy in terraform/environments/cdpt-ifs
2024-07-10T10:50:15Z INFO Need to update DB
2024-07-10T10:50:15Z INFO Downloading DB... repository="ghcr.io/aquasecurity/trivy-db:2"
2024-07-10T10:50:17Z INFO Vulnerability scanning is enabled
2024-07-10T10:50:17Z INFO Misconfiguration scanning is enabled
2024-07-10T10:50:17Z INFO Need to update the built-in policies
2024-07-10T10:50:17Z INFO Downloading the built-in policies...
74.86 KiB / 74.86 KiB [-----------------------------------------------------------] 100.00% ? p/s 0s2024-07-10T10:50:17Z INFO Secret scanning is enabled
2024-07-10T10:50:17Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-10T10:50:17Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection
2024-07-10T10:50:20Z INFO Number of language-specific files num=0
2024-07-10T10:50:20Z INFO Detected config files num=10
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33 resource "aws_security_group" "db" {
..
47 [ cidr_blocks = ["0.0.0.0/0"]
..
49 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349
via ecs.tf:344-350 (egress)
via ecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323 resource "aws_security_group" "cluster_ec2" {
...
349 [ cidr_blocks = ["0.0.0.0/0"]
...
358 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489
via ecs.tf:485-490 (egress)
via ecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473 resource "aws_security_group" "ecs_service" {
...
489 [ cidr_blocks = ["0.0.0.0/0"]
...
491 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
202 [ cidr_blocks = lookup(egress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
190 [ cidr_blocks = lookup(ingress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152
via loadbalancer.tf:147-153 (egress)
via loadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134 resource "aws_security_group" "ifs_lb_sc" {
...
152 [ cidr_blocks = ["0.0.0.0/0"]
...
154 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174
via loadbalancer.tf:169-175 (egress)
via loadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156 resource "aws_security_group" "ifs_target_sc" {
...
174 [ cidr_blocks = ["0.0.0.0/0"]
...
176 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running tflint in terraform/environments/cdpt-ifs
Excluding the following checks: terraform_unused_declarations
7issue(s) found:
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 121:121:value="${aws_db_instance.database.address}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 125:125:value="${aws_db_instance.database.username}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 129:129:value="${local.application_data.accounts[local.environment].db_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 133:133:value="${local.application_data.accounts[local.environment].client_id}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 137:137:value="${local.application_data.accounts[local.environment].env_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 406:406:Name="${local.application_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Missing version constraint for provider "random" in `required_providers` (terraform_required_providers)
on terraform/environments/cdpt-ifs/secrets.tf line 5:5:resource"random_password""password_long" {
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_required_providers.mdtflint_exitcode=2
Trivy Scan Failed
Show Output
*****************************
Trivy will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running Trivy in terraform/environments/cdpt-ifs
2024-07-10T10:50:15Z INFO Need to update DB
2024-07-10T10:50:15Z INFO Downloading DB...repository="ghcr.io/aquasecurity/trivy-db:2"2024-07-10T10:50:17Z INFO Vulnerability scanning is enabled
2024-07-10T10:50:17Z INFO Misconfiguration scanning is enabled
2024-07-10T10:50:17Z INFO Need to update the built-in policies
2024-07-10T10:50:17Z INFO Downloading the built-in policies...74.86 KiB /74.86 KiB [-----------------------------------------------------------] 100.00%? p/s 0s2024-07-10T10:50:17Z INFO Secret scanning is enabled
2024-07-10T10:50:17Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-10T10:50:17Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection2024-07-10T10:50:20Z INFO Number of language-specific files num=02024-07-10T10:50:20Z INFO Detected config files num=10
database.tf (terraform)
=======================
Tests:3 (SUCCESSES:1, FAILURES:2, EXCEPTIONS:0)
Failures:2 (HIGH:1, CRITICAL:1)
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
See https://avd.aquasec.com/misconfig/avd-aws-0080
────────────────────────────────────────
database.tf:5-20
────────────────────────────────────────
5 ┌ resource"aws_db_instance""database" {
6 │ allocated_storage=local.application_data.accounts[local.environment].db_allocated_storage7 │ storage_type="gp2"8 │ engine="sqlserver-web"9 │ engine_version="14.00.3381.3.v1"10 │ instance_class=local.application_data.accounts[local.environment].db_instance_class11 │ identifier=local.application_data.accounts[local.environment].db_instance_identifier12 │ username=local.application_data.accounts[local.environment].db_user13 └ password=aws_secretsmanager_secret_version.dbase_password.secret_string..
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33resource"aws_security_group""db" {
..47 [ cidr_blocks = ["0.0.0.0/0"]
..49 }
────────────────────────────────────────
ecs.tf (terraform)
==================Tests:75 (SUCCESSES:5, FAILURES:2, EXCEPTIONS:68)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349viaecs.tf:344-350 (egress)
viaecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323resource"aws_security_group""cluster_ec2" {
...349 [ cidr_blocks = ["0.0.0.0/0"]
...358 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489viaecs.tf:485-490 (egress)
viaecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473resource"aws_security_group""ecs_service" {
...489 [ cidr_blocks = ["0.0.0.0/0"]
...491 }
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-bastion-linux?ref=v4.2.1/main.tf (terraform)
==========================================================================================================Tests:16 (SUCCESSES:5, FAILURES:0, EXCEPTIONS:11)
Failures:0 (HIGH:0, CRITICAL:0)
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf (terraform)
===========================================================================================================================================
Tests:7 (SUCCESSES:3, FAILURES:2, EXCEPTIONS:2)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...202 [ cidr_blocks =lookup(egress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...190 [ cidr_blocks =lookup(ingress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
loadbalancer.tf (terraform)
===========================
Tests:6 (SUCCESSES:3, FAILURES:3, EXCEPTIONS:0)
Failures:3 (HIGH:0, CRITICAL:3)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152vialoadbalancer.tf:147-153 (egress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...152 [ cidr_blocks = ["0.0.0.0/0"]
...154 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174vialoadbalancer.tf:169-175 (egress)
vialoadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156resource"aws_security_group""ifs_target_sc" {
...174 [ cidr_blocks = ["0.0.0.0/0"]
...176 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
loadbalancer.tf:144vialoadbalancer.tf:139-145 (ingress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...144 [ cidr_blocks = ["188.214.15.75/32", "192.168.5.101/32", "81.134.202.29/32", "79.152.189.104/32", "179.50.12.212/32", "188.172.252.34/32", "194.33.192.0/25", "194.33.193.0/25", "194.33.196.0/25", "194.33.197.0/25", "195.59.75.0/24", "201.33.21.5/32", "213.121.161.112/28", "52.67.148.55/32", "54.94.206.111/32", "178.248.34.42/32", "178.248.34.43/32", "178.248.34.44/32", "178.248.34.45/32", "178.248.34.46/32", "178.248.34.47/32", "89.32.121.144/32", "185.191.249.100/32", "2.138.20.8/32", "18.169.147.172/32", "35.176.93.186/32", "18.130.148.126/32", "35.176.148.126/32", "51.149.250.0/24", "51.149.249.0/29", "194.33.249.0/29", "51.149.249.32/29", "194.33.248.0/29", "20.49.214.199/32", "20.49.214.228/32", "20.26.11.71/32", "20.26.11.108/32", "128.77.75.128/26"]
...154 }
────────────────────────────────────────
monitoring.tf (terraform)
=========================
Tests:2 (SUCCESSES:1, FAILURES:1, EXCEPTIONS:0)
Failures:1 (HIGH:1, CRITICAL:0)
HIGH:Topicdoesnothaveencryptionenabled.
════════════════════════════════════════
Topicsshouldbeencryptedtoprotecttheircontents.Seehttps://avd.aquasec.com/misconfig/avd-aws-0095
────────────────────────────────────────
monitoring.tf:5-7
────────────────────────────────────────
5 ┌ resource"aws_sns_topic""lb_5xx_alarm_topic" {
6 │ name ="lb_5xx_alarm_topic"7 └ }
────────────────────────────────────────
trivy_exitcode=1
Trivy will check the following folders:
terraform/environments/cdpt-ifs
Running Trivy in terraform/environments/cdpt-ifs
2024-07-10T12:05:01Z INFO Need to update DB
2024-07-10T12:05:01Z INFO Downloading DB... repository="ghcr.io/aquasecurity/trivy-db:2"
2024-07-10T12:05:03Z INFO Vulnerability scanning is enabled
2024-07-10T12:05:03Z INFO Misconfiguration scanning is enabled
2024-07-10T12:05:03Z INFO Need to update the built-in policies
2024-07-10T12:05:03Z INFO Downloading the built-in policies...
74.86 KiB / 74.86 KiB [-----------------------------------------------------------] 100.00% ? p/s 0s2024-07-10T12:05:03Z INFO Secret scanning is enabled
2024-07-10T12:05:03Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-10T12:05:03Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection
2024-07-10T12:05:05Z INFO Number of language-specific files num=0
2024-07-10T12:05:05Z INFO Detected config files num=10
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33 resource "aws_security_group" "db" {
..
47 [ cidr_blocks = ["0.0.0.0/0"]
..
49 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349
via ecs.tf:344-350 (egress)
via ecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323 resource "aws_security_group" "cluster_ec2" {
...
349 [ cidr_blocks = ["0.0.0.0/0"]
...
358 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489
via ecs.tf:485-490 (egress)
via ecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473 resource "aws_security_group" "ecs_service" {
...
489 [ cidr_blocks = ["0.0.0.0/0"]
...
491 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
202 [ cidr_blocks = lookup(egress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
via github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
via loadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177 resource "aws_security_group" "lb" {
...
190 [ cidr_blocks = lookup(ingress.value, "cidr_blocks", null)
...
213 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152
via loadbalancer.tf:147-153 (egress)
via loadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134 resource "aws_security_group" "ifs_lb_sc" {
...
152 [ cidr_blocks = ["0.0.0.0/0"]
...
154 }
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174
via loadbalancer.tf:169-175 (egress)
via loadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156 resource "aws_security_group" "ifs_target_sc" {
...
174 [ cidr_blocks = ["0.0.0.0/0"]
...
176 }
────────────────────────────────────────
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running tflint in terraform/environments/cdpt-ifs
Excluding the following checks: terraform_unused_declarations
7issue(s) found:
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 121:121:value="${aws_db_instance.database.address}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 125:125:value="${aws_db_instance.database.username}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 129:129:value="${local.application_data.accounts[local.environment].db_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 133:133:value="${local.application_data.accounts[local.environment].client_id}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 137:137:value="${local.application_data.accounts[local.environment].env_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: [Fixable] Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on terraform/environments/cdpt-ifs/ecs.tf line 406:406:Name="${local.application_name}"
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Missing version constraint for provider "random" in `required_providers` (terraform_required_providers)
on terraform/environments/cdpt-ifs/loadbalancer.tf line 97:97:resource"random_string""ifs_target_group_name" {
Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_required_providers.mdtflint_exitcode=2
Trivy Scan Failed
Show Output
*****************************
Trivy will check the following folders:
terraform/environments/cdpt-ifs
*****************************
Running Trivy in terraform/environments/cdpt-ifs
2024-07-10T12:05:01Z INFO Need to update DB
2024-07-10T12:05:01Z INFO Downloading DB...repository="ghcr.io/aquasecurity/trivy-db:2"2024-07-10T12:05:03Z INFO Vulnerability scanning is enabled
2024-07-10T12:05:03Z INFO Misconfiguration scanning is enabled
2024-07-10T12:05:03Z INFO Need to update the built-in policies
2024-07-10T12:05:03Z INFO Downloading the built-in policies...74.86 KiB /74.86 KiB [-----------------------------------------------------------] 100.00%? p/s 0s2024-07-10T12:05:03Z INFO Secret scanning is enabled
2024-07-10T12:05:03Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-07-10T12:05:03Z INFO Please see also https://aquasecurity.github.io/trivy/v0.53/docs/scanner/secret#recommendation for faster secret detection2024-07-10T12:05:05Z INFO Number of language-specific files num=02024-07-10T12:05:05Z INFO Detected config files num=10
database.tf (terraform)
=======================
Tests:3 (SUCCESSES:1, FAILURES:2, EXCEPTIONS:0)
Failures:2 (HIGH:1, CRITICAL:1)
HIGH: Instance does not have storage encryption enabled.
════════════════════════════════════════
Encryption should be enabled for an RDS Database instances.
When enabling encryption by setting the kms_key_id.
See https://avd.aquasec.com/misconfig/avd-aws-0080
────────────────────────────────────────
database.tf:5-20
────────────────────────────────────────
5 ┌ resource"aws_db_instance""database" {
6 │ allocated_storage=local.application_data.accounts[local.environment].db_allocated_storage7 │ storage_type="gp2"8 │ engine="sqlserver-web"9 │ engine_version="14.00.3381.3.v1"10 │ instance_class=local.application_data.accounts[local.environment].db_instance_class11 │ identifier=local.application_data.accounts[local.environment].db_instance_identifier12 │ username=local.application_data.accounts[local.environment].db_user13 └ password=aws_secretsmanager_secret_version.dbase_password.secret_string..
────────────────────────────────────────
CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
database.tf:47
via database.tf:43-48 (egress)
via database.tf:33-49 (aws_security_group.db)
────────────────────────────────────────
33resource"aws_security_group""db" {
..47 [ cidr_blocks = ["0.0.0.0/0"]
..49 }
────────────────────────────────────────
ecs.tf (terraform)
==================Tests:75 (SUCCESSES:5, FAILURES:2, EXCEPTIONS:68)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:349viaecs.tf:344-350 (egress)
viaecs.tf:323-358 (aws_security_group.cluster_ec2)
────────────────────────────────────────
323resource"aws_security_group""cluster_ec2" {
...349 [ cidr_blocks = ["0.0.0.0/0"]
...358 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
ecs.tf:489viaecs.tf:485-490 (egress)
viaecs.tf:473-491 (aws_security_group.ecs_service)
────────────────────────────────────────
473resource"aws_security_group""ecs_service" {
...489 [ cidr_blocks = ["0.0.0.0/0"]
...491 }
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-bastion-linux?ref=v4.2.1/main.tf (terraform)
==========================================================================================================Tests:16 (SUCCESSES:5, FAILURES:0, EXCEPTIONS:11)
Failures:0 (HIGH:0, CRITICAL:0)
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf (terraform)
===========================================================================================================================================
Tests:7 (SUCCESSES:3, FAILURES:2, EXCEPTIONS:2)
Failures:2 (HIGH:0, CRITICAL:2)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:202viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:197-204 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:195-205 (dynamic.egress["cluster_ec2_lb_egress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...202 [ cidr_blocks =lookup(egress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:190viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:185-192 (content)
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:183-193 (dynamic.ingress["cluster_ec2_lb_ingress"])
viagithub.com/ministryofjustice/modernisation-platform-terraform-loadbalancer?ref=6f59e1ce47df66bc63ee9720b7c58993d1ee64ee/main.tf:177-213 (aws_security_group.lb[0])
vialoadbalancer.tf:78-95 (module.lb_access_logs_enabled)
────────────────────────────────────────
177resource"aws_security_group""lb" {
...190 [ cidr_blocks =lookup(ingress.value, "cidr_blocks", null)
...213 }
────────────────────────────────────────
loadbalancer.tf (terraform)
===========================
Tests:6 (SUCCESSES:3, FAILURES:3, EXCEPTIONS:0)
Failures:3 (HIGH:0, CRITICAL:3)
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:152vialoadbalancer.tf:147-153 (egress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...152 [ cidr_blocks = ["0.0.0.0/0"]
...154 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsegresstomultiplepublicinternetaddresses.
════════════════════════════════════════
Openingupportstoconnectouttothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatareexplicitlyrequiredwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
loadbalancer.tf:174vialoadbalancer.tf:169-175 (egress)
vialoadbalancer.tf:156-176 (aws_security_group.ifs_target_sc)
────────────────────────────────────────
156resource"aws_security_group""ifs_target_sc" {
...174 [ cidr_blocks = ["0.0.0.0/0"]
...176 }
────────────────────────────────────────
CRITICAL:Securitygroupruleallowsingressfrompublicinternet.
════════════════════════════════════════
Openingupportstothepublicinternetisgenerallytobeavoided.YoushouldrestrictaccesstoIPaddressesorrangesthatexplicitlyrequireitwherepossible.Seehttps://avd.aquasec.com/misconfig/avd-aws-0107
────────────────────────────────────────
loadbalancer.tf:144vialoadbalancer.tf:139-145 (ingress)
vialoadbalancer.tf:134-154 (aws_security_group.ifs_lb_sc)
────────────────────────────────────────
134resource"aws_security_group""ifs_lb_sc" {
...144 [ cidr_blocks = ["188.214.15.75/32", "192.168.5.101/32", "81.134.202.29/32", "79.152.189.104/32", "179.50.12.212/32", "188.172.252.34/32", "194.33.192.0/25", "194.33.193.0/25", "194.33.196.0/25", "194.33.197.0/25", "195.59.75.0/24", "201.33.21.5/32", "213.121.161.112/28", "52.67.148.55/32", "54.94.206.111/32", "178.248.34.42/32", "178.248.34.43/32", "178.248.34.44/32", "178.248.34.45/32", "178.248.34.46/32", "178.248.34.47/32", "89.32.121.144/32", "185.191.249.100/32", "2.138.20.8/32", "18.169.147.172/32", "35.176.93.186/32", "18.130.148.126/32", "35.176.148.126/32", "51.149.250.0/24", "51.149.249.0/29", "194.33.249.0/29", "51.149.249.32/29", "194.33.248.0/29", "20.49.214.199/32", "20.49.214.228/32", "20.26.11.71/32", "20.26.11.108/32", "128.77.75.128/26"]
...154 }
────────────────────────────────────────
monitoring.tf (terraform)
=========================
Tests:2 (SUCCESSES:1, FAILURES:1, EXCEPTIONS:0)
Failures:1 (HIGH:1, CRITICAL:0)
HIGH:Topicdoesnothaveencryptionenabled.
════════════════════════════════════════
Topicsshouldbeencryptedtoprotecttheircontents.Seehttps://avd.aquasec.com/misconfig/avd-aws-0095
────────────────────────────────────────
monitoring.tf:5-7
────────────────────────────────────────
5 ┌ resource"aws_sns_topic""lb_5xx_alarm_topic" {
6 │ name ="lb_5xx_alarm_topic"7 └ }
────────────────────────────────────────
trivy_exitcode=1
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.