You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat!: add custom egress rules to worker security groups (#1222)
Add custom egress rules to docker-autoscaler security group and remove
condition to provision unused docker-machine security group.
## Description
1. By default, the module provisions a security group for Docker
Autoscaler workers with egress rules that allow ALL traffic. Unlike
ingress rules, egress rules are not customizable, which poses a
significant security concern. This PR introduces the ability to
customize egress rules for the Docker Autoscaler workers' security group
by declaring a separate variable for docker-autoscaler egress rules.
2. `var.runner_worker_docker_autoscaler_asg` becomes bulky and hard to
read. Considering the complexity of the ingress rules structure, it
makes sense to create a separate variable
`var.runner_worker_docker_autoscaler_ingress_rules` for ingress rules.
This way we will follow variable convention for existing security group
rules variables, i.e.
`var.runner_worker_docker_machine_extra_egress_rules`. In the result of
the change: `var.runner_worker_docker_autoscaler_asg.sg_ingresses` is
removed and its content should be moved to
`var.runner_worker_ingress_rules`.
3. Adding `var.runner_ingress_rules` to manage Ingress rules for
runner-manager security group.
4. Changed runner-manager egress rules' var name and its spec.
`var.runner_networking_egress_rules` has migrated to
`var.runner_egress_rules` with a new spec.
5. Additionally, PR removes the condition that provisions an unused
security group intended solely for Docker Machine setup.
## Migrations required
1. Move all docker-autoscaler ingress rules declaration from
`var.runner_worker_docker_autoscaler_asg.sg_ingresses` to
`var.runner_worker_ingress_rules`.
2. `var.runner_networking_egress_rules` migrated to
`var.runner_manager_egress_rules` with a new spec.
3. Move `var.runner_worker_docker_machine_extra_egress_rules` to
`var.runner_worker_egress_rules`. In case you used multiple cidr_blocks,
... you have to create multiple rules.
Attention: The default value for
`var.runner_worker_docker_machine_extra_egress_rules` allowing all
egress traffic has been replaced by a rule allowing traffic to port
22/443 only. Don't forget to add the rules you need to
`var.runner_worker_egress_rules`.
Attention: Due to the resource replacement you might see inconsistencies
and disappearing security group rules. In that case delete all rules
from the Runner and Runner Workers and apply the module again.
Sample egress rule:
```
runner_worker_egress_rules = [
{
cidr_block = "0.0.0.0/0"
from_port = 443
protocol = "tcp"
to_port = 443
description = "Allow HTTPS egress traffic."
},
{
ipv6_cidr_block = "::/0"
description = "Allow HTTPS Egress everywhere"
from_port = 443
protocol = "tcp"
to_port = 443
}
]
```
---------
Signed-off-by: Yevgen Karlashov <[email protected]>
Co-authored-by: Matthias Kay <[email protected]>
0 commit comments