kwangchin/GitHubHook — pull request #7 by ollierattue (2013-03-14 10:50:23+00:00)
Title: GitHub public IP whitelisting using latest IPs with CIDR notation support.

The existing code contains a whitelist which doesn't relate to GitHub's documentation at [https://help.github.com/articles/what-ip-addresses-does-github-use-that-i-should-whitelist] and [https://github.com/username/repo/settings/hooks].

IP addresses in GitHubHook library:

54.235.183.49, 54.235.183.23, 54.235.118.251, 54.235.120.57, 54.235.120.61, 54.235.120.62.

IP addresses in GitHub documentation:

207.97.227.253/32, 50.57.128.197/32, 108.171.174.178/32, 50.57.231.61/32, 204.232.175.64/27, 192.30.252.0/22.

GitHub now publishes it's 'Service Hook IP Addresses' in CIDR notation giving several ranges of IP addresses. For example 204.232.175.64/27 contains the address range 204.232.175.64 - 204.232.175.95 (use http://www.subnet-calculator.com/cidr.php for conversion). Rather than convert and include thousands of IP addresses in our whitelist I've added a IP in CIDR range matching function. The IP whitelist has been renamed and updated to include the current CIDRs publicised by GitHub.