Skip to content

fix(infra): restrict overly permissive security group ingress#122

Open
hacktron-app-stg[bot] wants to merge 1 commit into
add-terraform-infrafrom
hacktron/fix-6251a928
Open

fix(infra): restrict overly permissive security group ingress#122
hacktron-app-stg[bot] wants to merge 1 commit into
add-terraform-infrafrom
hacktron/fix-6251a928

Conversation

@hacktron-app-stg

Copy link
Copy Markdown

Vulnerability

infra.tf defined the security group aws_security_group.open with an ingress rule permitting all ports (0-65535), all protocols (-1), from any source (0.0.0.0/0). This effectively disables network-level ingress filtering, exposing any associated resources (including SSH and database ports) to the entire public internet.

Fix

The ingress rule was tightened to:

  • from_port/to_port = 443 (HTTPS only, instead of the full 0-65535 range)
  • protocol = tcp (instead of -1, which matches all protocols)
  • cidr_blocks = ["10.0.0.0/8"] (private network range, instead of 0.0.0.0/0)

The resource name was also updated from allow-all to restricted-ingress to reflect the corrected posture.

This is a minimal change limited to the vulnerable aws_security_group.open block; the other resources in the file are untouched.

Verification

Reviewed the resulting Terraform block — no 0.0.0.0/0, no wildcard protocol, no full port range remains for this security group. No Terraform toolchain is provisioned in the sandbox to run terraform validate, and the repository has no existing test infrastructure for the Terraform config, so no automated test was added.


Automated fix by Hacktron for finding: https://staging.hacktron.ai/testestesttest/findings/6251a928-2db2-46bc-b633-d0e81d36b75e

Scope aws_security_group.open ingress to TCP 443 from the private
10.0.0.0/8 range instead of all ports/protocols from 0.0.0.0/0.
@hacktron-app-stg
hacktron-app-stg Bot requested a review from maekuss July 23, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants