GitHub Action
IP whitelist on HetznerFW
v2
Latest version
Author: Adnan Al Jawabra
This GitHub Action automates the process of whitelisting an IP address on Hetzner Firewall before SSH deployment. It allows you to specify the firewall name, direction of traffic (inbound or outbound), protocol (e.g., TCP, UDP), and port range for traffic. This action helps streamline the deployment process by ensuring that only trusted IP addresses have access to your Hetzner server.
- Description: API key of Hetzner.
- Required: Yes.
- Description: IP address to whitelist.
- Required: Yes.
- Description: The name of the targeted firewall.
- Required: Yes.
- Description: Description of the Rule.
- Required: No.
- Default: A new rule using GitHub Action.
- Description: Direction could be inbound (in) or outbound (out).
- Required: Yes.
- Default: in.
- Description: Type of traffic to allow (Allowed: tcp, udp, icmp, esp, gre).
- Required: Yes.
- Default: tcp.
- Description: Port or port range to which traffic will be allowed. Only applicable for protocols TCP and UDP. A port range can be specified by separating two ports with a dash, e.g., 1024-5000.
- Required: No.
- Default: 80.
- Description: remove all added rules
- Required: false
- Default: 'true
name: Whitelist IP on Hetzner firewall
on:
push:
branches:
- main
jobs:
whitelist_ip:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Whitelist IP on Hetzner firewall
uses: adnanjaw/ip-whitelist-on-hetznerfw@v1
with:
hetzner_api_key: ${{ secrets.HETZNER_API_KEY }}
ip_address: 192.168.1.1 # Runner ip address
firewall_name: my-firewall
direction: in
protocol: tcp
cleanup: false
This action runs using Docker.
This GitHub Action is licensed under the MIT License.