https://github.com/golevi/cfallow
Add your IP to the Cloudflare firewall allowed list for each account you can access.
https://github.com/golevi/cfallow
allow automate cli client cloudflare firewall
Last synced: 26 days ago
JSON representation
Add your IP to the Cloudflare firewall allowed list for each account you can access.
- Host: GitHub
- URL: https://github.com/golevi/cfallow
- Owner: golevi
- License: mit
- Created: 2020-11-30T16:00:16.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-09-01T16:51:29.000Z (over 4 years ago)
- Last Synced: 2024-06-20T14:26:34.017Z (over 1 year ago)
- Topics: allow, automate, cli, client, cloudflare, firewall
- Language: Go
- Homepage:
- Size: 33.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# cfallow
## Install
If you have Go installed on your computer:
```bash
go install github.com/golevi/cfallow
```
## Usage
You must authenticate with a Cloudflare API Token.
To use an API Token, set the `CF_ALLOW` environment variable:
```bash
export CF_ALLOW=Abc123Xyz
```
Example of how it works. It creates an md5 hash of your computer's hostname,
that is your rule hash. We then get your IP address. Next, it looks to see
which accounts you have access to and loops through them, removing your
previous entry and adding a new entry with your latest IP address.
```bash
Starting...
Rule hash 11111c15372208abfb4265ebe0123456
Your IP 260f:5c5:5555:fff:0000:0000:0000:ffff
=========================================================
Client 1 Account
Deleted rule 11112222333344445555666677778888
IP Added...
=========================================================
Client 2 Account
Deleted rule a1112222333344445555666677778888
IP Added...
=========================================================
Client 3 Account
Deleted rule b1112222333344445555666677778888
IP Added...
=========================================================
Client 4 Account
Deleted rule c1112222333344445555666677778888
IP Added...
=========================================================
Client 5 Account
Deleted rule d1112222333344445555666677778888
IP Added...
=========================================================
Client 6 Account
Deleted rule e1112222333344445555666677778888
IP Added...
=========================================================
Done!
```
## API token permissions
Your token will need the following tokens.
### All accounts
* Account Filter Lists:Read
* Account Firewall Access Rules:Edit
* DNS Firewall:Edit
* Account Settings:Read
### All zones
* Firewall Services:Edit
### All users
* User Details:Read