Applies ToSecurity Windows 10 Microsoft Defender

There are two ways to allow an app through Windows Defender Firewall. Both of them are risky:

  • Add an app to the list of allowed apps (less risky)

  • Open a port (more risky)

When you open a port in the Windows Firewall, you allow traffic into or out of your device. This makes your device less secure and might create opportunities for hackers or malware to use one of those openings to get to your files, or use your device to spread malware to other devices.

Generally, it's safer to add an app to the list of allowed apps than to open a port. A port stays open until you close it, but an allowed app opens the required ports only when needed.

To help reduce your security risk:

  • Only allow an app or open a port when you really need to, and follow the steps to remove apps from the list of allowed apps or close ports that you no longer need

  • Never allow an app that you don't recognize to communicate through the firewall

  1. In the Windows Security app on your Windows device, select Firewall & network protection or use the following shortcut:

    Firewall & network protection​​​​​​​

  2. Select Allow an app through firewall

  3. Select Change settings. You might be asked for an administrator password or to confirm your choice

  4. To add an app, select the check box next to the app, or select Allow another app and enter the path for the app

  5. To remove an app, clear the check box next to the app, and then select OK

  1. In the Windows Security app on your Windows device, select Firewall & network protection or use the following shortcut:

    Firewall & network protection​​​​​​​

  2. Select Advanced settings. You might be asked for an administrator password or to confirm your choice

  3. Select Inbound Rules

  4. To open a port, under Actions, select New Rule... and complete the instructions

  5. To close a port, select the rule you want to disable, and then under Actions, select Disable Rule

See also

Firewall and Network Protection in the Windows Security App

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.