Skip to content

Move admin SSH CIDR to a variable and add it as an output - #191

Merged
irvingpop merged 2 commits into
mainfrom
admin-ssh-cidr-var
Oct 30, 2026
Merged

irvingpop merged 2 commits into
mainfrom
admin-ssh-cidr-var

Conversation

@irvingpop

Copy link
Copy Markdown
Member

Summary

  • Move the SSH ingress CIDR in asg.tf to a new required variable, admin_ssh_cidr. Set it in terraform.tfvars, which git ignores, so the admin IP is not in git.
  • Add an admin_ssh_cidr output.

Notes

  • The variable has no default. Anyone who runs Terraform must set it in their own terraform.tfvars.

🤖 Generated with Claude Code

The admin home IP changed. Move the SSH CIDR to the admin_ssh_cidr
variable, set in the git-ignored terraform.tfvars, so the IP is not
committed to git.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OC Claude review, run 40984538092: 2 inline finding(s). Model output from untrusted input. Check it before you act on it. The gate result is in the summary comment.

Comment thread terraform/asg.tf
{
rule = "ssh-tcp"
cidr_blocks = "71.237.173.68/32"
cidr_blocks = var.admin_ssh_cidr

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low bug, confidence medium, pass review

No validation of CIDR format in required variable

The variable is a bare string with no validation block. An empty or malformed value (for example an unset tfvars entry set to an empty string) will only fail at apply time inside the AWS API, or could yield an unintended rule. A validation using cidrhost or can(cidrnetmask) would catch this at plan time.

Model output from untrusted input. Check it before you act on it.

Comment thread terraform/variables.tf
@@ -0,0 +1,4 @@
variable "admin_ssh_cidr" {
description = "CIDR allowed to SSH to the ECS instances. Set in terraform.tfvars, which git ignores."
type = string

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low security, confidence low, pass security

No validation on SSH CIDR variable

admin_ssh_cidr accepts any string and feeds the security group SSH ingress rule. An operator could set 0.0.0.0/0 by mistake, which would expose SSH to the internet. The input comes from the operator's tfvars, so the impact is limited, but a validation block could reject overly broad ranges. The old value was a fixed /32.

Model output from untrusted input. Check it before you act on it.

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

🟡 PASS: OC Claude review, 1 finding to consider

Note

1 finding to consider. It does not block this PR.
Next step for the author: read the finding and fix what you agree with.

Severity Effect Where Finding Found by
🟡 Low Does not block terraform/asg.tf:21 Admin IP exposed via Terraform output See the inline comment. Security (low)
File checks Review Security Supply chain Dependency review Coverage
✅ ok ✅ ran, 0 findings ✅ ran, 1 finding ✅ ran, 0 findings ✅ ok ✅ complete

Run 40984982829, attempt 1 for head f4779bd into main. The required workflow in the merge box is the result that counts. This bot never approves a PR.

📋 Full review record: reasons, checks, signals, finding details, model summaries, token usage

Reviewed snapshot

Head SHA Merge base SHA Base branch Run
f4779bde92a6d141bd35a20d7f222dcd24f03f70 d28b70ea397a959b8b0ac3ff96789e08df88d464 main 40984982829, attempt 1

Reasons the gate failed

None. No reason applies.

Checks (code, no model)

Check Result Detail
Hard blocks ✅ none
Coverage ✅ complete files in comparison 2, files collected 2, trees complete
Dependency changes ✅ none
Dependency review job ✅ success

Signals (context only, never block)

None.

Dependency changes

None.

Finding details

Model output from untrusted input. Check it before you act on it. Verified means only that the quoted text is at that place. It does not mean the claim is true.

Blocking is decided by code from category and severity, never by the model. A finding in a blocking category blocks only at high or critical severity.

Pass Severity Category Confidence Citation Posted Model title
Security low security low ✅ checked inline Admin IP exposed via Terraform output

The Review pass completed and reported no findings.

The Supply chain pass completed and reported no findings.

Model summaries

Model output from untrusted input. Check it before you act on it. Verified means only that the quoted text is at that place. It does not mean the claim is true.

Pass Status Model Summary
Review ✅ ok claude-sonnet-5-5 The PR moves the hardcoded SSH ingress CIDR into a required variable `admin_ssh_cidr` with a /32 IPv4 validation, and adds an output for it. One issue: the module's `cidr_blocks` field expects a comma-separated string, so a single /32 string works. The validation looks correct. No clear bugs found.
Security ✅ ok claude-sonnet-5-5 The PR moves a hard-coded SSH ingress CIDR into a required, validated variable (/32 only) and adds an output that exposes it. The validation reduces risk of opening SSH broadly. The one concern is that the new output prints the admin IP, which the PR says it wants kept out of git.
Supply chain ✅ ok claude-sonnet-5-5 The PR moves a hardcoded SSH ingress CIDR in the ECS autoscaling security group to a new required variable `admin_ssh_cidr` with a /32 validation, and adds an output for it. No dependency changes, no CI or workflow edits, no network calls, no obfuscation, and no text aimed at an AI reviewer. The change narrows nothing and widens nothing beyond requiring the value be a single IPv4 /32. I found no supply-chain or malicious concerns.

Token usage

Pass Input Output Cache write Cache read Attempts
Review 722 126 0 8209 1
Security 1048 295 0 8209 1
Supply chain 1240 175 8209 0 1
Total 3010 596 8209 16418 3

Reject malformed values and wide ranges such as 0.0.0.0/0 at plan
time. Addresses review feedback on the PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OC Claude review, run 40984982829: 1 inline finding(s). Model output from untrusted input. Check it before you act on it. The gate result is in the summary comment.

Comment thread terraform/asg.tf

output "admin_ssh_cidr" {
description = "CIDR allowed to SSH to the ECS instances"
value = var.admin_ssh_cidr

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low security, confidence low, pass security

Admin IP exposed via Terraform output

The output prints the admin SSH CIDR to the CLI, to CI logs and to remote state readers. This partly defeats the goal of keeping the admin IP out of public view. The exposure is minor, since the value is a single allowlisted IP and not a credential. An attacker would need access to the logs or the state.

Model output from untrusted input. Check it before you act on it.

@irvingpop
irvingpop merged commit f38a8ca into main Oct 30, 2026
5 checks passed
@irvingpop
irvingpop deleted the admin-ssh-cidr-var branch October 30, 2026 01:19
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.

1 participant