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

Initial implementation of IPv4 allow list in the webhook endpoint #4205

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

PerGon
Copy link
Contributor

@PerGon PerGon commented Oct 24, 2024

(OK... this is embarrassing... as I'm about to open the PR and write the description - most code already written - I found this one here 🤦 damn! I still think there is some value in the PR tho)

There have been requests before of having some sort of IP allowlist.

This PR implements something like that. It creates a lambda that will be used as an api gateway authorizer to validate if the client ID is part the configured allowed CIDR ranges. (it is, pretty much exactly what was suggested here)
Initially this will mostly be valid for self-hosted Github, but it can eventually be extended to load the IPs for Github cloud from wherever Github publishes them.

I'm creating as a draft PR as there's a couple of things missing (var descriptions), but I was keen on early feedback before taking the time to do those things 😅

So, for the maintainers: should I spend more time in making this PR "mergeable" so it can be available for more people? No hard feelings if not 😅 I can add the relevant capability just in our case like explained in the other PR.

@npalm
Copy link
Member

npalm commented Nov 1, 2024

Thx for taking the time to start the work on a allow list for incoming traffic. Indeed we had a previous PR, but we also have not always thte time to check PR. I know it is a pitty but a fact at the moment.

We also have refactored thw webhook module, which creates breaking changes in this PR. However we are open to support an IP allow list. I think we could consider several options.

  1. Refactor the webhook further and allow to bring your own API GA, with the API GW 1 IP filterlign can be implemented, it also allows to put the WAF in front of it.
  2. Add support for the API GW 1
  3. Use indeed the API autherozier, but this will be antother lambda to run.
  4. Implment logic in the lambda.

Lambda option

Adding support to the lambda is most likely the simplest approach. Adding the support straitgh away is OK to me. Would suggest to mark it eperimental, which allows us to replace it with one of the other options over time.

Some implementation directions / thoughts.

@stuartp44 stuartp44 changed the title Initial implementation of IPv4 allow list in the webhook endooint Initial implementation of IPv4 allow list in the webhook endpoint Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants