Actions

Whonix-Gateway Security Hardening

From Whonix


Gatewayhardening.jpg

Introduction[edit]

Info Tip: Disabling Control Port Filter Proxy [archive] (onion-grater) can improve security by decreasing the attack surface, while sacrificing usability.

Note that if onion-grater is disabled, users will no longer receive helpful Whonix ™ notifications when Tor is not fully bootstrapped, since the whonixcheck and sdwdate tools rely upon it.

How-to: Disable Control Port Filter Proxy[edit]

Whonix-Gateway ™[edit]

Deactivate onion-grater in Firewall[edit]

1. Modify Whonix-Gateway ™ User Firewall Settings.

Note: If no changes have yet been made to Whonix ™ Firewall Settings, then the Whonix ™ User Firewall Settings File /usr/local/etc/whonix_firewall.d/50_user.conf appears empty (because it does not exist). This is expected.

If using Qubes-Whonix ™, complete these steps.
In Whonix-Gateway ™ App Qube. Make sure folder /usr/local/etc/whonix_firewall.d exists.

sudo mkdir -p /usr/local/etc/whonix_firewall.d

Qubes App Launcher (blue/grey "Q")Whonix-Gateway ™ App Qube (commonly called sys-whonix)Whonix ™ User Firewall Settings

If using a graphical Whonix-Gateway ™, complete these steps.

Start MenuApplicationsSettingsUser Firewall Settings

If using a terminal-only Whonix-Gateway ™, complete these steps.

In Whonix-Gateway ™, open the whonix_firewall configuration file in an editor.

sudoedit /usr/local/etc/whonix_firewall.d/50_user.conf

For more help, press on Expand on the right.

Note: This is for informational purposes only! Do not edit /etc/whonix_firewall.d/30_whonix_gateway_default.conf.

Note: The Whonix ™ Global Firewall Settings File /etc/whonix_firewall.d/30_whonix_gateway_default.conf contains default settings and explanatory comments about their purpose. By default, the file is opened read-only and is not meant to be directly edited. Below, it is recommended to open the file without root rights. The file contains an explanatory comment on how to change firewall settings.

## Please use "/etc/whonix_firewall.d/50_user.conf" for your custom configuration,
## which will override the defaults found here. When {{project_name}} is updated, this
## file may be overwritten.

See also Whonix modular flexible .d style configuration folders.

To view the file, follow these instructions.

If using Qubes-Whonix ™, complete these steps.

Qubes App Launcher (blue/grey "Q")Template: whonix-gw-16Whonix Global Firewall Settings

If using a graphical Whonix-Gateway ™, complete these steps.

Start MenuApplicationsSettingsGlobal Firewall Settings

If using a terminal-only Whonix-Gateway ™, complete these steps.

In Whonix-Gateway ™, open the whonix_firewall configuration file in an editor.

nano /etc/whonix_firewall.d/30_whonix_gateway_default.conf

2. Add the following content.

CONTROL_PORT_FILTER_PROXY_ENABLE=0

3. Save the file.

4. Reload Whonix-Gateway ™ Firewall.

If you are using Qubes-Whonix ™, complete the following steps.

Qubes App Launcher (blue/grey "Q")Whonix-Gateway ™ ProxyVM (commonly named sys-whonix)Reload Whonix ™ Firewall

If you are using a graphical Whonix-Gateway ™, complete the following steps.

Start MenuApplicationsSystemReload Whonix ™ Firewall

If you are using a terminal-only Whonix-Gateway ™, run.

sudo whonix_firewall

Deactivate onion-grater[edit]

1. Stop onion-grater.

sudo service onion-grater stop

2. Disable autostart of onion-grater.

sudo systemctl mask onion-grater

3. Reboot.

4. Check if onion-grater is still running or disabled.

ps aux | grep onion-grater

If output similar to the following appears, then disabling did not work.

onion-g+   911  3.2  1.9  66444 20644 ?        Ss   12:21   0:00 /usr/bin/python3 -u /usr/lib/onion-grater --debug --listen-interface eth1

Deactivate whonixcheck onion-grater Running Test[edit]

1. Open file /etc/systemcheck.d/50_user.conf in an editor with root rights.

This box uses sudoedit for better security [archive]. This is an example and other tools can also achieve the same goal. If this example does not work for you or if you are not using Whonix ™, please refer to this link.

