Skip to content

Commit

Permalink
added positive41 sample
Browse files Browse the repository at this point in the history
Signed-off-by: joaorufi <[email protected]>
  • Loading branch information
joaorufi committed Apr 27, 2022
1 parent a34fa7b commit 5180c86
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
28 changes: 28 additions & 0 deletions assets/queries/common/passwords_and_secrets/test/positive41.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
resource "aws_instance" "web_host" {
# ec2 have plain text secrets in user data
ami = var.ami
instance_type = "t2.nano"

vpc_security_group_ids = [
"${aws_security_group.web-node.id}"]
subnet_id = aws_subnet.web_subnet.id
user_data = <<EOF
#! /bin/bash
sudo apt-get update
sudo apt-get install -y apache2
sudo systemctl start apache2
sudo systemctl enable apache2
export AWS_CONTEXT_CREDENTIAL=ACCAIOSFODNN7EXAMAAA
export AWS_CERTIFICATE=ASCAIOSFODNN7EXAMAAA
export AWS_DEFAULT_REGION=us-west-2
echo "<h1>Deployed via Terraform</h1>" | sudo tee /var/www/html/index.html
EOF
tags = merge({
Name = "${local.resource_prefix.value}-ec2"
}, {
git_last_modified_by = "[email protected]"
git_modifiers = "felipe.avelar"
git_org = "checkmarx"
git_repo = "kics"
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -334,5 +334,17 @@
"severity": "HIGH",
"line": 3,
"fileName": "positive40.tf"
},
{
"queryName": "Passwords And Secrets - AWS Context-specific credential",
"severity": "HIGH",
"line": 15,
"fileName": "positive41.tf"
},
{
"queryName": "Passwords And Secrets - AWS Certificate",
"severity": "HIGH",
"line": 16,
"fileName": "positive41.tf"
}
]

0 comments on commit 5180c86

Please sign in to comment.