What is the main goal of using security scanning tools with Terraform configurations?
Think about what security scanning tools check in code before it runs.
Terraform security scanning tools analyze the code to find security issues or risky settings before the infrastructure is created. This helps prevent vulnerabilities early.
In Terraform Cloud, if a Sentinel policy designed to block insecure resource configurations fails during a plan, what happens?
Sentinel policies enforce rules before changes happen.
Sentinel policies act as gatekeepers. If a policy fails, Terraform Cloud blocks the plan from applying to prevent insecure changes.
Given the following Terraform snippet, which tfsec command output correctly identifies a public S3 bucket risk?
resource "aws_s3_bucket" "example" { bucket = "my-public-bucket" acl = "public-read" }
Look for the tfsec rule that warns about public read ACLs.
tfsec warns with 'aws-s3-public-read-prohibited' when a bucket has a public read ACL, indicating a security risk.
Which architecture best integrates Terraform security scanning tools into a CI/CD pipeline to ensure security checks before deployment?
Think about when security checks should block unsafe changes.
Integrating security scanning after plan and before apply in CI/CD ensures unsafe configurations are caught before deployment.
Given this Terraform resource snippet, which Checkov rule failure explains why the scan fails?
resource "aws_security_group" "example" {
name = "allow_ssh"
description = "Allow SSH inbound"
ingress {
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
}Which rule warns about open SSH access from anywhere?
Checkov rule CKV_AWS_21 flags security groups that allow SSH access from all IPs (0.0.0.0/0) as a security risk.