About network traffic restrictions
By default, authorized users can access your enterprise's resources from any IP address. You can restrict access to your enterprise's private resources by configuring a list that allows or denies access from specific IP addresses. For example, you can allow access to the private resources exclusively from the IP address of your office network.
If the list allows an IP address, an authenticated user connecting to your enterprise from that address can access private resources. If the user's IP address is not allowed, that user cannot access private resources until they connect from an allowed address.
After you configure an IP allow list, the list determines whether users can access protected resources through the web UI, APIs, or Git, using any of the following authentication methods.
- Username and password, using GitHub authentication or SAML SSO
- Personal access token
- SSH key
The IP allow list applies to users with any role or access, including enterprise and organization owners, repository administrators, and external collaborators.
By default, Azure network security group (NSG) rules leave all inbound traffic open on ports 22, 80, 443, and 25. You can contact GitHub Support to configure access restrictions for GitHub AE.
For restrictions using Azure NSGs, contact GitHub Support with the IP addresses that should be allowed to access GitHub AE. Specify address ranges using the standard CIDR (Classless Inter-Domain Routing) format. GitHub Support will configure the appropriate firewall rules to restrict network access over HTTP, SSH, HTTPS, and SMTP. For more information, see "Contacting GitHub Support."
Enabling allowed IP addresses
After you create an IP allow list, you can enable allowed IP addresses. When you enable allowed IP addresses, GitHub immediately enforces any enabled entries in your IP allow list.
Before you enable your IP allow list, you can check whether your allow list will permit a connection from a particular IP address. For more information, see "Checking if an IP address is permitted."
-
In the top-right corner of GitHub AE, click your profile photo, then click Enterprise settings.
-
In the enterprise account sidebar, click Settings.
-
Under Settings, click Authentication security.
-
Under "IP allow list", select Enable IP allow list.
-
Click Save.
Adding an allowed IP address
You can create an IP allow list by adding entries that each contain an IP address or address range. After you finish adding entries, you can check whether a particular IP address would be allowed by any of the enabled entries in your list.
Before the list restricts access to your enterprise, you must also enable allowed IP addresses.
-
In the top-right corner of GitHub AE, click your profile photo, then click Enterprise settings.
-
In the enterprise account sidebar, click Settings.
-
Under Settings, click Authentication security.
-
At the bottom of the "IP allow list" section, in the "IP address or range in CIDR notation" field, type an IP address, or a range of addresses in CIDR notation.
-
Optionally, in the "Short description of IP address or range" field, enter a description of the allowed IP address or range.
-
Click Add.
-
Optionally, check if a particular IP address would be allowed by any of the enabled entries in your list. For more information, see "Checking if an IP address is permitted."
Allowing access by GitHub Apps
If you're using an allow list, you can also choose to automatically add to your allow list any IP addresses configured for GitHub Apps that are installed in your enterprise.
If you select Enable IP allow list configuration for installed GitHub Apps in your allow list settings, then IP addresses from installed GitHub Apps are added to your allow list. This happens irrespective of whether your allow list is currently enabled. If you install a GitHub App and then the creator of that application changes the addresses in its allow list, your allow list is automatically updated with those changes.
You can identify the IP addresses that have been automatically added from GitHub Apps by reviewing the description field. The description for these IP addresses is: "Managed by the NAME GitHub App." Unlike addresses you add manually, you cannot edit, delete, or disable IP addresses that are automatically added from GitHub Apps.
Note: The addresses in the IP allow list of a GitHub App only affect requests made by installations of the GitHub App. The automatic addition of a GitHub App's IP address to an organization's allow list does not allow access to a GitHub AE user who connects from that IP address.
For more information about how to create an allow list for a GitHub App you have created, see "Managing allowed IP addresses for a GitHub App."
To enable automatic addition of IP addresses for GitHub Apps:
-
In the top-right corner of GitHub AE, click your profile photo, then click Enterprise settings.
-
In the enterprise account sidebar, click Settings.
-
Under Settings, click Authentication security.
-
Under "IP allow list", select Enable IP allow list configuration for installed GitHub Apps.
Note: If you're using Enterprise Managed Users with OIDC, you can only allow access by GitHub Apps if you use GitHub for your IP allow list configuration.
-
Click Save.
Editing an allowed IP address
You can edit an entry in your IP allow list. If you edit an enabled entry, changes are enforced immediately.
After you finish editing entries, you can check whether your allow list will permit a connection from a particular IP address after you enable the list.
-
In the top-right corner of GitHub AE, click your profile photo, then click Enterprise settings.
-
In the enterprise account sidebar, click Settings.
-
Under Settings, click Authentication security.
-
Under "IP allow list", next to the entry you want to edit, click Edit.
-
In the "IP address" field, type an IP address, or range of addresses, in CIDR notation.
-
In the "Description" field, type a description of the allowed IP address or range.
-
Click Update.
-
Optionally, check if a particular IP address would be allowed by any of the enabled entries in your list. For more information, see "Checking if an IP address is permitted."
Checking if an IP address is permitted
You can check whether a particular IP address would be allowed by any of the enabled entries in your IP allow list, even if the list is not currently enabled.
-
In the top-right corner of GitHub AE, click your profile photo, then click Enterprise settings.
-
In the enterprise account sidebar, click Settings.
-
Under Settings, click Authentication security.
-
At the end of the "IP allow list" section, under "Check IP address", enter an IP address.
Deleting an allowed IP address
Note: Due to caching, adding or removing IP addresses can take a few minutes to fully take effect.
-
In the top-right corner of GitHub AE, click your profile photo, then click Enterprise settings.
-
In the enterprise account sidebar, click Settings.
-
Under Settings, click Authentication security.
-
Under "IP allow list", next to the entry you want to delete, click Delete.
-
To permanently delete the entry, click Yes, delete this IP allow list entry.
Using GitHub Actions with an IP allow list
To allow your self-hosted runners to communicate with GitHub, add the IP address or IP address range of your self-hosted runners to the IP allow list. For more information, see "Adding an allowed IP address."