How to configure firewall rules in Windows to block specific apps

Last update: 28/01/2026
Author Isaac
  • The firewall acts as a barrier between your computer and the Internet, filtering connections according to security rules and network profiles.
  • En Windows You can block or allow apps specifics by creating outbound rules, whitelists, and advanced port rules.
  • There are additional options such as third-party firewalls, security products like ESET, and the built-in macOS firewall.
  • Combining a well-configured firewall with antivirus software and best practices significantly strengthens the security of your devices.

Configure firewall rules in Windows

If you want to truly control your computer, one of the best strategies is to decide which applications can access the internet and which are completely blocked, including deciding whether to remove pre-installed apps . The Windows Firewall allows you to do this, but the interface isn't always intuitive, and it's easy to get lost among rules, network profiles, and advanced options.

In this comprehensive guide, we'll see, step by step, how to configure firewall rules in Windows to block specific apps, create whitelists, open and close ports , and also what alternatives you have if you prefer to use a third-party firewall or even solutions like those from ESET or the macOS firewall itself. The goal is for you to fully understand what you're changing to improve security without anything stopping working "for no reason."

What is a firewall and why would you want to block apps?

A firewall is a security filter that monitors all network traffic entering and leaving your computer . It analyzes data packets, checking their origin, destination, port, and application, and then, based on a set of rules, decides whether to allow or block the connection.

The typical comparison is that of a country's border: every "traveler" entering or leaving must pass through a checkpoint . If the guard sees something suspicious or the requirements aren't met, they deny entry. The same applies to a firewall: it can block connections from the internet to your PC (incoming traffic) or connections from programs on your computer to the outside (outgoing traffic).

Blocking applications with your firewall is useful for several reasons: you prevent unauthorized access, limit malware communication , block intrusive advertising , and can prevent certain programs from connecting to untrusted public Wi-Fi networks. This reduces your system's exposure to attacks and data leaks.

It's also a good way to control the behavior of "legitimate" programs that update themselves, connect to telemetry servers, or allow online features you don't want , such as online gaming for minors (for which you can set up Family Safety or adjust other restrictions), or cloud data synchronization without your explicit consent.

However, a balance must be struck: many services today rely on the internet to function. It's not about blocking everything, but rather allowing only what you need , cleaning up permissions and bloatware with OO-AppBuster , and being clear about what you're sacrificing when you block access to a particular app.

Private networks, public networks, and firewall profiles

The Windows Firewall uses network profiles to apply different security policies depending on the type of connection you're using: domain network, private network, or public network. This distinction is key to deciding where your rules apply.

A private network is typically your home network: a relatively trusted environment where the devices that can see each other are usually yours or your family's . In that context, it's reasonable to allow other computers to discover your PC to share files or printers.

A public network, on the other hand, is like the Wi-Fi in a bar, airport, or library. You're surrounded by devices belonging to strangers that you don't want having any visibility into your computer . In these cases, the firewall needs to be much stricter, minimizing the attack surface.

In Windows, the system itself asks you whether a network is public or private the first time you connect. Choosing the wrong option here can leave your computer more exposed than you'd like, so it's best to select private only for networks you truly trust.

How to view and configure the Windows Firewall from Windows Security

In modern versions of Windows, you can manage much of the firewall from the Windows Security app, in the "Firewall & network protection" section . This is where the status and basic options for each network profile are displayed.

To open it, simply search for "Windows Security" in the Start menu and click on "Firewall & network protection." You'll see what type of network you're currently using and whether the firewall is enabled or disabled for each profile (domain, private, and public).

Within each user profile, you can enable or disable Microsoft Defender Firewall, and also complement it with Controlled Folder Access in Windows 11 to protect sensitive folders. Disabling it leaves your computer much more vulnerable . If you do disable it, it should only be because another firewall (for example, one from a security suite) is already in place, never because it "causes fewer problems."

  Quickly configure Bluetooth in Windows 11

You'll also find the option " Block all incoming connections, including those from the allowed applications list ." This instructs the firewall to completely block any incoming connection, even those you've authorized. It's a very restrictive mode that may prevent many applications from working, but it provides an extra layer of security in hostile environments.

In addition, from this screen you have shortcuts to key functions: allowing apps through the firewall, opening the network troubleshooter, adjusting notifications, or accessing advanced settings where finer rules and logs are managed.

How to block a program's internet access in Windows 10 and 11

If you want to completely block internet access for a specific application , the most effective way is to create an outbound rule in the standard firewall ( Windows Defender Firewall with Advanced Security). Although the process is somewhat hidden, the wizard makes it relatively straightforward.

First, you need to open the advanced settings panel. You can go to Control Panel, enter " Windows Defender Firewall ," and from the left side click "Advanced settings," or you can search directly for "Windows Defender Firewall with Advanced Security" from the Start menu.

