From c80b7f5f474c07c7636426c72462cac3991701e1 Mon Sep 17 00:00:00 2001 From: Mudassar Ahmad Date: Thu, 3 Dec 2026 12:01:52 +0500 Subject: [PATCH] Add Terraform unrestricted SSH benchmark --- benchmarks/terraform-ssh-ingress/README.md | 14 ++++++++++++++ benchmarks/terraform-ssh-ingress/expected.json | 10 ++++++++++ benchmarks/terraform-ssh-ingress/main.tf | 9 +++++++++ 3 files changed, 33 insertions(+) create mode 100644 benchmarks/terraform-ssh-ingress/README.md create mode 100644 benchmarks/terraform-ssh-ingress/expected.json create mode 100644 benchmarks/terraform-ssh-ingress/main.tf diff --git a/benchmarks/terraform-ssh-ingress/README.md b/benchmarks/terraform-ssh-ingress/README.md new file mode 100644 index 0000000..958883f --- /dev/null +++ b/benchmarks/terraform-ssh-ingress/README.md @@ -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) \ No newline at end of file diff --git a/benchmarks/terraform-ssh-ingress/expected.json b/benchmarks/terraform-ssh-ingress/expected.json new file mode 100644 index 0000000..2ac9e90 --- /dev/null +++ b/benchmarks/terraform-ssh-ingress/expected.json @@ -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" + } + ] +} \ No newline at end of file diff --git a/benchmarks/terraform-ssh-ingress/main.tf b/benchmarks/terraform-ssh-ingress/main.tf new file mode 100644 index 0000000..4b5417b --- /dev/null +++ b/benchmarks/terraform-ssh-ingress/main.tf @@ -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"] + } +} \ No newline at end of file