Assume I have ip blocks for China, Russia, North Korea etc. How would I configure pf to allow those IP addresses to only access ports 80 and 443, and be denied access to other ports?
I have an instance of OS X Server 2.1.1 (aka Mountain Lion) running in a data center with a static ip address exposed to the internet. So there is no hardware firewalls etc to protect the server against malicious users.
Looking through the logs, I noticed numerous failed attempts from countries like China, Russia to services necessary for me to remotely manage the server. Further, I noticed that ports were unnecessarily open to the internet.
Since OS X 10.6 Snow Leopard Server, I used the Server Admin to manage the firewall (ipfw). This has been removed in OS X Server 2.1.1 (Mountain Lion). And to make matters more interesting, the Apple documentation states that ipfw is deprecated and to use pf instead. Having read the man page, I'm a tad lost how to configure pf.
Googling "pf firewall tutorial" reveals tutorials aimed for NetBSD, FreeBSD and OpenBSD. Further filtering on "OS X" in that query reveals tutorials for "OS X", but it seems the authors assume some prior knowledge.