CKV2_AWS_5 does not check for ecs_service or aws_dms_replication_instance
See original GitHub issueDescribe the bug
We’re getting the following:
Check: CKV2_AWS_5: "Ensure that Security Groups are attached to EC2 instances or elastic network interfaces (ENIs)"
FAILED for resource: aws_security_group.ecs_ingress_loadbalancer
File: /api.tf:12-35
Guide: https://docs.bridgecrew.io/docs/ensure-that-security-groups-are-attached-to-ec2-instances-or-elastic-network-interfaces-enis
12 | resource "aws_security_group" "ecs_ingress_loadbalancer" {
13 | name = module.ecs_ingress_load_balancer.id
14 | description = "Allow HTTP inbound traffic from Load Balancer"
15 | vpc_id = module.vpc.vpc_id
16 |
17 | ingress {
18 | # TLS (change to whatever ports you need)
19 | from_port = 80
20 | to_port = 80
21 | protocol = "TCP"
22 | security_groups = [
23 | module.alb.security_group_id,
24 | ]
25 | }
26 |
27 | egress {
28 | from_port = 0
29 | to_port = 0
30 | protocol = "-1"
31 | cidr_blocks = [
32 | "0.0.0.0/0",
33 | ]
34 | }
35 | }
This security group is assigned to ecs_service. Same error occurs when we create a SG and associate it with aws_dms_replication_instance.
To Reproduce
- Create a security group
- Assign it to an
ecs_service
ordms_replication_instance
Expected behavior The CKV2_AWS_5 check not failing, because the SG is assigned to an ECS Service / DMS Replication Instance.
Desktop (please complete the following information):
- OS: Linux
- Checkov Version: 2.0.116
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
Working with an AWS DMS replication instance
Region Name Region Protocol
US East (Ohio) us‑east‑2 HTTPS. HTTPS. HTTPS
US East (N. Virginia) us‑east‑1 HTTPS. HTTPS. HTTPS
US West (N. California) us‑west‑1 HTTPS. HTTPS....
Read more >AWS DMS replication instance out of memory - Stack Overflow
I recently started to work with AWS Data Migration Service (DMS) and running into some issues. Currently attempting to migrate a 10GB Oracle...
Read more >12 AWS DMS - Replication Instance and Database endpoints
Using an AWS SCT replication agent with AWS DMSFor very large database migrations, you can use an AWS SCT replication agent ...
Read more >Why is my AWS Database Migration Service (AWS DMS ...
Why is my AWS Database Migration Service ( AWS DMS) replication instance in a storage-full status? Watch later. Share. Copy link.
Read more >Publicly Accessible DMS Replication Instances - Trend Micro
Ensure that AWS DMS replication instances are not publicly accessible and prone to security risks.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
CKV2_AWS_5 is also raised when the Security Group is attached in the aws_launch_configuration resource.
If applied to aws_launch_configuration, then it also needs applying to aws_launch_template
I’m getting this reported for this example…