Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build or embed a DNS server to filter allowed external hostnames #7

Open
achimnol opened this issue Jul 27, 2017 · 1 comment
Open

Comments

@achimnol
Copy link
Member

It is non-trivial to manage outbound security rules using IP addresses, as many external websites rely on load balancers and volatile IP addresses on top of clouds.

Let's build a DNS server that provides transparent access to whitelist domains (e.g., github.com) from user kernel sessions but returns "unresolved" results for other domains.
This would not be perfect but will provides a good starting point.

@achimnol achimnol changed the title Build a DNS server to filter allowed external hostnames Build or embed a DNS server to filter allowed external hostnames Jul 27, 2017
@achimnol
Copy link
Member Author

achimnol commented Jul 27, 2017

I've found a way to do this: http://www.teknynja.com/2009/06/to-protect-and-surf-dnsmasq-and.html

dnsmasq.conf:

domain-needed
bogus-priv
no-resolv

server=/google.com/172.31.0.2
server=/github.com/172.31.0.2
...

Above config on an Ubuntu container can be tested with dig google.com @127.0.0.1 after installing/configuring dnsmasq package.

NOTE: When run inside docker, we need to add one more line to its config: user=root to avoid "dnsmasq: setting capabilities failed: Operation not permitted" error.

We could let Docker use our custom dnsmasq server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant