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 doesn’t respond to either “ping” requests or connection attempts from a closed TCP or UDP network.
On your Mac, choose Apple menu > System Preferences, click Security & Privacy, then click Firewall.
If the lock at the bottom left is locked , click it to unlock the preference pane.
Click Firewall Options.
If the Firewall Options button is disabled, first click Turn On Firewall to turn on the firewall for your Mac. See Block connections to your Mac with a firewall.
Select “Enable stealth mode,” then click OK.