Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Add support for Cloudflare Access #684

Closed
Gamerou opened this issue Feb 12, 2024 · 8 comments · Fixed by #797
Closed

Feature Request: Add support for Cloudflare Access #684

Gamerou opened this issue Feb 12, 2024 · 8 comments · Fixed by #797
Labels
design? The next step is to reflect upon the information and come up with a good design enhancement New feature or request
Milestone

Comments

@Gamerou
Copy link

Gamerou commented Feb 12, 2024

I would love the option to whitelist my ip in a policy for an App in cloudflare Access. I have made a script to do that for me but it works not so well.

@favonia
Copy link
Owner

favonia commented Feb 12, 2024

@Gamerou Thank you. I'm super ignorant about the API for Cloudflare Access (even though I'm using it...). Is it possible to create a policy based on a list? If so, I will feel very motivated to resolve #646 and this one by implementing the mechanism to maintain a Cloudflare list.

@Gamerou
Copy link
Author

Gamerou commented Feb 25, 2024

@Gamerou Thank you. I'm super ignorant about the API for Cloudflare Access (even though I'm using it...). Is it possible to create a policy based on a list? If so, I will feel very motivated to resolve #646 and this one by implementing the mechanism to maintain a Cloudflare list.

Yes, I think that should work. Have a look here: https://github.com/Gamerou/cloudflare_access_ip_whitelist/blob/main/cloudflare_access_ip_whitelist_normal.sh This is how I solved it, but of course it would be much nicer if it were integrated

@favonia favonia added the enhancement New feature or request label Feb 28, 2024
@favonia favonia added design? The next step is to reflect upon the information and come up with a good design needs-information labels Mar 9, 2024
@favonia favonia added this to the near future milestone Mar 9, 2024
@favonia favonia modified the milestones: near future, 1.13.0 Jun 29, 2024
@favonia
Copy link
Owner

favonia commented Jul 3, 2024

Hi @Gamerou I'm working on Cloudflare lists (#646) and discovered that they only support IPv6 /64 ranges instead of individual IPv6 addresses. Would the limitation be an issue for you?

@Gamerou
Copy link
Author

Gamerou commented Jul 3, 2024

Hi @Gamerou I'm working on Cloudflare lists (#646) and discovered that they only support IPv6 /64 ranges instead of individual IPv6 addresses. Would the limitation be an issue for you?

No problem, and cool that you're working on it!

@favonia favonia mentioned this issue Jul 14, 2024
10 tasks
@favonia
Copy link
Owner

favonia commented Jul 14, 2024

@Gamerou Design question for you: if for whatever reasons you have DELETE_ON_STOP=1, do you want the list to be deleted when the program exists? (I don't know what would happen when a rule refers to a non-existent list.)

@favonia favonia modified the milestones: 1.13.0, 1.14.0 Jul 16, 2024
@Gamerou
Copy link
Author

Gamerou commented Jul 27, 2024

If DELETE_ON_STOP=1, it makes sense to delete the list when the program exits. However, you need to ensure that this won't cause issues with rules referring to the now non-existent list. Ideally, handle this by either:

Cleaning up dependent rules that reference the list before deleting it.
Logging a warning that references to the deleted list could cause issues.
This way, you avoid potential errors or unexpected behavior in the system.

@favonia
Copy link
Owner

favonia commented Jul 27, 2024

@Gamerou I actually did some tests already and Cloudflare would prevent the deletion if a rule is using the list. Is it okay not to delete the rule and just print out the error? (This is the current implementation in the PR #797.)

@Gamerou
Copy link
Author

Gamerou commented Jul 28, 2024

If Cloudflare prevents the deletion when a rule is using the list, it's reasonable not to delete the rule and just print out the error. This approach ensures that your program won't cause unexpected behavior by deleting lists that are still in use.

Given this, your current implementation in PR #797 sounds appropriate. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design? The next step is to reflect upon the information and come up with a good design enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants