- App: You register one app for the GitHub Enterprise Server instance in your root namespace. Endor Labs always propagates the app to child namespaces, so every namespace can install it. The app is only a credential and holds no projects or findings.
- Installation: You create one installation for each GitHub organization. The installation lives in the namespace you create it in and records the organization name, the GitHub installation ID, and the scanners you enable.
- Project: Endor Labs creates a project for every repository in the organization, in the same namespace as the installation. Scans, findings, and SBOMs attach to the project, so they stay in that namespace too.
https://github.example.com with a root namespace of acme, each organization maps to a namespace named after it. The prodsec organization maps to acme.prodsec, which holds the installation and a project for every prodsec repository.
The app stays in acme and serves every child namespace. You can set policies, scan profiles, and notification settings once in acme and propagate them down, or set them per organization.
Create only one installation for each GitHub organization. Endor Labs scopes installations per namespace, so it accepts a second installation for the same organization in another namespace. Both installations then reconcile the same repositories, which duplicates projects, scans, and findings.
Before you begin
Ensure that the following prerequisites are complete:- An Endor Outpost deployment, or firewall rules that let Endor Labs reach your GitHub Enterprise Server instance. See Deploy Endor Labs GitHub Enterprise Server App to set this up.
- A GitHub App created in your GitHub Enterprise Server instance and registered in your Endor Labs root namespace.
- Owner permissions on every GitHub organization you plan to onboard.
- The app registered with Any account under Where can this GitHub App be installed?. An app restricted to a single account can’t be installed in your other organizations. See Deploy Endor Labs GitHub Enterprise Server App to check this setting.
- Administrative access in Endor Labs to create namespaces, installations, and authorization policies.
- An API key, if you plan to create installations with endorctl or the REST API. See API keys to create one.
- The
jqcommand, if you plan to run the script in Onboard from a list of organizations.
Create a namespace for each organization
Create one child namespace for every GitHub organization before you onboard it. Endor Labs generates the fully qualified name from the parent namespace and the name you supply, so a namespace namedprodsec under acme becomes acme.prodsec.
See Namespaces to create namespaces one at a time in the Endor Labs user interface.
To create them with the API, run the following command for each organization. See Onboard from a list of organizations to create them from a file.
Install the app in each GitHub organization
Install the app in GitHub Enterprise Server once for each organization, and record the installation ID that GitHub assigns.- In GitHub Enterprise Server, navigate to the organization that owns the app and select Settings > Developer settings > GitHub Apps.
- Select the app you created for Endor Labs.
- In GitHub Enterprise Server, go to Install App.
- Next to the organization you want to onboard, click Install.
- Choose whether Endor Labs scans all repositories or a selected subset.
- Review the permissions and click Install and Authorize.
- In the organization’s Application settings, click Configure next to the app.
-
Copy the installation ID from the end of the browser URL.
In the following example,
12345678is the installation ID andprodsecis the organization name. - Record the organization name with its installation ID.
- Repeat these steps for every organization.
Add the installation to the organization namespace
Add the installation in the namespace that represents the organization. The app is visible in that namespace because Endor Labs propagates it from the root namespace.- Switch to the child namespace, such as
acme.prodsec. - Select User menu > Integrations from the left sidebar.
- Click Manage next to GitHub Enterprise Server under Source Control Managers.
- Click Install App next to the app.
- In Name of the organization, enter the GitHub organization name.
- In GitHub App Installation ID, enter the installation ID you collected.
- On the Scanners tab, select the scanners to enable for this organization.
- Optional: On Pull Request Scans, set your pull request scanning preferences.
- Click Create.
Create installations in bulk
Use the Endor Labs API when the number of organizations makes the Endor Labs user interface impractical. The GitHub Enterprise Server flow accepts installations directly from an API call, so you can script the whole onboarding. First, get the UUID of the registered app from your root namespace.Installation fields
The following fields control a GitHub Enterprise Server installation.Onboard from a list of organizations
Keep anorganizations.csv file with one organization name and its installation ID on each line. Enter each organization name exactly as GitHub shows it, including capital letters. The file has no header row.
|| [[ -n "$org" ]] condition processes the last line even when the file has no trailing newline. If a create call fails, the script stops at that organization. Fix the row and run the script again. It skips organizations that already have an installation.
Control access for each namespace
Grant access per namespace with authorization policies. A policy names its target namespaces and can include their children, so each team sees only its own organizations while sharing one app.- Give platform administrators a policy on
acmethat propagates to children, so they see every organization. - Give each team a policy on its own namespace, such as
acme.prodsec. - Give someone who works across two organizations a policy on each namespace.
Verify the namespace mapping
List every GitHub Enterprise Server installation across your namespace tree and confirm that each organization is in the namespace you expect.Known limitations
Keep the following constraints in mind when you plan the mapping:- You can register only one app for each GitHub Enterprise Server instance in a tenant, and only in the root namespace.
- Decide which namespace owns each organization before you onboard. Installations are unique per namespace, so Endor Labs accepts a second installation for the same organization in another namespace and reconciles the organization twice.
- The organization name and the installation ID are fixed after creation. To change either one, delete the installation and create a new one.
- Moving an organization to a different namespace means deleting the installation and its projects, then creating the installation in the new namespace.
- The GitHub Enterprise Server App has the same limitations as the GitHub App for cloud. See Limitations to review them.
Next steps
- Manage GitHub Enterprise Server App on Endor Labs to update scanners or remove an installation.
- Configure a scan profile to control how Endor Labs scans each namespace.
- Namespaces to review the namespace tree you created.