View all Worklets

Linux - Configuration - Enable Firewall

This Bash-based Linux Worklet checks if the recommend OS firewall is installed and active. If not, it will install and activate it.

Worklet Details

Introduction to the Bash-Based Linux - Configuration - Enable Firewall Worklet

The Linux - Configuration - Enable Firewall Worklet is a bash-based script that helps ensure the recommended operating system firewall is installed and active on your Linux machine. For Ubuntu systems, this Worklet checks for ufw (Uncomplicated Firewall), while firewalld is checked for CentOS, Red Hat, SUSE and Debian systems. 

This Worklet will not only check if these firewall services are installed but also if they are running, ensuring that your Linux system is protected by its default firewall.

Why would you use the Linux - Configuration - Enable Firewall Worklet?

Linux firewalls play a critical role in securing servers and networks against unauthorized access. Using iptables or nftables as the backend, firewalls like ufw and firewalld allow administrators to define rules allowing or denying specific ports, IP addresses, and network interfaces. 

By enabling the recommended OS firewall on your Linux systems, you can control incoming and outgoing connections, ensuring that the internal network remains private while allowing necessary external access such as SSH access or HTTP web traffic.

Components of the Linux - Configuration - Enable Firewall Worklet

The Worklet contains two main components: an evaluation script that checks if the default firewall service is installed and running on your Linux machine; and a remediation script that installs or restarts the firewall service if required. 

Together, these components provide a comprehensive solution to ensure your system's default firewall is enabled and properly configured.

How does the Linux - Configuration-Enable Firewall Worklet work?

The evaluation script checks whether ufw or firewalld is installed depending on the distribution of the operating system. If it finds that either application is missing or not running, it marks the system for remediation. 

The remediation script then attempts to install or restart the appropriate firewall service based on the OS type – ufw for Ubuntu systems and firewalld for CentOS, Red Hat, SUSE, and Debian systems.

What is the expected outcome when you use the Linux - Configuration - Enable Firewall Worklet?

Upon successful execution of the Worklet, your Linux system's default firewall will be installed (if missing) and running, thereby providing a secure layer of protection against unauthorized access. This ensures that only certain incoming connections are allowed while outgoing connections remain unrestricted by default. 

This Worklet is designed to foster a more secure Linux environment with proper firewall rules in place, reducing potential vulnerabilities and risks associated with unsecured network interfaces.

View in app


What's a Worklet?

Consider Automox Worklets your easy button. Grab ready-to-go PowerShell and BASH code from our catalog to automate any scriptable task on your Windows, macOS, and Linux endpoints.

do more with worklets