Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions benchmarks/terraform-ssh-ingress/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Benchmark: Unrestricted SSH Ingress

## Objective
This benchmark tests Proofline's ability to detect an overly permissive security group rule in Terraform that allows unrestricted SSH access from the internet.

## The Bug
The `main.tf` file contains an `aws_security_group` resource with an ingress rule allowing TCP port 22 (SSH) from `0.0.0.0/0` (all IPv4 addresses). This is a common security misconfiguration that can lead to unauthorized access.

## Expected Finding
Proofline should flag a warning regarding `aws_security_group.web` and recommend restricting the CIDR block to trusted IP ranges.

## Evidence
- **GitHub Pull Request:** [Link to your PR](https://github.com/Mudassarahmad21/proofline-benchmark-iac-bug/pull/1)
- **Proofline Review:** [Link to the review](https://proofline.sh/orgs/github/mudassarahmad21/reviews/pr/proofline-benchmark-iac-bug/1/runs/1~01a23a7c-ef55-7030-8214-1e459c88976f)
10 changes: 10 additions & 0 deletions benchmarks/terraform-ssh-ingress/expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"expected_findings": [
{
"severity": "warning",
"category": "Authorization",
"resource": "aws_security_group.web",
"description": "permits inbound SSH from every IPv4 address rather than only trusted sources"
}
]
}
9 changes: 9 additions & 0 deletions benchmarks/terraform-ssh-ingress/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resource "aws_security_group" "web" {
name = "web-sg"
ingress {
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
}