Community discussions

MikroTik App
mt99
newbie
Topic Author
Posts: 41
加入: Wed Jan 03, 2018 6:07 pm

白名单网站从续ainer

Wed Jul 19, 2023 12:27 am

Greetings all - I have a couple existing Docker containers that I want to migrate to RouterOS. I have a Pihole container that handles DNS for internal clients, and then an Alpine container I built that runs the NextDNS client (since unfortunately they don't support RouterOS natively) for DoH. The Pihole uses the NextDNS container as its upstream DNS. I only let the NextDNS container communicate outbound TCP 443 to the NextDNS servers, which is a handful of IP addresses. Since the Pihole isn't responsible for DoH, I currently have it use a Squid proxy to get its adlist updates and all other web destinations are denied. Since Pihole isn't proxy aware, I use Docker to transparently force proxy usage through its config.json file.

All of this I have running in a parallel environment on a RB3011, except for whitelisting the Pihole's web traffic to the adlist servers which I can't figure out how to do. I know I could simply NAT all traffic from the Pihole to the proxy, but since Pihole isn't proxy aware I'm not sure if that would help. Wondering if others have tackled web filtering for their containers. Maybe a third container that acts as a transparent proxy?
Top
tangent
Forum Guru
Forum Guru
Posts: 1011
加入: Thu Jul 01, 2021 3:15 pm

Re: Whitelisting web destinations from container

Wed Jul 19, 2023 12:51 am

What risk are you protecting against? PiHole suddenly goes evil?
Top
mt99
newbie
Topic Author
Posts: 41
加入: Wed Jan 03, 2018 6:07 pm

Re: Whitelisting web destinations from container

Wed Jul 19, 2023 1:31 am

Hi, thanks for responding. I just prefer to provision resources in accordance with least privilege. I know the Pihole only requires Internet access to the adlist servers to get its updates, so that's what I give it. But I expected my first question would be "Do you need to run Pihole and NextDNS at the same time?" I know there is some functionality overlap there, but I like the flexibility and control that Pihole + NextDNS provide. I guess I'm just a belt and suspenders kind of person:D

Anyway, too much OT. I guess if all else fails, I could control when the Pihole updates via cron and do a time-based firewall rule that opens TCP 443 at that time. But it's clunky and I'm sure there's a more elegant solution somewhere.....?
Top
tangent
Forum Guru
Forum Guru
Posts: 1011
加入: Thu Jul 01, 2021 3:15 pm

Re: Whitelisting web destinations from container

Wed Jul 19, 2023 1:46 am

If the updates happen over HTTPS or via a CDN, it’s likely more work than it’s worth regardless. Same basic problem asthis.
Top

Who is online

Users browsing this forum: No registered users and 3 guests