Limiting Access to an AWS EIP in GitHub | by Teri Radichel | Cloud Security | Nov, 2022 | Tech Lance

Posted on


ACM.102 Be sure that solely approved IP addresses can entry your non-public GitHub repositories

It is a continuation of my sequence on automating cybersecurity metrics.

My final submit defined how one can prohibit SSH entry in your native community to approved IP addresses solely.

Particularly, we enable entry to an EC2 occasion that we create on a community that we deploy on AWS with CloudFormation. Networking in AWS restricts entry to a selected IP tackle for a person connecting to an EC2 occasion through SSH or RDP on the time of this writing. I may change that later. You possibly can learn all the pieces main up thus far right here.

Now we wish to safe our GitHub account and solely enable particular IP addresses to entry it. I am going to present you the way to do that, however notice that there’s additionally no approach to forestall your AWS account person from accessing another Github useful resource. It is a good answer for a single person or small enterprise, however bigger organizations will most likely wish to use a special setup for deployment pipelines, as I speak to shoppers on IANS Analysis consulting calls.

Defending CloudResources with GitHub IP Enable Lists

You possibly can add community restrictions to your GitHub account to assist shield the assets it comprises. I am not going to inform you that it is the solely factor it’s essential to do to guard your GitHub account as a result of there are methods round community restrictions in sure circumstances, however it should shield you from an attacker utilizing your stolen credentials to get into your account. — until additionally they have entry to your community.

You will have an Enterprise account.

GitHub shouldn’t be the one developer device or cloud product that has these sorts of restrictions. You are able to do the identical with GitLab:

I like to recommend that in case your improvement instruments do not enable this, you would possibly look elsewhere as a result of it is an important safety. Why community safety is essential has been lined in these weblog posts and others.

Add an IP restriction on GitHub

Let’s go to GitHub and grant the IP entry to our GitHub repositories.

Alright a quick hiatus to say that I discover the GitHub UI a bit convoluted and complicated when making an attempt to modify round from a person to a corporation and discovering all the best settings. I want they'd determine a approach to make this extra user-friendly and apparent. It is not tremendous tough however I typically discover myself looking round for issues greater than I do with different merchandise and I've used GitHub for ages.

Click on in your title within the prime left and you must see your title, adopted by your group. Click on in your group.

Click on View Group on the left.

Click on Settings (final on the best)

Click on Authentication Safety (which does not actually make sense to me)

Please notice this error message on the prime:

That warning is unclear. Does this imply you may not use IPv4 addresses? Or does it imply that you just can use IPv6 addresses? As a result of if you happen to can optionally use IPv6 then your IPv4 addresses ought to nonetheless work and there will likely be no “entry interruptions.” The host and server ought to fall again to IPv4 the place it's obtainable if correctly carried out. I hope this this documentation will likely be up to date accordingly, and in addition present the anticipated rollout date as nicely so folks can correctly put together for this transformation.I discussed earlier that I can't use IPv6 till compelled to do. I discussed that attackers are leveraging IPv6 misconfigurations and particularly after they cannot discover another method in. Nonetheless, if GitHub compelled use of solely IPv6 right here, then that may be the case to show off IPv4 and begin utilizing IPv6. Proper now it isn't clear that IPv4 shouldn't be obtainable they usually higher not lock folks out of utilizing IPv4 with out higher messaging than the above. The message must be rather more specific if that is what they're really going to do. One thing to regulate.

Additionally, I want the admin UI was organized the way in which this documentation is as a result of it is so good and is smart to me:

Return to the GitHub UI, scroll all the way down to IP Enable Record. Because the documentation says, you may have to allow it first with the checkbox on the prime.

Subsequent, add an IP utilizing the Add button on the backside:

In the meanwhile there appears to be a bug as a result of after I click on add I get this error message and I have never added an IP tackle but. However nonetheless enter your IP tackle and an outline if you want.

If you happen to’re simply coming into an IP tackle, you do not have so as to add /32 to the tip like we did in AWS. It seems like a single IP or CIDR will work right here.

One warning: Just be sure you have a number of IPs arrange in case you lose entry to 1, in any other case you wont’ be capable of entry your account.

Put it aside and go. You must now be capable of entry your GitHub repositories out of your EC2 occasion on AWS that you’ve given entry to, however no different cases on AWS or wherever else with completely different IP addresses will likely be allowed.

Utilizing your personal GitHub server for extra management

Only a notice that I typically suggest that if clients have a selection, they might wish to use their very own hosted GitHub server if they need extra management over safety and networking. In any case, Microsoft owns GitHub and if you happen to’re making an attempt to guard IP in your software program repositories, that may be a priority.

The opposite subject you might need is that you really want folks to make use of your company VPN so as to add further encryption to site visitors going to GitHub. There is no such thing as a approach to configure a VPN on GitHub. Though you may configure entry to assets behind a VPN from GitHub, you can not configure an IPSec tunnel between your location and GitHub. As talked about in earlier posts, the IPSec tunnel will encrypt extra layers of a packet than an SSL connection or VPN.

However since I am one particular person, this must work. I am not too pleased with the thought of ​​managing a GitHub server. Hopefully, GitHub is doing all the pieces proper on its half to guard this code, together with stopping insider entry to your code.

Within the subsequent submit, we’ll attempt to entry GitHub by way of our new firewall guidelines and restrictions.

Teri Radichel

If you happen to like this story please applaud Y proceed:

Medium: Teri Radichel or E mail Record: Teri Radichel
Twitter: @teriradichel or @2ndSightLab
Requests companies through LinkedIn: Teri Radichel or IANS Analysis

© second sight lab 2022

All posts on this sequence:

___________________________________________

Writer:

Cybersecurity for executives within the cloud period at Amazon

Do you want cloud safety coaching? 2nd Sight Lab Cloud Safety Coaching

Is your cloud safe? Rent 2nd Sight Lab for a penetration check or safety evaluation.

Do you’ve a query about cybersecurity or cloud safety? Ask Teri Radichel by scheduling a name with IANS Analysis.

Cybersecurity and Cloud Safety Assets by Teri Radichel: Cybersecurity and cloud safety courses, articles, white papers, displays, and podcasts

Limiting Access to an AWS EIP in GitHub | by Teri Radichel | Cloud Security | Nov, 2022