Firewall Manager is a Node.js application that allows users to add and remove firewall rules using the Uncomplicated Firewall (UFW) tool. It provides a simple API endpoint to add or remove firewall rules based on the provided IP address and email.
-
Clone the repository:
git clone <repository-url>
-
Navigate to the project directory:
cd firewall-manager
-
Install dependencies:
npm install
-
Start the application:
npm start
-
Make a POST request to the
/firewall
endpoint with the following JSON payload:{ "ip": "192.168.1.1", "email": "example@example.com" }
This will add or remove firewall rules as necessary.
Warning: Running this application can modify your firewall rules, potentially exposing your system to security risks if not used carefully. It is strongly recommended to limit access to this application either by firewall rules or by implementing authentication mechanisms.
To limit access to the Firewall Manager application:
- Use firewall rules to restrict incoming connections to the server hosting the application. Only allow connections from trusted IP addresses.
- Implement authentication mechanisms such as API keys or OAuth to authenticate users before allowing them to access the application.
Please note that the Firewall Manager application is hardcoded to manage access to ports 80 and 443 only.
Contributions are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or create a pull request.
This project is licensed under the MIT License.