we have a Jenkins server running on an ec2 instance. The security groups are very restricted in this server, they only allow traffic from the company office, and the slave nodes. we want to setup github hooks, so everytime someone pushes code to github, jenkins will create a job. How can I add github to the security groups to the jenkin server, since github IP may always be changing?
Asked
Active
Viewed 1,103 times
1 Answers
2
You can retrieve a list of GitHub's IP addresses from the meta API endpoint. For more information, see "Meta" in the GitHub Developer documentation.
API Endpoint: https://api.github.com/meta
GitHub make changes to their IP addresses from time to time, and will keep this API up to date. They do not recommend white-listing by IP address, however if you use these IP ranges they strongly encourage regular monitoring of their API.
Please see the Official Documentation from GitHUB

imvikasmunjal
- 753
- 7
- 14
-
Hi! I also run into this api as an option, but since they recommend to not whitelisting by IPs, I am not sure if this is best practice, or if this is being done by big companies using AWS. Thank you though. – Simon Ernesto Cardenas Zarate Apr 08 '18 at 22:58
-
Yes they are saying not to whitelist IP address only, they are saying to whitelist whole IP range, incase their IP gets changed you don't have to worry if you have whitelisted whole IP range of GITHUB – imvikasmunjal Apr 09 '18 at 02:38