How to block everything (all incoming and outgoing internet access) except those applications are in firewall white-list?

Is it possible to auto block all applications incoming/outgoing internet connection except for example Firefox with default windows firewall?

I would like to block everything, even including windows update and other software updates.
I would like to allow only one web browser like firefox, chrome or opera.
How can I set up a config like this in windows Firewall? I see for blocking application but seems you need to add one by one and it is a tedious task.

What I wish to achieve is a "whitelisting" - meaning that I set up 1 rule on a firewall that says "block everything" (deny all any/any, where
"deny" = don't let anything through,
"all" = all types of traffic,
"any/any" = any source, any destination).

Then, I set up the "white list" - meaning the list of good destinations that I want to allow.
A list of applications that I'd like to grant network access to them. Only application in this list will be able to communicate.
Notice that whitelisting is different than blacklisting, in that whitelisting blocks everything and then allows a few things later. With that definition in mind, everything is automatically blocked and cannot be used.

I'd like there should be an option or button to makes it possible for me to edit, add or delete application in this list manually.


I'm not an expert, So please try to give a detailed answer as I don't know anything about ports and some other expressions that I came across when googleing this.
Thanks,


Solution 1:

You do not need any 3rd party firewall software.

By default windows firewall functions as follows:

  • Inbound - Block all unless in the list (Whitelist)
  • Outbound - Allow all unless in the list (Blacklist)

You want to Block all Inbound and all Outbound connections by default.

You can do this using Windows built-in Firewall. The way to do this (though somewhat hidden away way) is to change the settings as follows in these 3 easy steps:
  1. Go to: Control Panel\System and Security\Windows Firewall

  2. There, right-click as shown in screen shot to get the properties:

    Firewall settings screenshot

  3. Change Outbound Connections to Block for each profile Now you can add only the programs you want to the list.

You can import/export rules by right clicking the same as in screenshot above and selecting Export Policy. It imports/exports the whole thing. So you can experiment, disabling rules and making your machine more secure. For example my settings are as follows (excluding my programs):

Inbound - there's not a single rule here!

Outbound - only "Core Networking - DNS (UDP-Out)" is enabled

If you're using OpenVPN you will also need to add two more Outbound rules:

Core Networking - Dynamic Host Configuration Protocol (DHCP-Out)
and a rule to allow openvpn.exe

Solution 2:

In an elevated shell window, do

Set all profiles to block inbound/outbound traffic:

netsh advfirewall set allprofiles firewallpolicy blockinbound,blockoutbound

Remove all rules:

netsh advfirewall firewall delete rule all

Allow basic outbound rules for ports 80,443,53,67,68

netsh advfirewall firewall add rule name="Core Networking (HTTP-Out)" dir=out action=allow protocol=TCP remoteport=80
netsh advfirewall firewall add rule name="Core Networking (HTTPS-Out)" dir=out action=allow protocol=TCP remoteport=443
netsh advfirewall firewall add rule name="Core Networking (DNS-Out)" dir=out action=allow protocol=UDP remoteport=53 program="%%systemroot%%\system32\svchost.exe" service="dnscache"
netsh advfirewall firewall add rule name="Core Networking (DHCP-Out)" dir=out action=allow protocol=UDP localport=68 remoteport=67 program="%%systemroot%%\system32\svchost.exe" service="dhcp"

And to reset firewall to default values

NETSH advfirewall reset

** All changes take effect immediately

Solution 3:

Another very useful, powerful and of course free here:

TinyWall
TinyWall takes a different approach from traditional Firewalls. It does not display popups that "urge users to allow". In fact, it will not notify you of any blocked action at all.
Instead of showing popups, TinyWall makes it easy to whitelist or unblock applications by different means.
For example, you can just initiate whitelisting by a hotkey, then click on a window that you want to allow. Or, you can select an application from the list of running processes.

Of course, the traditional way of selecting an executable also works. This approach avoids popups, but still keeps the firewall very easy to use.

Most importantly, with the no-popup approach, the user will only notice that a program has been denied internet access when he can't use it anymore.
Consequently, users will only unblock applications that they actually need and none more, which is optimal from a security standpoint.

Feature overview

  • Multiple and easy ways to whitelist programs
  • Automatic learning mode
  • Firewall tampering protection
  • Password lockdown of settings
  • Quick modes, like Normal protection, Allow outgoing, Block all, Allow all and Learning mode
  • Support for temporary/timed firewall rules
  • Port and domain blocklists
  • Hosts file protection
  • Option to always allow communication within LAN
  • Option to restrict an application to the LAN
  • Recognition of safe software and impostors
  • Full IPv6 support
  • List established and blocked connections
  • View open ports on your machine
  • 100% free and clean software. No fees, no ads, no paid upgrades.

You can see the Thiny wall white-list in below image: enter image description here

Solution 4:

Firewall App Blocker

Firewall App Blocker WhiteList Mode: It will block everything except on the white listed items, to activate it tick the “Enable WhiteList” box on the right bottom corner.
The whitelist mode denies access to all network interfaces, After enabling WhiteList Mode Drag and drop an Application/Applications on the “Firewall Application Blocker” interface to Allow it/them , It was the most wanted feature: Firewall App Blocker- White-list

Solution 5:

If you want to use Komodo Internet Security (KIS) or Comodo Free Firewall (CFF):
Comodo firewall Whitelists help you by including all the items below, and nothing else is allowed into the system:

  • Websites
  • Networks
  • People/devices
  • Software Applications

White List creation Instruction:
You should block everything except DNS and web browsers, for doing this go to the Advanced settings -> firewall settings and enable "Do NOT show popup alerts" and change the dropdown to Block Requests. This will block anything that doesn't have a rule created for it.

Now to create the rules for your applications.
1- Go to add > browse > file groups > all applicatoins > use ruleset blocked application.

2- Next add another rule and click Browse > Running Processes > select svchost.exe then Use a custom ruleset > add block IP In or out then add another rule to allow UDP out destination port 53.

3- To allow your browser go to Advanced settings -> firewall settings -> applications rules then add whatever browser you want to allow access,
Add a new rule and give it the allow Web Browser or Allowed Application ruleset.

4- For windows update, I'm not exactly sure which processes need access to the internet so maybe someone else can give us some insight.
I think the main exe is under C:\Windows\System32\wuauclt.exe but it also uses svchost.exe.

The process will be the same for adding any other application you want to allow access for.

Important: Firewalls work in a hierarchical structure, so from TOP to BOTTOM manner, therefore rules to allow, must always be added BEFORE (higher) than the Block ALL rule!!

You can see finally Comodo Firewall configuration below:

Finally Comodo Firewall configuration

For Import/Export and Manage Personal Configurations