Use stealth mode to keep your Mac more secure
If you’re concerned about security, you can use “stealth mode” to make it more difficult for hackers and malware to find your Mac. When stealth mode is turned on, your Mac does not respond to “ping” requests and does not answer connection attempts from a closed TCP or UDP network.
On your Mac, choose Apple menu > System Preferences, click Security & Privacy, then click Firewall.
Click the lock icon to unlock it, then enter an administrator name and password.
Click Firewall Options.
If the Firewall Options button is disabled, first click Turn On Firewall to turn on the firewall for your Mac. See Use a firewall to prevent unwanted connections.
Select “Enable Stealth Mode.”