Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Linux Firewall Automation and Traffic Monitoring

Project Overview

This project is a Linux firewall automation and traffic monitoring solution developed using Bash scripting and UFW (Uncomplicated Firewall).

The objective of this project is to secure Linux server traffic by:

  • allowing essential services,
  • blocking vulnerable ports,
  • monitoring firewall activity,
  • and analysing traffic logs.

The project demonstrates practical Linux administration, firewall configuration, traffic monitoring, and basic security hardening techniques.


Technologies Used

  • Bash Scripting
  • Kali Linux
  • UFW Firewall
  • Netcat
  • Nmap
  • Linux Kernel Logs

Features

  • Automated firewall configuration using Bash scripting
  • Blocking insecure and vulnerable ports
  • Allowing essential network services
  • Firewall traffic monitoring
  • Firewall log analysis
  • Netcat-based traffic simulation
  • Port scanning using Nmap

Firewall Rules Configured

Allowed Services

Port Service
22 SSH
80 HTTP
443 HTTPS
25 SMTP
53 DNS

Blocked Services

Port Reason
3389 RDP remote desktop access
445 SMB malware propagation risks
23 Insecure Telnet service
137 NetBIOS exposure risks
135 RPC vulnerabilities

Traffic Simulation using Netcat

Netcat was used to simulate connection attempts to blocked ports in order to verify whether the firewall rules were working correctly.

Example commands:

nc -zv localhost 3389
nc -zv localhost 135

Purpose of these commands

  • nc → Netcat networking utility
  • -z → Checks whether the port is open or blocked
  • -v → Displays detailed connection output
  • localhost → Refers to the local Linux machine

These simulated traffic attempts help generate firewall log entries for monitoring and analysis.


Monitoring Firewall Logs

Firewall activity was monitored using Linux kernel log files.

Example command:

grep UFW /var/log/kern.log | tail -n 5

This command displays the latest firewall-related log entries from the Linux kernel log file.


Project Structure

linux-firewall-automation/
│
├── logs/
│   └── firewall_logs.txt
│
├── screenshots/
│   ├── firewall_logs.png
│   ├── netcat_test.png
│   ├── nmap_scan.png
│   └── ufw_status.png
│
├── scripts/
│   └── fwconfig.sh
│
└── README.md

Sample Screenshots

Firewall Monitoring Logs

Screenshots are available inside the screenshots/ directory.


How to Run the Script

Make the script executable:

chmod +x scripts/fwconfig.sh

Run the script:

./scripts/fwconfig.sh

Learning Outcome

This project helped improve understanding of:

  • Linux firewall administration
  • Bash scripting
  • Traffic monitoring
  • Port security
  • Linux logging mechanisms
  • Basic security hardening concepts

About

No description or website provided.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages