<div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">Hello.</div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);"><br></div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">I am trying to make a tor only allow traffic through onion services and exit nodes.</div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);"><br></div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">I would like to blacklist all domains first, as that is simple and does not need to be updated,</div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">then whitelist all onions and exits.</div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);"><br></div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">Reason: I am hosting an onion service, but I don't want any client traffic comming from that</div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">machine.</div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);"><br></div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">I've played with MapAddress, VirtualAddrNetworkIPV4, AutomapHostsOnResolve,</div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">AutomaptHostsSuffixes, but nothing seems to work as intended above.</div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);"><br></div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">MapAddress *=127.0.0.1 does not report invalid conf, but the controller reports it is using</div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">invalid sytax because "*" be source or target.</div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">I tricked the controller with MapAddress *.*=127.0.0.1, as every domain has a dot, the controller</div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">didn't report syntax error and this option is actually ignored.<br></div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);"><br></div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">If the above worked, then the next option would be the whitelisting:</div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">MapAddress *.onion VIRTUAL_IP<br></div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">Or possibly the AutomapHostsOnResolve 1 and AutomapHostsSuffixes .exit,.onion would</div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">handle that part hopefully.<br></div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);"><br></div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">I did the lazy way, the antivirus way, I downloaded the IANA TLD domain list and used basic</div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">string manipulation to make: MapAddress *.${domain} 127.0.0.1</div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">And yes, as you may think, the list is huge that has to be on its own included conf file, and also</div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">prone to be outdated every time a new TLD is created. But it works, in a dumb and prone to</div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">mistakes, it works. Can this be done better? Not antivirus way of all is permitted, some known</div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">items are blocked. I would prefer all is blocked and some items are permitted.<br></div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);"><br></div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">The real objective was to block all non .onion and .exit targets coming from a client, that the</div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">controller reports with SOURCE_ADDR, but I didn't find an option to MapAddress per client</div><div style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">or anything similar to that do manipulate addresses per client source, so that is why I started doing this for all tor traffic, which is not what I really want, but controlling targets per client.<br></div>