GithubHelp home page GithubHelp logo

tmpufw's Introduction

tmpufw

Temporarily apply ufw rules

Read more about the process and why there’s a Python and bash version: http://joshtronic.com/2013/10/28/temporary-ufw-rules-or-how-i-learned-to-stop-scripting-and-love-the-shell/

tmpufw.py

This script allows you to add rules to ufw (Uncomplicated Firewall) with a time to live. You can then run the script as a cronjob (with the --clean flag) to clean up (remove) the expired rules.

Arguments

-h, --help                       show the help message and exit
-s, --status                     show rule list with expirations
-c, --clean                      clean up expired rules
-r RULE, --rule RULE             rule to be added to `ufw`
-p POSITION, --position POSITION position to add the rule
-t TTL, --ttl TTL                time to live for the rule

Usage

./tmpufw.py --rule="deny from 1.2.3.4"
./tmpufw.py --clean

tmpufw.sh

A bash rewrite leveraging the at command.

Usage

./tmpufw.sh [rule]
./tmpufw.sh deny from 1.2.3.4

tmpufw's People

Contributors

joshtronic avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.