Search code examples
configurationembedded-linuxchromiumopensuse

How can I keep Google Chromium from making unrequested outgoing connections?


I'm using the Chromium browser as the display for an embedded openSUSE-based project. Everything's going well, but I just now found out that Chromium is making dozens of connections to various *.ie100.net domains. I know this is Google's safe browsing system kicking in, but in my case this is useless because Chromium is just showing my own embedded server. I also know it isn't nefarious, and won't cause explicit harm, but I'm worried customers will see the traffic and get worried.

I've tried turning off safe browsing by editing .config/chromium/Default/Preferences...

"safebrowsing": {
    "enabled": false
},

... but to no avail. I'm also worried that there are other Chromium features that may kick in and send backdoor traffic.

So, how can I tell Chromium to stop making unrequested outgoing connections? Do I need to block it at the system level?


Solution

  • My best solution has been to use iptables to block all outgoing request to ports 80 or 433. Yes, this prevents other browswers from being used in my product, but this isn't a problem for an embedded system.

    Here's the script which cleans up any previous rules and then sets up blocking rules:

    # Chrome has a nasty habit of connecting to various *.ie100.net domains, probably for
    # safe browsing but who knows. Concern is that our customers will see these
    # connections and wonder what the heck's going on. So, we block them.
    
    # Kill any previous KILL_CHROME chain. First, get rid of all referencing rules
    RULES=$(sudo iptables -L OUTPUT --line-numbers | grep KILL_CHROME | cut -d' ' -f1 | sort -r )
    for rule in $RULES; do
        sudo iptables -D OUTPUT $rule
    done
    
    # Clean out chain
    sudo iptables --flush KILL_CHROME
    
    # Remove chain
    sudo iptables -X KILL_CHROME
    
    # Now, build new rules. Add new iptables chain KILL_CHROME
    sudo iptables -N KILL_CHROME
    # Any newly-created outgoing tcp connections on eth0 to port 80 are routed to KILL_CHROME
    sudo iptables -A OUTPUT -o eth0 -m conntrack --ctstate NEW -p tcp --dport 80 -j KILL_CHROME
    # Any newly-created outgoing tcp connections on eth0 to port 443 are routed to KILL_CHROME
    sudo iptables -A OUTPUT -o eth0 -m conntrack --ctstate NEW -p tcp --dport 443 -j KILL_CHROME
    # Log every connection in KILL_CHROME
    sudo iptables -A KILL_CHROME -j LOG --log-prefix "New Dropped: "
    # And drop it like a hot potato.
    sudo iptables -A KILL_CHROME -j 
    

    'Twould be good for Chromium to support some sort of flag to prevent this behavior, but since there doesn't seem to be one this is the best I can do.