In the window that opens, you'll see " Inbound Rules " and " Outbound Rules " in the left column. The outbound rules are the ones you need to prevent a program from connecting to the internet, because they control communication from your computer to the outside world.

Select "Outbound Rules" and, in the right-hand column, click " New Rule… ". A wizard will launch, asking you what you want to restrict. Select "Program" to create a rule specific to an application and click "Next".

On the program selection screen, choose "This program path" and click "Browse." You need to locate the executable file (.exe) of the app you want to block . It's usually located in "C:\Program Files\AppName\app.exe" or "C:\Program Files (x86)\…" if it's a 32-bit application. If you're having trouble with unverified apps, see how to troubleshoot them.

Once you've selected the executable file, click "Next." In the action section, check " Block the connection " and proceed. This option will instruct the firewall to block all traffic from that program.

Next, select which network profiles the rule will apply to: Domain, Private, and Public . If you don't have a domain environment, it's best to leave Private and Public selected, or all three if you want the rule to apply in all cases. Click "Next."

Finally, give the rule a descriptive name (for example, "Block Exit - ProgramName") and, if you like, a brief description to remind you why you created it. Clear names make it much easier to undo changes later when you want to allow the connection again. Finish by clicking "Finish."

From that moment on, the rule will be active and the firewall will prevent the application from establishing outbound connections under the conditions you have defined. You can view and manage all rules from the same "Outbound Rules" panel.

Temporarily block an app in the Windows Firewall

The Windows firewall does not include an explicit " temporary block " option for a limited time for an app, but you can achieve the same effect by enabling or disabling the corresponding rule as needed.

To do this, go back to "Windows Defender Firewall with Advanced Security" and navigate to the " Outbound Rules " section. There you will see the complete list of created rules, including the one you configured to block that specific application.

Right-click on the rule and choose " Disable rule " if you want the app to regain internet access immediately. The firewall will stop enforcing that block, but will keep the rule in the list in case you need it later.

When you want to restrict its connection again, repeat the process and select " Activate rule ." This way, you can alternate between allowing and blocking without having to constantly delete or recreate rules , which is especially useful if you only need the app to connect occasionally to update or sync data.

Whitelists: allowing specific apps through the firewall

The opposite approach to blocking everything except one app is to create a whitelist of programs that are allowed to communicate . In Windows, this is primarily managed through the "Allow an app or feature to pass through Windows Defender Firewall" interface.

To get there, open the Control Panel, go to "Windows Defender Firewall," and click the link " Allow an app or feature through Windows Defender Firewall ." You'll see a list of apps and services with checkboxes associated with Private and Public network profiles.

  Is the latest Windows 11 update preventing you from signing in? Solutions and tips

Tap the " Change settings " button to edit the list. You may be prompted for administrator privileges. Once you have them, you can select or deselect the boxes for each app to control it on private and public networks.

If an app is on the list and you don't want it to connect to the internet, simply uncheck its name box (this will also disable the Private and Public boxes). If, on the other hand, you only want to allow it at home but not on public networks, leave "Private" checked and uncheck "Public".

When the app you're interested in isn't listed, tap " Allow another app... ". Although the name might suggest otherwise, this is how you add it to the list and then decide whether to block or allow it . Use "Browse" to locate its executable file, add it, and then adjust its Private/Public settings as needed.

Create advanced rules: open and close ports in the firewall

In addition to program-based rules, the Windows Firewall allows you to create rules that operate on ports and protocols . This is very useful when you want to control specific traffic (for example, only TCP 443, or a specific port for a game or server).

To access the wizard, open "Windows Defender Firewall with Advanced Security" and select whether you want to create an inbound rule (traffic coming from outside) or an outbound rule (traffic leaving your computer). Then, click " New rule… " in the right-hand column.

Instead of choosing "Program," select "Port" or "Custom" depending on the level of detail you need. The custom option lets you combine filters by program, ports, and IP addresses , so it's usually the most comprehensive when you want pinpoint control.

In the protocol and ports section, choose whether you will be working with TCP or UDP (the most common) and define the local and remote ports that will be affected. You can enter a specific number, a range, or several ports separated by commas.

The wizard will also ask you for the local and remote IP addresses to which the rule applies. This allows you to specify, for example, that only certain devices on your local network can connect to a particular service, or conversely, block connections from suspicious IPs.

Next, choose the action the rule will take: "Allow the connection," "Allow if secure" (with certain authentication requirements), or " Block the connection ." Define which network profiles it will apply to (domain, private, public) and finally give it a clear name that describes the scenario you've configured.

From that point on, all traffic attempting to pass through that port and under those conditions will have to conform to the newly created rule . If it doesn't fit, the firewall will block it to prevent risks or unauthorized use.

Other ways to cut off internet access in Windows

If you don't want to deal with detailed rules or just need a temporary global block, there are simpler alternatives. One very straightforward one is to activate Airplane Mode from the Windows Action Center, which disables all wireless interfaces on the system.

