Skip to content

Jairoy2426/Firewall_Simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Firewall Simulation

A small, menu-driven Python firewall simulator that lets you define allow/deny rules and test sample packets against them. The script logs each rule change and packet decision to firewall.log.

Features

  • Add and delete firewall rules interactively.
  • Evaluate packets from a JSON file against the configured rules.
  • Log rule changes and packet decisions for auditing.

Requirements

  • Python 3.8+ (standard library only)

Getting Started

  1. Clone the repository.
  2. Run the simulator:
    python firewall.py

Usage

When you run the script, you will see an interactive menu:

  1. Add Rule
  2. Delete Rule
  3. Show Rules
  4. Process Packets
  5. Exit

Adding a Rule

Provide the action (allow or deny), source/destination IPs (or * for wildcard), protocol (TCP or UDP), and destination port (number or *). The rule is appended to the in-memory rules list.

Deleting a Rule

Enter the numeric index shown in Show Rules to remove a rule.

Processing Packets

packets.json contains example packets. Option 4 processes them through the rules and prints whether each packet is allowed or denied. The same results are logged in firewall.log.

Project Files

  • firewall.py - Main simulation script.
  • packets.json - Sample packet data for processing.
  • firewall.log - Log output generated by the simulator.

Notes

  • Rules are stored in memory for the current session only. Restarting the script resets the rules to the defaults defined in firewall.py.

License

This project is licensed under the MIT License. See LICENSE.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages