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
{{ message }}
Repository navigation
Security: Make optional the hard-coded Security Group runner_sg? #748
Howdy. I have a restriction in an environment that prevents wide open egress AWS Security Group rules from being applied (automation actually reverses what this module sets). Each time I apply this rule the automation undoes this, so we get repeating change-in-place loops from TF apply to apply. I'd rather manage this via other means - like using the default SG for the VPC. Is this possible? Or am I missing a path to this functionality that already is available via the module input variables?
Disable applying this SG (and then rely on the VPC default SG)
Note that I'm already using runner_additional_security_group_ids input variable to specify the default VPC SG, but I don't think I can use that to undo what this code is doing?
The security group should be better configurable, what do you think of making the egress fully configureable with the current defaults. In that case we avoid breaking changes. I have done the same for another module, check
@boldandbusted does the automation in your environment not like the destination range of IP addresses (that is, 0.0.0.0/0) or the list of ports (0 to 65535)?
I'm wondering if keeping 0.0.0.0/0 but restricting the ports will resolve this issue.
@boldandbusted does the automation in your environment not like the destination range of IP addresses (that is, 0.0.0.0/0) or the list of ports (0 to 65535)?
I'm wondering if keeping 0.0.0.0/0 but restricting the ports will resolve this issue.
Sorry for the late reply. It's hard for me to tell because there are other groups that have automation that slams closed security groups that open ports and IPs to the public Internet. It would probably be useful to have what @npalm suggests for a PR, if that gives us flexibility to specify address and ports, together.
The S3 bucket at the end of that allowlist is the one with the runner binaries. So the hostname can be deduced/output from that module.
And very early on, on instance boot:
1 attempt to ec2-instance-connect.<region>.amazonaws.com over TLS on port 443 and 3 attempts to some S3 IP address on port 80 (we did not capture the details of these.) All these were not allowed 🔒 and the runners still functioned as expected ✔️
GitHub have documented Communication between self-hosted runners and GitHub nicely. Maybe because of our simplistic Hello World pipeline we did not see connections to all those mentioned but they should be expected.
The Lambda functions were not run in the VPC and therefore not analysed yet.
Disclosure: I work for a network firewall co. and their firewall was used. We are working on a support case that requires GitHub self-hosted runners in their VPC to be filtered outbound, hence the interest and the work 🤓
Activity
npalm commentedon Apr 13, 2021
The security group should be better configurable, what do you think of making the egress fully configureable with the current defaults. In that case we avoid breaking changes. I have done the same for another module, check
https://github.com/npalm/terraform-aws-gitlab-runner/blob/8b15241b34c87d7b21c7a14fddf7d0b84f750f1b/security_groups.tf#L5
Feel free to suggest the change in a PR
new23d commentedon Jul 16, 2021
@boldandbusted does the automation in your environment not like the destination range of IP addresses (that is, 0.0.0.0/0) or the list of ports (0 to 65535)?
I'm wondering if keeping 0.0.0.0/0 but restricting the ports will resolve this issue.
boldandbusted commentedon Aug 11, 2021
Sorry for the late reply. It's hard for me to tell because there are other groups that have automation that slams closed security groups that open ports and IPs to the public Internet. It would probably be useful to have what @npalm suggests for a PR, if that gives us flexibility to specify address and ports, together.
new23d commentedon Aug 14, 2021
FWIW, we analysed the egress traffic from the runner through a firewall. As of today, it was TLS port 443 (so HTTPS I guess) connections to:
The S3 bucket at the end of that allowlist is the one with the runner binaries. So the hostname can be deduced/output from that module.
And very early on, on instance boot:
1 attempt to
ec2-instance-connect.<region>.amazonaws.comover TLS on port 443 and 3 attempts to some S3 IP address on port 80 (we did not capture the details of these.) All these were not allowed 🔒 and the runners still functioned as expected ✔️GitHub have documented Communication between self-hosted runners and GitHub nicely. Maybe because of our simplistic Hello World pipeline we did not see connections to all those mentioned but they should be expected.
The Lambda functions were not run in the VPC and therefore not analysed yet.
Disclosure: I work for a network firewall co. and their firewall was used. We are working on a support case that requires GitHub self-hosted runners in their VPC to be filtered outbound, hence the interest and the work 🤓
feat: add option to overwrite / disable egress #748 (#1112)
chore(release): 0.18.0 [skip ci]
new23d commentedon Sep 21, 2021
For completeness, the Lambda talks to
We've documented our scan here.
@npalm since the PR was merged, this issue can be closed?
@boldandbusted your thoughts? Satisfied with the PR?
boldandbusted commentedon Sep 21, 2021
This looks fantastic! I'm satisfied, and grateful. :) I think this can be closed, from my perspective. Wooohoo!
gertjanmaas commentedon Sep 22, 2021
Alright, closing it then :)
chore(release): 0.18.0 [skip ci]
chore(release): 1.12.0 [skip ci]