With Airplane Mode enabled, no applications installed on your device will be able to access the internet , as the network connection is cut off at the system level. When you want to reconnect, simply deselect the option and everything will return to normal.

Another option is to use a third-party firewall. There are free and paid applications that offer more user-friendly interfaces, rule wizards, and advanced features , such as the ability to prompt each time a program tries to connect, or predefined profiles for gaming, work, and other activities.

This type of tool might be of interest to you if you find the Windows firewall unintuitive or if you need features that the standard system doesn't provide, such as more detailed traffic statistics or more convenient rule management; for example, you can configure custom alerts with GlassWire.

Configure the firewall to ask every time an app connects.

Windows, by default, doesn't offer a mode where the firewall prompts you for each outgoing connection attempt from any program . Its philosophy is more about allowing normal connections, blocking suspicious ones, and leaving the finer details to the rules you create manually.

If you're looking for a " ask me every time something tries to access the internet " approach , the most practical solution is to install a third-party firewall that includes this interactive mode. Many add-on firewalls replace or overlay the Windows firewall and, by default, display a pop-up notification every time a new app tries to connect, allowing you to choose to allow or block access and save that decision as a rule.

Another, more extreme option is to configure the Windows firewall with a scheme where all outgoing traffic is blocked by default , and you only add permission rules for the apps you need. This is achieved by combining generic blocking rules with specific permission rules, but it requires considerably more work and care to avoid leaving essential services offline.

  Complete Open-Shell tutorial for Windows 10 and 11

Using third-party firewalls: an example with ESET

Many security suites include their own firewall that replaces or controls the Windows firewall . A common example is ESET in its products for Windows Home or Small Office, which incorporate a rule-configurable firewall.

In these products, the idea is similar: you open the main ESET program window and press the F5 key to access the advanced settings . Within "Network access protection" you will find the "Firewall" section and, there, an "Edit" button next to "Rules".

Clicking "Edit" will display a list of existing rules and an " Add " button. Click this button to create a new firewall rule, either to allow or block traffic from a specific app or certain types of connections.

In the rule creation wizard or form, you must enter a name, choose the action (allow or block), specify the affected application — usually by clicking the three-dot icon to find the executable — and then define the direction of communication (incoming, outgoing, or both).

Once you have filled in all the relevant fields, save the changes with "OK" and confirm with "Accept" in the remaining windows. From then on, the ESET firewall will apply that rule to any connection attempt that meets those conditions.

Firewall control in macOS for services and applications

If you also work with a Mac , you'll be interested to know that macOS includes its own firewall, which lets you decide which applications accept incoming connections . It's not as granular for outgoing connections as some third-party firewalls, but it does help limit the exposure of certain services.

To configure it, open the Apple menu in the top left corner and go to "System Settings" (or "System Preferences" in earlier versions). Depending on your macOS version, you'll need to go to " Network & Internet " or "Security & Privacy," where you'll find the "Firewall" section.

Activate the firewall by clicking " Turn on firewall ," and then click "Options" to access the list of applications and services. On this screen, you can add new apps using the + button , select them from the file system, and decide whether to allow or block their incoming connections.

Each application can be configured to "Allow incoming connections" or "Block incoming connections." Keep in mind that blocking a critical app can break some of its functionality or affect other programs that depend on it , so it's best to test carefully and understand exactly what you're changing.

Importance of maintaining security when using a firewall

Beyond technical curiosity, using a firewall correctly is a key part of your security strategy. A system without a firewall or restrictions is a much easier target for attacks from the internet, especially if it's not properly updated.

The risks don't come solely from downloading suspicious files; a simple visit to a compromised website or a misconfigured legitimate program can open the door to unwanted connections. Hence the importance of filtering what connects and how it connects, and of regularly reviewing the applications that have permission to pass through the firewall.

In addition to a firewall, it remains essential to have a good antivirus program and other security measures such as multi-factor authentication and a reliable password manager . Tools like these help protect credentials, credit cards, and other sensitive data , as well as alert you if any breaches related to your accounts are detected.

The combination of firewall, antivirus, up-to-date updates and good practices (not reusing passwords, being wary of strange links, using public Wi-Fi networks responsibly, etc.) drastically reduces the likelihood of experiencing intrusions or data loss when browsing or working online.

Taking all this into account, it's easy to see why it's worth taking a few minutes to learn how to manage the firewall in Windows, macOS, or your security solution: controlling what enters and leaves your computer is one of the best defenses you can have , and with the right rules, you can tailor that control exactly to your needs without sacrificing everyday convenience.

How to prevent exploits in Windows 11
Related articles:
How to prevent exploits in Windows 11 with Exploit Protection and hardening
Isaac

Isaac

Passionate writer about the world of bytes and technology in general. I love sharing my knowledge through writing, and that's what I'll do on this blog, show you all the most interesting things about gadgets, software, hardware, tech trends, and more. My goal is to help you navigate the digital world in a simple and entertaining way.