News for hackers. Stuff that matters.
Re:Show HN: Send a GitHub webhook to a private URL by qrkourier on Wednesday September 21, 2022 @09:32AM (#32924909)
Did you find a way to auto-update your firewall from the dynamic allow list in the GitHub API?
Re:Show HN: Send a GitHub webhook to a private URL by scottydelta on Wednesday September 21, 2022 @09:51AM (#32925144)
Github rarely changes it's hooks IPs.

The current list has 4 IPv4 IP range and upon checking my server firewall(last updated 3 years ago), I can see I have the first 3 entries in there.

So in the last 3 years, Github has added 1 new IP range which is missing from my server but even then, no webhook call has ever failed to my CI server.

As a precaution I just updated my server firewall right now.

You could of course write a cron script to regularly check Github hooks IPs and update firewall if Github changes it's webhooks IPs.

Re:Show HN: Send a GitHub webhook to a private URL by qrkourier on Wednesday September 21, 2022 @11:14AM (#32926311)
Glad you got it updated before you missed an event! That's the worry that made me look for something flexible and software-defined that I could run in GitHub Actions.
Re:Show HN: Send a GitHub webhook to a private URL by Yeroc on Wednesday September 21, 2022 @11:30AM (#32926541)
The bigger worry would be if they removed some IP addresses from their list. Those IP addresses would be juicy targets for hackers to scoop up and attempt an attack knowing that people have whitelisted them and that they allow access to what is likely relatively poorly protected infrastructure.
Re:Show HN: Send a GitHub webhook to a private URL by scottydelta on Wednesday September 21, 2022 @11:29AM (#32926512)
from my previous comment:

> You could of course write a cron script to regularly check Github hooks IPs and update firewall if Github changes it's webhooks IPs.

This is way easier and simpler than any other solution. It will be a mere 6 line script.

Re:Show HN: Send a GitHub webhook to a private URL by Spivak on Wednesday September 21, 2022 @12:09PM (#32927227)
It's totally trivial in almost all setups. Here's Linux.

    ipset create ghwebhooks hash:net
    iptables -A INPUT -m set --match-set ghwebhooks src -m tcp --dport 443 -j ALLOW

    # in /etc/cron.daily
    ipset add ...
    ipset del ...
    ipset list ...
    ipset save >/etc/ipset.conf
Re:Show HN: Send a GitHub webhook to a private URL by corytheboyd on Wednesday September 21, 2022 @09:40AM (#32925005)
I was doing this with Cloudflare IPs, and iptables as the firewall. Pretty simple bash script scheduled with crontab worked just fine. Was doing this on a DD-WRT flashed netgear router. There's probably something similar that can be done here
Re:Show HN: Send a GitHub webhook to a private URL by linsomniac on Wednesday September 21, 2022 @05:57PM (#32932091)
I do something similar for AWS IPs in our iptables firewalls. I create an ipset for "aws", and then create rules that match that ipset. I then have a script that runs periodically and downloads the set of AWS IPs (AWS publishes that) and writes then runs the script that creates the ipset.