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
</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>
```hcl
*****************************
Checkov will check the following folders:
CTFLint Scan Success
Show Output
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
../components/delius_microservice/sg.tf:1-26 (module.gdpr_ui_service) 5 instances
────────────────────────────────────────────────────────────────────────────────
ID aws-ec2-no-public-egress-sgr
Impact Your port is egressing data to the internet
Resolution Set a more restrictive cidr range
Result #26 CRITICAL Security group rule allows egress to multiple public internet addresses.
────────────────────────────────────────────────────────────────────────────────
../components/ldap/sg.tf:17
via ldap.tf:1-23 (module.ldap)
────────────────────────────────────────────────────────────────────────────────
11 resource "aws_security_group_rule" "allow_all_egress" {
12 description = "Allow all outbound traffic to any IPv4 address"
13 type = "egress"
14 from_port = 0
15 to_port = 0
16 protocol = "-1"
17 [ cidr_blocks = ["0.0.0.0/0"]
18 security_group_id = aws_security_group.ldap.id
19 }
────────────────────────────────────────────────────────────────────────────────
ID aws-ec2-no-public-egress-sgr
Impact Your port is egressing data to the internet
Resolution Set a more restrictive cidr range
Result #27 HIGH IAM policy document uses sensitive action 'efs:DescribeFileSystems' on wildcarded resource ''
────────────────────────────────────────────────────────────────────────────────
../components/ldap/backup.tf:100
via ldap.tf:1-23 (module.ldap)
────────────────────────────────────────────────────────────────────────────────
97 data "aws_iam_policy_document" "efs_backup_policy" {
..
100 [ resources = [""]
...
134 }
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
Result #28 HIGH IAM policy document uses sensitive action 'backup:CreateBackupPlan' on wildcarded resource ''
────────────────────────────────────────────────────────────────────────────────
../components/ldap/backup.tf:72
via ldap.tf:1-23 (module.ldap)
────────────────────────────────────────────────────────────────────────────────
69 data "aws_iam_policy_document" "delius_core_backup_policy" {
..
72 [ resources = [""]
..
89 }
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
../components/ldap/datasync.tf:1-23 (module.ldap) 3 instances
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
Result #32 HIGH IAM policy document uses sensitive action 'backup:' on wildcarded resource ''
────────────────────────────────────────────────────────────────────────────────
../components/ldap/datasync.tf:62
via ldap.tf:1-23 (module.ldap)
────────────────────────────────────────────────────────────────────────────────
49 data "aws_iam_policy_document" "ldap_datasync_role_access" {
..
62 [ resources = ["*"]
..
88 }
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
Result #33 HIGH IAM policy document uses wildcarded action 's3:'
────────────────────────────────────────────────────────────────────────────────
../components/ldap/datasync.tf:82
via ldap.tf:1-23 (module.ldap)
────────────────────────────────────────────────────────────────────────────────
49 data "aws_iam_policy_document" "ldap_datasync_role_access" {
..
82 [ actions = ["s3:"]
..
88 }
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
Result #34 HIGH IAM policy document uses sensitive action 's3:' on wildcarded resource 'arn:aws:s3:::-ldap-data-refresh-incoming'
────────────────────────────────────────────────────────────────────────────────
../components/ldap/datasync.tf:83-86
via ldap.tf:1-23 (module.ldap)
────────────────────────────────────────────────────────────────────────────────
49 data "aws_iam_policy_document" "ldap_datasync_role_access" {
..
83 ┌ resources = [
84 │ "arn:aws:s3:::-ldap-data-refresh-incoming",
85 │ "arn:aws:s3:::-ldap-data-refresh-incoming/*",
86 └ ]
..
88 }
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
../components/oracle_db_instance/instance.tf:24-127 (module.oracle_db_primary[0])
────────────────────────────────────────────────────────────────────────────────
ID aws-ec2-enforce-http-token-imds
Impact Instance metadata service can be interacted with freely
Resolution Enable HTTP token requirement for IMDS
Result #38 HIGH IAM policy document uses sensitive action 'ssm:PutParameter' on wildcarded resource ''
────────────────────────────────────────────────────────────────────────────────
../components/oracle_db_shared/iam.tf:103
via database.tf:6-22 (module.oracle_db_shared)
────────────────────────────────────────────────────────────────────────────────
96 data "aws_iam_policy_document" "allow_access_to_ssm_parameter_store" {
97 statement {
98 sid = "AllowAccessToSsmParameterStore"
99 effect = "Allow"
100 actions = [
101 "ssm:PutParameter"
102 ]
103 [ resources = [""]
104 }
105 }
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
../components/oracle_db_shared/iam.tf:6-22 (module.oracle_db_shared) 5 instances
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
../components/oracle_db_shared/iam.tf:6-22 (module.oracle_db_shared) 4 instances
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
Result #48 HIGH IAM policy document uses wildcarded action 's3:'
────────────────────────────────────────────────────────────────────────────────
../components/oracle_db_shared/s3.tf:44-46
via database.tf:6-22 (module.oracle_db_shared)
────────────────────────────────────────────────────────────────────────────────
40 data "aws_iam_policy_document" "oracledb_backup_bucket_access" {
..
44 ┌ actions = [
45 │ "s3:"
46 └ ]
..
90 }
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
Result #49 HIGH IAM policy document uses sensitive action 's3:' on wildcarded resource '40550545-c532-4d2f-9b91-6bae53a31e87'
────────────────────────────────────────────────────────────────────────────────
../components/oracle_db_shared/s3.tf:47-50
via database.tf:6-22 (module.oracle_db_shared)
────────────────────────────────────────────────────────────────────────────────
40 data "aws_iam_policy_document" "oracledb_backup_bucket_access" {
..
47 ┌ resources = [
48 │ "${module.s3_bucket_oracledb_backups.bucket.arn}",
49 │ "${module.s3_bucket_oracledb_backups.bucket.arn}/"
50 └ ]
..
90 }
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
Results #50-51 HIGH IAM policy document uses wildcarded action 's3:Get*' (2 similar results)
────────────────────────────────────────────────────────────────────────────────
../components/oracle_db_shared/s3.tf:56-59
via database.tf:6-22 (module.oracle_db_shared)
────────────────────────────────────────────────────────────────────────────────
40 data "aws_iam_policy_document" "oracledb_backup_bucket_access" {
..
56 ┌ actions = [
57 │ "s3:Get*",
58 │ "s3:List*"
59 └ ]
..
90 }
────────────────────────────────────────────────────────────────────────────────
Individual Causes
../components/oracle_db_shared/s3.tf:6-22 (module.oracle_db_shared) 2 instances
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
Result #52 HIGH IAM policy document uses sensitive action 's3:Get*' on wildcarded resource '94a69341-8d9d-4d6f-9f1f-9b594325b534'
────────────────────────────────────────────────────────────────────────────────
../components/oracle_db_shared/s3.tf:60-63
via database.tf:6-22 (module.oracle_db_shared)
────────────────────────────────────────────────────────────────────────────────
40 data "aws_iam_policy_document" "oracledb_backup_bucket_access" {
..
60 ┌ resources = [
61 │ "${aws_s3_bucket.s3_bucket_oracledb_backups_inventory.arn}",
62 │ "${aws_s3_bucket.s3_bucket_oracledb_backups_inventory.arn}/*"
63 └ ]
..
90 }
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
Results #53-54 HIGH IAM policy document uses wildcarded action 's3:Get*' (2 similar results)
────────────────────────────────────────────────────────────────────────────────
../components/oracle_db_shared/s3.tf:69-72
via database.tf:6-22 (module.oracle_db_shared)
────────────────────────────────────────────────────────────────────────────────
40 data "aws_iam_policy_document" "oracledb_backup_bucket_access" {
..
69 ┌ actions = [
70 │ "s3:Get*",
71 │ "s3:List*"
72 └ ]
..
90 }
────────────────────────────────────────────────────────────────────────────────
Individual Causes
../components/oracle_db_shared/s3.tf:6-22 (module.oracle_db_shared) 2 instances
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
Result #55 HIGH IAM policy document uses sensitive action 's3:GetBucketLocation' on wildcarded resource 'arn:aws:s3:::'
────────────────────────────────────────────────────────────────────────────────
../components/oracle_db_shared/s3.tf:86-88
via database.tf:6-22 (module.oracle_db_shared)
────────────────────────────────────────────────────────────────────────────────
40 data "aws_iam_policy_document" "oracledb_backup_bucket_access" {
..
86 ┌ resources = [
87 │ "arn:aws:s3:::"
88 └ ]
..
90 }
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
Result #57 HIGH Bucket does not encrypt data with a customer managed key.
────────────────────────────────────────────────────────────────────────────────
../components/oracle_db_shared/s3.tf:99-110
via database.tf:6-22 (module.oracle_db_shared)
────────────────────────────────────────────────────────────────────────────────
99 ┌ resource "aws_s3_bucket" "s3_bucket_oracledb_backups_inventory" {
100 │ bucket = "${var.env_name}-oracle-database-backups-inventory"
101 │ tags = merge(
102 │ var.tags,
103 │ {
104 │ "Name" = "${var.env_name}-oracle-database-backups-inventory"
105 │ },
106 │ {
107 └ "Purpose" = "Inventory of Oracle DB Backup Pieces"
...
────────────────────────────────────────────────────────────────────────────────
ID aws-s3-encryption-customer-key
Impact Using AWS managed keys does not allow for fine grained control
Resolution Enable encryption using customer managed keys
Result #58 HIGH IAM policy document uses sensitive action 's3:PutObject' on wildcarded resource 'abc5330c-1116-4d1a-af3d-01817d31c98e/logs/'
────────────────────────────────────────────────────────────────────────────────
../components/oracle_db_shared/ssh_keys.tf:74
via database.tf:6-22 (module.oracle_db_shared)
────────────────────────────────────────────────────────────────────────────────
66 data "aws_iam_policy_document" "db_ssh_keys_s3_policy_document" {
..
74 [ resources = ["${module.s3_bucket_ssh_keys.bucket.arn}/logs/"]
...
108 }
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
Result #59 HIGH IAM policy document uses sensitive action 's3:GetObject' on wildcarded resource 'abc5330c-1116-4d1a-af3d-01817d31c98e/public-keys/'
────────────────────────────────────────────────────────────────────────────────
../components/oracle_db_shared/ssh_keys.tf:81
via database.tf:6-22 (module.oracle_db_shared)
────────────────────────────────────────────────────────────────────────────────
66 data "aws_iam_policy_document" "db_ssh_keys_s3_policy_document" {
..
81 [ resources = ["${module.s3_bucket_ssh_keys.bucket.arn}/public-keys/"]
...
108 }
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
Results #60-65 HIGH IAM policy document uses sensitive action 'ssm:GetParameters' on wildcarded resource '' (6 similar results)
────────────────────────────────────────────────────────────────────────────────
../ecs_policies/main.tf:107
via gdpr_api_service.tf:1-143 (module.gdpr_api_service)
────────────────────────────────────────────────────────────────────────────────
104 data "aws_iam_policy_document" "task_exec" {
...
107 [ resources = [""]
...
121 }
────────────────────────────────────────────────────────────────────────────────
Individual Causes
../ecs_policies/main.tf:1-143 (module.gdpr_api_service) 6 instances
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
Results #66-71 HIGH IAM policy document uses sensitive action 'elasticloadbalancing:Describe*' on wildcarded resource '' (6 similar results)
────────────────────────────────────────────────────────────────────────────────
../ecs_policies/main.tf:46
via gdpr_api_service.tf:1-143 (module.gdpr_api_service)
────────────────────────────────────────────────────────────────────────────────
43 data "aws_iam_policy_document" "service_policy" {
..
46 [ resources = [""]
..
58 }
────────────────────────────────────────────────────────────────────────────────
Individual Causes
../ecs_policies/main.tf:1-143 (module.gdpr_api_service) 6 instances
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
../ecs_policies/main.tf:1-143 (module.gdpr_api_service) 12 instances
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
github.com/ministryofjustice/modernisation-platform-terraform-s3-bucket?ref=v7.0.0/main.tf:1-23 (module.ldap)
────────────────────────────────────────────────────────────────────────────────
ID aws-s3-enable-versioning
Impact Deleted or modified data would not be recoverable
Resolution Enable versioning to protect against accidental/malicious removal or modification
Result #87 MEDIUM Bucket does not have versioning enabled
────────────────────────────────────────────────────────────────────────────────
../components/oracle_db_shared/s3.tf:116
via database.tf:6-22 (module.oracle_db_shared)
────────────────────────────────────────────────────────────────────────────────
113 resource "aws_s3_bucket_versioning" "s3_bucket_oracledb_backups_inventory" {
114 bucket = aws_s3_bucket.s3_bucket_oracledb_backups_inventory.id
115 versioning_configuration {
116 [ status = "Suspended"
117 }
118 }
────────────────────────────────────────────────────────────────────────────────
ID aws-s3-enable-versioning
Impact Deleted or modified data would not be recoverable
Resolution Enable versioning to protect against accidental/malicious removal or modification
Result #88 MEDIUM Bucket does not have logging enabled
────────────────────────────────────────────────────────────────────────────────
../components/oracle_db_shared/s3.tf:99-110
via database.tf:6-22 (module.oracle_db_shared)
────────────────────────────────────────────────────────────────────────────────
99 ┌ resource "aws_s3_bucket" "s3_bucket_oracledb_backups_inventory" {
100 │ bucket = "${var.env_name}-oracle-database-backups-inventory"
101 │ tags = merge(
102 │ var.tags,
103 │ {
104 │ "Name" = "${var.env_name}-oracle-database-backups-inventory"
105 │ },
106 │ {
107 └ "Purpose" = "Inventory of Oracle DB Backup Pieces"
...
────────────────────────────────────────────────────────────────────────────────
ID aws-s3-enable-bucket-logging
Impact There is no way to determine the access to this bucket
Resolution Add a logging block to the resource to enable access logging
../components/delius_microservice/cloudwatch.tf:1-26 (module.merge_ui_service)
────────────────────────────────────────────────────────────────────────────────
ID aws-cloudwatch-log-group-customer-key
Impact Log data may be leaked if the logs are compromised. No auditing of who have viewed the logs.
Resolution Enable CMK encryption of CloudWatch Log Groups
Result #94 LOW Log group is not encrypted.
────────────────────────────────────────────────────────────────────────────────
../components/ldap/cloudwatch.tf:1-4
via ldap.tf:1-23 (module.ldap)
────────────────────────────────────────────────────────────────────────────────
1 resource "aws_cloudwatch_log_group" "ldap_test" {
2 name = "/ecs/ldap_${var.env_name}"
3 retention_in_days = 5
4 }
────────────────────────────────────────────────────────────────────────────────
ID aws-cloudwatch-log-group-customer-key
Impact Log data may be leaked if the logs are compromised. No auditing of who have viewed the logs.
Resolution Enable CMK encryption of CloudWatch Log Groups
Result #95 LOW Security group rule does not have a description.
────────────────────────────────────────────────────────────────────────────────
../components/ldap/sg.tf:54-61
via ldap.tf:1-23 (module.ldap)
────────────────────────────────────────────────────────────────────────────────
54 resource "aws_security_group_rule" "efs_ingress_ldap" {
55 type = "ingress"
56 from_port = 2049
57 to_port = 2049
58 protocol = "tcp"
59 source_security_group_id = module.efs.sg_id
60 security_group_id = aws_security_group.ldap.id
61 }
────────────────────────────────────────────────────────────────────────────────
ID aws-ec2-add-description-to-security-group-rule
Impact Descriptions provide context for the firewall rule reasons
Resolution Add descriptions for all security groups rules
Result #1 CRITICAL Instance is exposed publicly.
────────────────────────────────────────────────────────────────────────────────
database.tf:19
────────────────────────────────────────────────────────────────────────────────
5 resource "aws_db_instance" "database" {
.
19 [ publicly_accessible = true (true)
20 }
────────────────────────────────────────────────────────────────────────────────
ID aws-rds-no-public-db-access
Impact The database instance is publicly accessible
Resolution Set the database to not be publicly accessible
Result #2 CRITICAL Security group rule allows ingress from public internet.
────────────────────────────────────────────────────────────────────────────────
database.tf:47
────────────────────────────────────────────────────────────────────────────────
39 resource "aws_security_group" "db" {
..
47 [ cidr_blocks = ["0.0.0.0/0"]
..
55 }
────────────────────────────────────────────────────────────────────────────────
ID aws-ec2-no-public-ingress-sgr
Impact Your port exposed to the internet
Resolution Set a more restrictive cidr range
Result #3 CRITICAL Security group rule allows egress to multiple public internet addresses.
────────────────────────────────────────────────────────────────────────────────
database.tf:53
────────────────────────────────────────────────────────────────────────────────
39 resource "aws_security_group" "db" {
..
53 [ cidr_blocks = ["0.0.0.0/0"]
..
55 }
────────────────────────────────────────────────────────────────────────────────
ID aws-ec2-no-public-egress-sgr
Impact Your port is egressing data to the internet
Resolution Set a more restrictive cidr range
Result #4 CRITICAL Security group rule allows ingress from public internet.
────────────────────────────────────────────────────────────────────────────────
ecs.tf:239
────────────────────────────────────────────────────────────────────────────────
229 resource "aws_security_group" "cluster_ec2" {
...
239 [ cidr_blocks = ["0.0.0.0/0"]
...
266 }
────────────────────────────────────────────────────────────────────────────────
ID aws-ec2-no-public-ingress-sgr
Impact Your port exposed to the internet
Resolution Set a more restrictive cidr range
Result #5 CRITICAL Security group rule allows egress to multiple public internet addresses.
────────────────────────────────────────────────────────────────────────────────
ecs.tf:256
────────────────────────────────────────────────────────────────────────────────
229 resource "aws_security_group" "cluster_ec2" {
...
256 [ cidr_blocks = ["0.0.0.0/0"]
...
266 }
────────────────────────────────────────────────────────────────────────────────
ID aws-ec2-no-public-egress-sgr
Impact Your port is egressing data to the internet
Resolution Set a more restrictive cidr range
Result #6 CRITICAL Security group rule allows egress to multiple public internet addresses.
────────────────────────────────────────────────────────────────────────────────
ecs.tf:473
────────────────────────────────────────────────────────────────────────────────
457 resource "aws_security_group" "ecs_service" {
...
473 [ cidr_blocks = ["0.0.0.0/0"]
...
475 }
────────────────────────────────────────────────────────────────────────────────
ID aws-ec2-no-public-egress-sgr
Impact Your port is egressing data to the internet
Resolution Set a more restrictive cidr range
Result #7 CRITICAL Security group rule allows ingress from public internet.
────────────────────────────────────────────────────────────────────────────────
loadbalancer.tf:11
────────────────────────────────────────────────────────────────────────────────
1 resource "aws_security_group" "chaps_lb_sc" {
.
11 [ cidr_blocks = ["0.0.0.0/0"]
..
21 }
────────────────────────────────────────────────────────────────────────────────
ID aws-ec2-no-public-ingress-sgr
Impact Your port exposed to the internet
Resolution Set a more restrictive cidr range
Result #8 CRITICAL Security group rule allows egress to multiple public internet addresses.
────────────────────────────────────────────────────────────────────────────────
loadbalancer.tf:19
────────────────────────────────────────────────────────────────────────────────
1 resource "aws_security_group" "chaps_lb_sc" {
.
19 [ cidr_blocks = ["0.0.0.0/0"]
..
21 }
────────────────────────────────────────────────────────────────────────────────
ID aws-ec2-no-public-egress-sgr
Impact Your port is egressing data to the internet
Resolution Set a more restrictive cidr range
Result #11 HIGH Launch template does not require IMDS access to require a token
────────────────────────────────────────────────────────────────────────────────
ecs.tf:285
────────────────────────────────────────────────────────────────────────────────
272 resource "aws_launch_template" "ec2-launch-template" {
...
285 [ http_tokens = "optional" ("optional")
...
327 }
────────────────────────────────────────────────────────────────────────────────
ID aws-ec2-enforce-launch-config-http-token-imds
Impact Instance metadata service can be interacted with freely
Resolution Enable HTTP token requirement for IMDS
Result #12 HIGH IAM policy document uses wildcarded action 'ecr:'
────────────────────────────────────────────────────────────────────────────────
ecs.tf:390-397
────────────────────────────────────────────────────────────────────────────────
381 resource "aws_iam_role_policy" "app_execution" {
...
390 ┌ "Action": [
391 │ "ecr:",
392 │ "logs:CreateLogGroup",
393 │ "logs:CreateLogStream",
394 │ "logs:PutLogEvents",
395 │ "logs:DescribeLogStreams",
396 └ "secretsmanager:GetSecretValue"
...
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
Result #13 HIGH IAM policy document uses sensitive action 'ecr:' on wildcarded resource ''
────────────────────────────────────────────────────────────────────────────────
ecs.tf:398
────────────────────────────────────────────────────────────────────────────────
381 resource "aws_iam_role_policy" "app_execution" {
...
398 [ "Resource": "*",
...
404 }
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
ecs.tf:433-455 (aws_iam_role_policy.app_task) 3 instances
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
Result #17 HIGH IAM policy document uses sensitive action 'logs:CreateLogStream' on wildcarded resource ''
────────────────────────────────────────────────────────────────────────────────
ecs.tf:450
────────────────────────────────────────────────────────────────────────────────
433 resource "aws_iam_role_policy" "app_task" {
...
450 [ "Resource": ""
...
455 }
────────────────────────────────────────────────────────────────────────────────
ID aws-iam-no-policy-wildcards
Impact Overly permissive policies may grant access to sensitive resources
Resolution Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
Result #18 HIGH Application load balancer is not set to drop invalid headers.
────────────────────────────────────────────────────────────────────────────────
loadbalancer.tf:23-28
────────────────────────────────────────────────────────────────────────────────
23 resource "aws_lb" "chaps_lb" {
24 name = "chaps-load-balancer"
25 load_balancer_type = "application"
26 security_groups = [aws_security_group.chaps_lb_sc.id]
27 subnets = data.aws_subnets.shared-public.ids
28 }
────────────────────────────────────────────────────────────────────────────────
ID aws-elb-drop-invalid-headers
Impact Invalid headers being passed through to the target of the load balance may exploit vulnerabilities
Resolution Set drop_invalid_header_fields to true
Result #19 HIGH Load balancer is exposed publicly.
────────────────────────────────────────────────────────────────────────────────
loadbalancer.tf:23-28
────────────────────────────────────────────────────────────────────────────────
23 resource "aws_lb" "chaps_lb" {
24 name = "chaps-load-balancer"
25 load_balancer_type = "application"
26 security_groups = [aws_security_group.chaps_lb_sc.id]
27 subnets = data.aws_subnets.shared-public.ids
28 }
────────────────────────────────────────────────────────────────────────────────
ID aws-elb-alb-not-public
Impact The load balancer is exposed on the internet
Resolution Switch to an internal load balancer or add a tfsec ignore
Result #20 HIGH No public access block so not blocking public acls
────────────────────────────────────────────────────────────────────────────────
s3.tf:1-3
────────────────────────────────────────────────────────────────────────────────
1 resource "aws_s3_bucket" "chaps-db-backup-bucket" {
2 bucket = local.application_data.accounts[local.environment].s3_bucket_name
3 }
────────────────────────────────────────────────────────────────────────────────
ID aws-s3-block-public-acls
Impact PUT calls with public ACLs specified can make objects public
Resolution Enable blocking any PUT calls with a public ACL specified
Result #21 HIGH No public access block so not blocking public policies
────────────────────────────────────────────────────────────────────────────────
s3.tf:1-3
────────────────────────────────────────────────────────────────────────────────
1 resource "aws_s3_bucket" "chaps-db-backup-bucket" {
2 bucket = local.application_data.accounts[local.environment].s3_bucket_name
3 }
────────────────────────────────────────────────────────────────────────────────
ID aws-s3-block-public-policy
Impact Users could put a policy that allows public access
Resolution Prevent policies that allow public access being PUT
Result #22 HIGH Bucket does not have encryption enabled
────────────────────────────────────────────────────────────────────────────────
s3.tf:1-3
────────────────────────────────────────────────────────────────────────────────
1 resource "aws_s3_bucket" "chaps-db-backup-bucket" {
2 bucket = local.application_data.accounts[local.environment].s3_bucket_name
3 }
────────────────────────────────────────────────────────────────────────────────
ID aws-s3-enable-bucket-encryption
Impact The bucket objects could be read if compromised
Resolution Configure bucket encryption
Result #23 HIGH No public access block so not ignoring public acls
────────────────────────────────────────────────────────────────────────────────
s3.tf:1-3
────────────────────────────────────────────────────────────────────────────────
1 resource "aws_s3_bucket" "chaps-db-backup-bucket" {
2 bucket = local.application_data.accounts[local.environment].s3_bucket_name
3 }
────────────────────────────────────────────────────────────────────────────────
ID aws-s3-ignore-public-acls
Impact PUT calls with public ACLs specified can make objects public
Resolution Enable ignoring the application of public ACLs in PUT calls
Result #24 HIGH No public access block so not restricting public buckets
────────────────────────────────────────────────────────────────────────────────
s3.tf:1-3
────────────────────────────────────────────────────────────────────────────────
1 resource "aws_s3_bucket" "chaps-db-backup-bucket" {
2 bucket = local.application_data.accounts[local.environment].s3_bucket_name
3 }
────────────────────────────────────────────────────────────────────────────────
ID aws-s3-no-public-buckets
Impact Public buckets can be accessed by anyone
Resolution Limit the access to public buckets to only the owner or AWS Services (eg; CloudFront)
Result #25 HIGH Bucket does not encrypt data with a customer managed key.
────────────────────────────────────────────────────────────────────────────────
s3.tf:1-3
────────────────────────────────────────────────────────────────────────────────
1 resource "aws_s3_bucket" "chaps-db-backup-bucket" {
2 bucket = local.application_data.accounts[local.environment].s3_bucket_name
3 }
────────────────────────────────────────────────────────────────────────────────
ID aws-s3-encryption-customer-key
Impact Using AWS managed keys does not allow for fine grained control
Resolution Enable encryption using customer managed keys
Result #26 MEDIUM Instance has very low backup retention period.
────────────────────────────────────────────────────────────────────────────────
database.tf:5-20
────────────────────────────────────────────────────────────────────────────────
5 ┌ resource "aws_db_instance" "database" {
6 │ allocated_storage = local.application_data.accounts[local.environment].db_allocated_storage
7 │ 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_class
11 │ identifier = local.application_data.accounts[local.environment].db_instance_identifier
12 │ username = local.application_data.accounts[local.environment].db_user
13 └ password = aws_secretsmanager_secret_version.db_password.secret_string
..
────────────────────────────────────────────────────────────────────────────────
ID aws-rds-specify-backup-retention
Impact Potential loss of data and short opportunity for recovery
Resolution Explicitly set the retention period to greater than the default
Result #28 MEDIUM Bucket does not have logging enabled
────────────────────────────────────────────────────────────────────────────────
s3.tf:1-3
────────────────────────────────────────────────────────────────────────────────
1 resource "aws_s3_bucket" "chaps-db-backup-bucket" {
2 bucket = local.application_data.accounts[local.environment].s3_bucket_name
3 }
────────────────────────────────────────────────────────────────────────────────
ID aws-s3-enable-bucket-logging
Impact There is no way to determine the access to this bucket
Resolution Add a logging block to the resource to enable access logging
Result #29 MEDIUM Bucket does not have versioning enabled
────────────────────────────────────────────────────────────────────────────────
s3.tf:1-3
────────────────────────────────────────────────────────────────────────────────
1 resource "aws_s3_bucket" "chaps-db-backup-bucket" {
2 bucket = local.application_data.accounts[local.environment].s3_bucket_name
3 }
────────────────────────────────────────────────────────────────────────────────
ID aws-s3-enable-versioning
Impact Deleted or modified data would not be recoverable
Resolution Enable versioning to protect against accidental/malicious removal or modification
Result #35 LOW Log group is not encrypted.
────────────────────────────────────────────────────────────────────────────────
ecs.tf:520-523
────────────────────────────────────────────────────────────────────────────────
520 resource "aws_cloudwatch_log_group" "cloudwatch_group" {
521 name = "${local.application_name}-ecs"
522 retention_in_days = 30
523 }
────────────────────────────────────────────────────────────────────────────────
ID aws-cloudwatch-log-group-customer-key
Impact Log data may be leaked if the logs are compromised. No auditing of who have viewed the logs.
Resolution Enable CMK encryption of CloudWatch Log Groups
Result #36 LOW Log group is not encrypted.
────────────────────────────────────────────────────────────────────────────────
ecs.tf:63-66
────────────────────────────────────────────────────────────────────────────────
63 resource "aws_cloudwatch_log_group" "deployment_logs" {
64 name = "/aws/events/deploymentLogs"
65 retention_in_days = "7"
66 }
────────────────────────────────────────────────────────────────────────────────
ID aws-cloudwatch-log-group-customer-key
Impact Log data may be leaked if the logs are compromised. No auditing of who have viewed the logs.
Resolution Enable CMK encryption of CloudWatch Log Groups
Result #37 LOW Bucket does not have a corresponding public access block.
────────────────────────────────────────────────────────────────────────────────
s3.tf:1-3
────────────────────────────────────────────────────────────────────────────────
1 resource "aws_s3_bucket" "chaps-db-backup-bucket" {
2 bucket = local.application_data.accounts[local.environment].s3_bucket_name
3 }
────────────────────────────────────────────────────────────────────────────────
ID aws-s3-specify-public-access-block
Impact Public access policies may be applied to sensitive data buckets
Resolution Define a aws_s3_bucket_public_access_block for the given bucket to control public access policies
*****************************
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-chaps
*****************************
Running tflint in terraform/environments/cdpt-chaps
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-chaps/ecs.tf line 98:98: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-chaps/ecs.tf line 102:102: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-chaps/ecs.tf line 106:106: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-chaps/ecs.tf line 110:110: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-chaps/ecs.tf line 114:114: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-chaps/ecs.tf line 168:168: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-chaps/secrets.tf line 7:7: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
</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>
```hcl
*****************************
Checkov will check the following folders:
CTFLint Scan Success
Show Output
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>
```hcl
*****************************
Checkov will check the following folders:
CTFLint Scan Success
Show Output
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>
```hcl
*****************************
Checkov will check the following folders:
CTFLint Scan Success
Show Output
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>
```hcl
*****************************
Checkov will check the following folders:
CTFLint Scan Success
Show Output
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>
```hcl
*****************************
Checkov will check the following folders:
CTFLint Scan Success
Show Output
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>
```hcl
*****************************
Checkov will check the following folders:
CTFLint Scan Success
Show Output
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>
```hcl
*****************************
Checkov will check the following folders:
CTFLint Scan Success
Show Output
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>
```hcl
*****************************
Checkov will check the following folders:
CTFLint Scan Success
Show Output
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>
```hcl
*****************************
Checkov will check the following folders:
CTFLint Scan Success
Show Output
*****************************
Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version:0.5.0)
tflint will check the following folders:
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.