Skip to content
Draft
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
41 changes: 41 additions & 0 deletions infra/security_group.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
resource "aws_security_group" "authentication_service" {
name = "authentication-service-sg"
description = "Security group for AuthenticationService – restricted access to high-risk ports"
vpc_id = var.vpc_id

# SSH access is restricted to approved administrative networks only.
# Provide appropriate CIDR values via the trusted_admin_cidr variable.
ingress {
description = "SSH from trusted admin network"
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = var.trusted_admin_cidr
}

# RDP access is restricted to approved administrative networks only.
# Provide appropriate CIDR values via the trusted_admin_cidr variable.
ingress {
description = "RDP from trusted admin network"
from_port = 3389
to_port = 3389
protocol = "tcp"
cidr_blocks = var.trusted_admin_cidr
}

egress {
description = "Allow all outbound traffic"
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}

tags = {
Name = "authentication-service-sg"
Environment = "production"
Owner = "platform-security"
Purpose = "Restrict high-risk port access for AuthenticationService"
ManagedBy = "terraform"
}
}
11 changes: 11 additions & 0 deletions infra/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
variable "trusted_admin_cidr" {
description = "List of approved CIDR ranges for administrative access (SSH and RDP). Supply your organization's trusted admin network or jump-host CIDR(s) as the value."
type = list(string)
# Example: ["10.0.0.0/24", "192.168.1.0/28"]
# No default is intentionally provided; callers must supply approved CIDRs explicitly.
}

variable "vpc_id" {
description = "ID of the VPC in which the security group resides."
type = string
}