Hi guys. I will show how to deny all incoming connections for your security on mac os x. It's very simple because firewall that come by default provides this.
Go to System Preferences -> Security & Privacy
You can see Firewall section in the following screenshot.
Click lock button at the bottom left and enter superuser password to access firewall preferences. Then click Firewall Options.
You can see applications which allow incoming connections in the above screenshot.
After you choose "Block all incoming connections", firewall deny all incoming connections.