concourse / hush-house

Concourse k8s-based environment
https://hush-house.pivotal.io
29 stars 23 forks source link

ci-pr: restrict dns resolution to an external provider #80

Open cirocosta opened 4 years ago

cirocosta commented 4 years ago

Hey,

In #75 we added a set of rules under a network policy to restrict the types of network connectivity that the untrusted PR Concourse workers can have, ending up with the following:

https://github.com/concourse/hush-house/blob/a14d0832ecac5753c138a9287e12a3be375cc1a5/deployments/with-creds/ci-pr/templates/network-policy.yaml#L13-L30

Being the most paranoid, "any *dns resolution" can actually be extended to "any egress traffic on port 53 TCP/UDP", which can be thought of "any connectivity to a service, internal or not, that serves something on port 53".

Given that can be a bit too much openess for untrusted workloads, it might be better to go with something more restrictive, allowing no traffic whatsoever to internal net, a set of public external dns servers in its configuration.

At the moment, that's not entirely possible through concourse/concourse-chart though, as no dnsConfig can be configured - something to be tackled as part of this issue.

Thanks!

cirocosta commented 4 years ago

While this is all great, ultimately, we should: