Skip to content

Commit

Permalink
Restrict SSH access to cluster VMs
Browse files Browse the repository at this point in the history
We remove the SSH access from anywhere for the cluster VMs by updating
the `all_machines` security group to only allow SSH from other machines
in the `all_machines` security group.

This PR requires appuio/terraform-modules#51 in
order to ensure that the LBs remain accessible from anywhere via SSH and
can act as SSH jumphosts for SSH access to the cluster VMs.
  • Loading branch information
simu committed Feb 15, 2024
1 parent 0cfe477 commit 1762293
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions security_groups.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,26 +65,16 @@ resource "exoscale_security_group_rule" "all_machines_icmp" {
cidr = "0.0.0.0/0"
}

resource "exoscale_security_group_rule" "all_machines_ssh_v4" {
resource "exoscale_security_group_rule" "all_machines_ssh" {
security_group_id = exoscale_security_group.all_machines.id

description = "SSH Access"
description = "SSH Access from cluster VMs and LBs"
type = "INGRESS"
protocol = "TCP"
start_port = "22"
end_port = "22"
cidr = "0.0.0.0/0"
}

resource "exoscale_security_group_rule" "all_machines_ssh_v6" {
security_group_id = exoscale_security_group.all_machines.id

description = "SSH Access"
type = "INGRESS"
protocol = "TCP"
start_port = "22"
end_port = "22"
cidr = "::/0"
user_security_group_id = exoscale_security_group.all_machines.id
}

resource "exoscale_security_group" "control_plane" {
Expand Down

0 comments on commit 1762293

Please sign in to comment.