Skip to content

Commit 9cbd8cb

Browse files
authored
Allow container SSH through iptables DOCKER-USER chain (#100)
* fix(shadeform): allow container SSH through iptables DOCKER-USER chain * fix(shadeform): update comment to clarify dport 22 scope
1 parent 0f201b3 commit 9cbd8cb

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

v1/providers/shadeform/firewall.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ const (
3636
// Allow inbound traffic on the loopback interface.
3737
ipTablesAllowDockerUserInpboundLoopback = "iptables -A DOCKER-USER -i lo -j ACCEPT"
3838

39+
// Allow external inbound TCP traffic to any container port 22 (SSH)
40+
ipTablesAllowDockerUserContainerSSH = "iptables -A DOCKER-USER -p tcp --dport 22 -j ACCEPT"
41+
3942
// Drop everything else.
4043
ipTablesDropDockerUserInbound = "iptables -A DOCKER-USER -j DROP"
4144
ipTablesReturnDockerUser = "iptables -A DOCKER-USER -j RETURN"
@@ -91,6 +94,7 @@ func (c *ShadeformClient) getIPTablesCommands() []string {
9194
ipTablesAllowDockerUserDockerToDocker2,
9295
ipTablesAllowDockerUserDockerToDocker3,
9396
ipTablesAllowDockerUserInpboundLoopback,
97+
ipTablesAllowDockerUserContainerSSH,
9498
ipTablesDropDockerUserInbound,
9599
ipTablesReturnDockerUser, // Expected by Docker
96100
}

0 commit comments

Comments
 (0)