Blog | G5 Cyber Security

PCI Compliant Firewalls on Linux

TL;DR

Yes, several firewalls can be installed on Linux systems to help meet PCI compliance requirements without needing a dedicated ISO. This guide focuses on popular options like iptables/nftables (built-in), and commercial solutions such as pfSense and Sophos Firewall which have Linux versions. We’ll cover setup basics, configuration considerations for PCI DSS, and essential logging.

1. Understanding the Requirements

PCI compliance isn’t about a specific firewall *product*. It’s about meeting security standards. Firewalls are one component. Key requirements include:

2. Using Built-in Linux Firewalls: iptables/nftables

Most Linux distributions come with iptables or its newer successor, nftables. These are powerful but require manual configuration.

  1. Check Current Status: See if a firewall is already running.
    sudo systemctl status iptables

    or

    sudo systemctl status nftables
  2. Install (if needed): If not installed, use your distribution’s package manager. For example, on Debian/Ubuntu:
    sudo apt update && sudo apt install iptables

    or for nftables:

    sudo apt install nftables
  3. Basic Rule Example (iptables): Allow SSH and HTTP traffic, drop everything else.
    sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT
    sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT
    sudo iptables -A INPUT -j DROP
  4. Basic Rule Example (nftables): Similar functionality using nftables syntax.
    nft add rule inet filter input tcp dport 22 accept
    nft add rule inet filter input tcp dport 80 accept
    nft add rule inet filter input drop
  5. Save Rules: Important! Otherwise, rules will be lost on reboot.
    • iptables: Use iptables-save > /etc/iptables/rules.v4 (and similar for IPv6). Your distribution might have a specific service to handle this automatically.
    • nftables: Use nft list ruleset > /etc/nftables.conf and ensure the nftables service is enabled.

Important Note: Managing iptables or nftables directly can be complex. Consider using a front-end tool like UFW (Uncomplicated Firewall) for easier rule management.

3. Commercial Firewalls with Linux Versions

These offer more user-friendly interfaces and often include advanced features, but come at a cost.

4. PCI DSS Configuration Considerations

5. Logging

Comprehensive logging is crucial.

Exit mobile version