Mac OS X includes a pre-installed firewall application that you can use to block unwanted network connections that are attempting to establish a connection to your computer.
From the Apple menu, choose System Preferences to open the System Preferences window.
Locate and click Sharing.
From the Services tab, click Start or Stop to enable or disable the firewall application.