Command: firewall

Manage the macOS Application Firewall.

Usage

Usage: m firewall [OPTONS]

Description: Manage the macOS ApplicationFirewall

Options:
  --help                        Show this help message
  --status                      Show the current status of the firewall
  --enable                      Enable the firewall
  --disable                     Disable the firewall
  --list                        List applications handled by the firewall
  --add PATH_TO_APP             Add an application to the firewall
  --remove PATH_TO_APP          Remove an application from the firewall
  --blockall <enable|disable>   Block all connections (State 2)

Note: Most of these commands require sudo privileges.

Options

--status

Displays whether the firewall is currently enabled or disabled.

Example:

m firewall --status

--enable / --disable

Turns the application firewall on or off.

Example:

sudo m firewall --enable

--list

Lists all applications that have rules configured in the firewall.

Example:

m firewall --list

--add PATH_TO_APP

Adds a new rule to the firewall to allow connections for a specific application.

Example:

sudo m firewall --add /Applications/Safari.app

--remove PATH_TO_APP

Removes an application's rule from the firewall.

Example:

sudo m firewall --remove /Applications/Safari.app

--blockall <enable|disable>

Configures the firewall to block all incoming connections, except for essential system services.

Example:

sudo m firewall --blockall enable