Integrating Github.com allows Bridgecrew Cloud to:
- Include your Infrastructure-as-Code files in daily scans
- Scan changed resources in Infrastructure-as-Code files for every new build generated, (before it is merged to the main branch) and provide an actionable view of the results via GitHub checks - see Code Review.
- Display compliance badges for your repositories - see Code Repository Badges
- Open Pull Requests when you Remediate buildtime Incidents in your main branch - see Remediate.
Note on Scans
- Daily Scans - These scans analyze the entire contents of your Infrastructure-as-Code files in your main branch.
- Scans triggered by Infrastructure-as-Code files changes in other branches- These scans inspect only the resources changed in the latest build of the branch.
For details on integrating Bridgecrew with Github Enterprise Server, see here.
- From Integrations Catalogue, under Code Integrations, select GitHub .
- Configure your account by choosing a GitHub organization. A GitHub Settings page will open.
- Select Authorize Bridgecew.
- Select All Repositories or select specific repositories, then select Install & Authorize.
- Select the relevant repositories and select Next.
- When the message "New account successfully configured" appears, select Done.
Note: after the next GitHub scan, the scanned repository will appear in the Integrations grid; for further details, see here.
The image below shows an example of a Bridgecrew comment on a violation found in IaC resources modified in the PR that triggered the scan.
The comment includes violation details and a link to a documentation page that explains the related Policy.
If you choose to select individual repositories in step 4 above, it can become challenging to manage a large list of repositories in a microservices-based or similar dynamic environment. Unfortunately, this is a limitation on the GitHub UI and is not controllable by Bridgecrew.
However, you can perform the following steps to automatically add a repo. The steps below work for a personal repository, but the process is similar if you have GitHub administrator for your organization.
- In GitHub, go to installed apps and click "configure" for the "Bridgecrew" app.
- Note the installation ID in the URL:
- Go here and create a personal API access token. For simplicity, enable all scopes.
- Fetch the repo ID for a repository you want to add:
curl -u GITHUB_USERNAME:GITHUB_API_TOKEN -H "Accept: application/vnd.github.v3+json" https://api.github.com/users/GITHUB_USERNAME/repos | jq '. | select(.name == "REPO_NAME") | .id'
- Add the repo to the list of authorized apps:
curl -u GITHUB_USERNAME:GITHUB_API_TOKEN -H "Accept: application/vnd.github.v3+json" -X PUT https://api.github.com/user/installations/INSTALLATION_ID/repositories/REPO_ID
- If you go to the GitHub integrations page in Bridgecrew, you should see the new repository available to be selected. You can use the "Select all" button to select all the repos you authorized.
Updated 3 months ago