Repository navigation
Move admin SSH CIDR to a variable and add it as an output - #191
Conversation
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>
| { | ||
| rule = "ssh-tcp" | ||
| cidr_blocks = "71.237.173.68/32" | ||
| cidr_blocks = var.admin_ssh_cidr |
There was a problem hiding this comment.
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.
| @@ -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 | |||
There was a problem hiding this comment.
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.
🟡 PASS: OC Claude review, 1 finding to considerNote 1 finding to consider. It does not block this PR.
Run 40984982829, attempt 1 for head 📋 Full review record: reasons, checks, signals, finding details, model summaries, token usageReviewed snapshot
Reasons the gate failed None. No reason applies. Checks (code, no model)
Signals (context only, never block) None. Dependency changes None. Finding details
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.
The Review pass completed and reported no findings. The Supply chain pass completed and reported no findings. Model summaries
Token usage
|
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>
|
|
||
| output "admin_ssh_cidr" { | ||
| description = "CIDR allowed to SSH to the ECS instances" | ||
| value = var.admin_ssh_cidr |
There was a problem hiding this comment.
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.
Summary
asg.tfto a new required variable,admin_ssh_cidr. Set it interraform.tfvars, which git ignores, so the admin IP is not in git.admin_ssh_cidroutput.Notes
terraform.tfvars.🤖 Generated with Claude Code