sudoedit /etc/systemcheck.d/50_user.conf

2. Add the following content.

whonixcheck_skip_functions+=" check_control_port_filter_running "

3. Save the file.

Whonix-Workstation ™[edit]

Deactivate whonixcheck Tor Bootstrap Test[edit]

Because it relies on onion-grater.

1. Open file /etc/systemcheck.d/50_user.conf in an editor with root rights.

This box uses sudoedit for better security [archive]. This is an example and other tools can also achieve the same goal. If this example does not work for you or if you are not using Whonix ™, please refer to this link.

sudoedit /etc/systemcheck.d/50_user.conf

2. Add the following content.

whonixcheck_skip_functions+=" check_tor_bootstrap "

3. Save the file.

Deactivate sdwdate Connectivity Test[edit]

Whonix-Workstation ™ only.

1. Open file /usr/lib/helper-scripts/te_pe_tb_check in an editor with root rights.

This box uses sudoedit for better security [archive]. This is an example and other tools can also achieve the same goal. If this example does not work for you or if you are not using Whonix ™, please refer to this link.

sudoedit /usr/lib/helper-scripts/te_pe_tb_check

2. Replace the existing content with the following text.

#!/bin/bash
exit 0

3. Save the file.

4. Restart sdwdate.

sudo systemctl restart sdwdate

The procedure is complete.

Be aware that this setting will not persist after any upgrade of sdwdate, nor is sdwdate currently configurable. [1]

Tor Browser Updater[edit]

In order to update Tor Browser using Tor Browser Updater by Whonix ™ developers while onion-grater is disabled, complete the following step. [2]

update-torbrowser --no-tor-con-check

Or create a file /etc/torbrowser.d/50_user.conf with the following content.

TB_NO_TOR_CON_CHECK="1"

Static VirtualBox IP[edit]

Instead of using DHCP to obtain the internal IP address for the Whonix-Workstation ™ eth0 NAT adapter, a static IP can be used instead. This might marginally improve security because the DHCP package can then be removed.

Open /etc/network/interfaces.d/30_non-qubes-whonix on GitHub [archive] and read the comments. Then, comment out DHCP and comment in Static VirtualBox IP.

Footnotes[edit]

  1. Any Whonix ™ users interested in further development should create a relevant ticket on Phabricator [archive].
  2. It is far simpler to update using Tor Browser's internal updater instead.


Fosshost is sponsors Kicksecure ™ stage server 100px
Fosshost About Advertisements

Search engines: YaCy | Qwant | ecosia | MetaGer | peekier | Whonix ™ Wiki


Follow: 1024px-Telegram 2019 Logo.svg.png Iconfinder Apple Mail 2697658.png Twitter.png Facebook.png Rss.png Reddit.jpg 200px-Mastodon Logotype (Simple).svg.png

Support: Discourse logo.png

Donate: Donate Bank Wire Paypal Bitcoin accepted here Monero accepted here Contribute

Whonix donate bitcoin.png Monero donate Whonix.png United Federation of Planets 1000px.png

Twitter-share-button.png Facebook-share-button.png Telegram-share.png link=mailto:?subject=Whonix-Gateway Security Hardening&body=./Whonix-Gateway_Security_Hardening link=https://reddit.com/submit?url=./Whonix-Gateway_Security_Hardening&title=Whonix-Gateway Security Hardening link=https://news.ycombinator.com/submitlink?u=./Whonix-Gateway_Security_Hardening&t=Whonix-Gateway Security Hardening link=https://mastodon.technology/share?message=Whonix-Gateway Security Hardening%20./Whonix-Gateway_Security_Hardening&t=Whonix-Gateway Security Hardening

Interested in becoming an author for the Whonix ™ News Blog or writing about anonymity, privacy and security? Please get in touch!

https link onion link Priority Support | Investors | Professional Support

Whonix | © ENCRYPTED SUPPORT LP | Heckert gnu.big.png Freedom Software / Osi standard logo 0.png Open Source (Why?)

The personal opinions of moderators or contributors to the Whonix ™ project do not represent the project as a whole.

By using our website, you acknowledge that you have read, understood and agreed to our Privacy Policy, Cookie Policy, Terms of Service, and E-Sign Consent.