-
Notifications
You must be signed in to change notification settings - Fork 314
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(queries): add missing check in ec2 instance has public ip (#5720)
* stage * add missing check in EC2 Instance Has Public IP * add negative samples * add cleanPath * escaping html * fix unhandled error * ignore command warning * fix //#nosec * update no sec * ignore gosec * remove test.json
- Loading branch information
1 parent
4006b83
commit 0d3461a
Showing
9 changed files
with
68 additions
and
7 deletions.
There are no files selected for viewing
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
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
2 changes: 2 additions & 0 deletions
2
assets/queries/ansible/aws/ec2_instance_has_public_ip/query.rego
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
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
2 changes: 1 addition & 1 deletion
2
assets/queries/cloudFormation/aws/ec2_subnet_mapping_public_ip_on_launch/metadata.json
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
4 changes: 2 additions & 2 deletions
4
...udFormation/aws/ec2_subnet_mapping_public_ip_on_launch/test/positive_expected_result.json
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
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
33 changes: 33 additions & 0 deletions
33
assets/queries/terraform/aws/ec2_instance_has_public_ip/test/negative3.tf
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
module "ec2_instance" { | ||
source = "terraform-aws-modules/ec2-instance/aws" | ||
version = "~> 3.0" | ||
|
||
name = "single-instance" | ||
|
||
ami = "ami-ebd02392" | ||
instance_type = "t2.micro" | ||
key_name = "user1" | ||
monitoring = true | ||
vpc_security_group_ids = ["sg-12345678"] | ||
subnet_id = "subnet-eddcdzz4" | ||
|
||
network_interface { | ||
network_interface_id = aws_network_interface.this.id | ||
device_index = 0 | ||
} | ||
|
||
tags = { | ||
Terraform = "true" | ||
Environment = "dev" | ||
} | ||
} | ||
|
||
resource "aws_network_interface" "this" { | ||
subnet_id = var.private_subnet_id | ||
security_groups = [aws_security_group.this.id] | ||
} | ||
|
||
resource "aws_security_group" "this" { | ||
name = "example" | ||
description = "Example Security Group" | ||
} |
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