How To Install apf-firewall on Kali Linux

In this tutorial we learn how to install apf-firewall on Kali Linux. apf-firewall is easy iptables based firewall system

Introduction

In this tutorial we learn how to install apf-firewall on Kali Linux.

What is apf-firewall

apf-firewall is:

Advanced Policy Firewall (APF) is an iptables(netfilter) based firewall system designed around the essential needs of today’s Internet deployed servers and the unique needs of custom deployed Linux installations. The configuration of APF is designed to be very informative and present the user with an easy to follow process, from top to bottom of the configuration file. The management of APF on a day-to-day basis is conducted from the command line with the ‘apf’ command, which includes detailed usage information and all the features one would expect from a current and forward thinking firewall solution.

Summary of features:

  • detailed and well commented configuration file
  • granular inbound and outbound network filtering
  • user id based outbound network filtering
  • application based network filtering
  • trust based rule files with an optional advanced syntax
  • global trust system where rules can be downloaded from a central management server
  • reactive address blocking (RAB), next generation in-line intrusion prevention
  • debug mode provided for testing new features and configuration setups
  • fast load feature that allows for 1000+ rules to load in under 1 second
  • inbound and outbound network interfaces can be independently configured
  • global tcp/udp port & icmp type filtering with multiple methods of executing filters (drop, reject, prohibit)
  • configurable policies for each ip on the system with convenience variables to import settings
  • packet flow rate limiting that prevents abuse on the most widely abused protocol, icmp
  • prerouting and postrouting rules for optimal network performance
  • dshield.org block list support to ban networks exhibiting suspicious activity
  • spamhaus Don’t Route Or Peer List support to ban known “hijacked zombie” IP blocks
  • any number of additional interfaces may be configured as firewalled (untrusted) or trusted (not firewalled)
  • additional firewalled interfaces can have there own unique firewall policies applied
  • intelligent route verification to prevent embarrassing configuration errors
  • advanced packet sanity checks to make sure traffic coming and going meets the strictest of standards
  • filter attacks such as fragmented UDP, port zero floods, stuffed routing, arp poisoning and more
  • configurable type of service options to dictate the priority of different types of network traffic
  • intelligent default settings to meet every day server setups
  • dynamic configuration of your servers local DNS revolvers into the firewall
  • optional filtering of common p2p applications
  • optional filtering of private & reserved IP address space

There are three methods to install apf-firewall on Kali Linux. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install apf-firewall Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install apf-firewall using apt-get by running the following command:

sudo apt-get -y install apf-firewall

Install apf-firewall Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install apf-firewall using apt by running the following command:

sudo apt -y install apf-firewall

Install apf-firewall Using aptitude

If you want to follow this method, you might need to install aptitude on Kali Linux first since aptitude is usually not installed by default on Kali Linux. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install apf-firewall using aptitude by running the following command:

sudo aptitude -y install apf-firewall

How To Uninstall apf-firewall on Kali Linux

To uninstall only the apf-firewall package we can use the following command:

sudo apt-get remove apf-firewall

Uninstall apf-firewall And Its Dependencies

To uninstall apf-firewall and its dependencies that are no longer needed by Kali Linux, we can use the command below:

sudo apt-get -y autoremove apf-firewall

Remove apf-firewall Configurations and Data

To remove apf-firewall configuration and data from Kali Linux we can use the following command:

sudo apt-get -y purge apf-firewall

Remove apf-firewall configuration, data, and all of its dependencies

We can use the following command to remove apf-firewall configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge apf-firewall

Dependencies

apf-firewall have the following dependencies:

References

Summary

In this tutorial we learn how to install apf-firewall package on Kali Linux using different package management tools: apt, apt-get and aptitude.