Skip to main content

A simple CLI for cleaning automated access to hetzner firewalls

Project description

hetzner-fireaccess-cleaner

This CLI is to be used with clearing automated access to a Hetzner firewall

Getting started

pip install hetzner-fireaccess-cleaner

How does it work?

This script is made to be run by an automation, like crontab. It's looking for the string auto-expire-[] where we have a timestamp to when the listed rule should expire in UNIX time.

Example: auto-expire-[1647127315]

Remote access for USER - auto-expire-[1647127315]

It uses the default hcloud CLI config file. https://github.com/hetznercloud/cli

How you implement and use this is up to you.

Usage

hetzner-fireaccess-cleaner clean [FIREWALL NAME]

For more info about available flags, checkout out the help hetzner-fireaccess-cleaner -h.

Examples

Clean the firewall firewall-1

hetzner-fireaccess-cleaner clean firewall-1

Using a different context than the current active

hetzner-fireaccess-cleaner --context access-project clean remote-firewall

DEMO

$ hetzner-fireaccess-cleaner clean remote-firewall
No context provided, using default
Rule marked for removal: A rule which is expored auto-expire-[1647127315]
Removing rules
Finished

Contributions

Contributions are welcome.

Disclaimer

This has not yet been tested a lot and only on a small hetzner account, use with caution.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hetzner-fireaccess-cleaner-0.0.1.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page