Denying all incoming traffic and allowing only the necessary ports

We will first ensure that the firewall is running. After this, we will apply some rules to enable some ports and disable others.

To ensure that the firewall is running, we need to first ensure that the profiles are enabled and second, the firewall service is enabled and running. We have already mentioned how to enable firewall profiles in the topic Chapter 4, Puppet Forge Modules for Windows in the Managing the registry section. The following screenshot shows the code from that section.

Denying all incoming traffic and allowing only the necessary ports

For the changes to take effect, we restart the firewall service. For this purpose, the firewall ...

Get Learning Puppet for Windows Server now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.