GitHub¶
GitHub hosts Git repositories and organizations; one connector covers one organization.
- What DRACO uses: Organization and repository settings for posture scans, the audit log or webhook events, members and repositories.
- What for: Compliance and attack paths, detections and hunts on organization events, response in the organization.
Add it in Connectors > Add connector: pick GitHub, then choose what DRACO collects and what it may change. Add more later with Add a part on its connector page. See Connectors for how connectors, sign-in and tags work.
Parts¶
| Part | What DRACO uses | Access | Permissions |
|---|---|---|---|
| Posture | GitHub | read | Repository permissions (Read): Administration, Contents, Metadata, Dependabot alerts; organization permissions (Read): Administration, Members (fine-grained token or GitHub App). |
| Logs | GitHub audit log, GitHub webhooks | read | Audit log (GitHub Enterprise Cloud): organization Administration: Read (fine-grained token or GitHub App), or a classic token with read:audit_log, created by an organization owner. Webhook: admin:org_hook or an organization owner to add the webhook; DRACO keeps only the webhook secret. |
| Directory | GitHub audit log | read | Organization permission Members (read) and repository permission Metadata (read) on the token or GitHub App of the audit log (a classic token: read:org and repo). Two-factor status (optional): the token of an organization owner. |
| Response | Block user (GitHub organization), Create security issue (GitHub), Remove deploy key (GitHub), Remove member or collaborator (GitHub), Revoke personal access tokens (GitHub) | write | Block user (GitHub organization): classic token: admin:org; fine-grained token or GitHub App: organization Blocking users read and write Create security issue (GitHub): classic token: repo; fine-grained token or GitHub App: repository Issues read and write Remove deploy key (GitHub): classic token: repo; fine-grained token or GitHub App: repository Administration read and write Remove member or collaborator (GitHub): classic token: admin:org (organization) or repo (repository); fine-grained token or GitHub App: organization Members read and write, repository Administration read and write Revoke personal access tokens (GitHub): a GitHub App (provider or credential) with the organization Personal access tokens read and write permission; SSO authorizations: a token of an organization owner with admin:org |
Posture¶
DRACO scans an organization's settings and repositories. The recommended way in is the organization's own GitHub App: DRACO fills it in for you on GitHub, it is private to your organization, it only reads, and its private key stays on your DRACO server. It never expires and does not depend on one person's account.
Note
Scan scope. One connector covers one organization (or one user account). Scanning a user's repositories does not include the organization checks (two-factor requirement, base permissions and so on).
What you need¶
- A GitHub organization on any plan.
- An owner of that organization: only an owner can create and install an app for it.
- DRACO open in your browser. GitHub is opened in a second tab; keep the DRACO tab open.
Connect with the GitHub App (recommended)¶
- In DRACO open Connectors, click Add connector and pick GitHub.
- Enter the organization's login (as in
github.com/<login>) and an optional name, and click Next. - On Credentials choose Create the app on GitHub (under GitHub App (recommended)).
- Click Create the app on GitHub. A new tab opens on GitHub with the app DRACO filled in: its name (
DRACO <organization>and a short code), your DRACO address and the read-only permissions listed below. - Check that GitHub shows your organization as the owner, and click Create GitHub App for
. - GitHub returns to DRACO for a moment: DRACO keeps the app's private key, webhook secret and client secret in Settings > Credentials, encrypted. Then GitHub asks where to install the app.
- Choose All repositories (or Only select repositories to scan fewer) and click Install.
- A DRACO page says Done, go back to the DRACO tab. Close that tab.
- In the DRACO tab the wizard sees the app installed and goes on to Test connection by itself. Launch the first scan (Run now or On a schedule).
If the browser blocks the new tab, allow pop-ups for DRACO and click the button again. If you leave the wizard or reload the page on the way, open the connector again: the wizard finds the app and goes on where it was. If the organization asks owners to approve installations, the page says Waiting for an owner: the DRACO tab goes on once an owner installs the app.
What the app may read (all read-only)
| GitHub permission | Why DRACO asks for it |
|---|---|
| Organization: Administration | Organization settings checks and the organization audit log (GitHub Enterprise Cloud) |
| Organization: Members | Members, owners, teams and outside collaborators (checks, ID directory) and the member, membership, organization and team events |
| Repository: Administration | Branch protection, rulesets, repository Actions permissions and security settings, and the branch protection, ruleset and deploy key events |
| Repository: Contents | Files such as CODEOWNERS and SECURITY.md, workflow files for the Actions checks, the code IaC scans read, and the push and release events |
| Repository: Metadata | The list of repositories (GitHub always gives it) |
| Repository: Dependabot alerts | Dependabot checks and Dependabot alert events |
| Repository: Secret scanning alerts | Secret scanning alert events |
| Repository: Code scanning alerts | Code scanning alert events |
Events the app sends to DRACO: push, release, repository, member, membership, organization, team, branch protection rule, repository ruleset, deploy key, secret scanning alert, Dependabot alert and code scanning alert. They are kept when the connector's GitHub webhooks part is on (see Logs).
Warning
A DRACO reachable only through a VPN. GitHub sends the app's events to DRACO over the internet (HTTPS). A server that GitHub cannot reach gets no events until the addresses GitHub sends webhooks from (the hooks list of api.github.com/meta) may reach DRACO's ingest path /api/v1/xdr/ingest/github-app/. Scans, the audit log and the directory work without that, because DRACO calls GitHub itself.
What a GitHub App does not see: the two-factor status of members (GitHub shows it to organization owners only). For that flag use a fine-grained token of an owner instead.
Other ways to sign in¶
On Credentials you can also choose:
- I already have a GitHub App: paste the App ID and the private key (
.pemfile) of an app your organization made, with the permissions above. See How to create a GitHub App. - Personal Access Token (fine-grained): a token of an organization owner with the read permissions in GitHub authentication. It expires on the date you pick.
- OAuth App Token: last resort, its scopes reach far more than reading.
Two GitHub organizations are two connectors. Each can get its own app with Create the app on GitHub (that app is private to its organization), or all of them can share one app:
- Create one GitHub App by hand and set Where can this GitHub App be installed? to Any account (see How to create a GitHub App).
- Install it on every organization DRACO should read.
- In each organization's connector choose I already have a GitHub App and paste the same App ID and private key. DRACO finds the app's installation on that organization by itself.
Typing an organization that a connector already has says it is already connected as … instead.
After the first scan¶
- Review the findings on the Findings page.
- Change the provider's scan schedule.
- Get notifications for critical findings.
After Launch Scan the wizard goes on with Collectors (tick Logs for the audit log and the webhook events, or Directory) and Responders (tick Response if DRACO may act in the organization). Tick nothing more to keep scans only; anything else can be added later with Add a part on the connector page.
IaC scans of the same organization¶
An Infrastructure as Code connector of https://github.com/<organization> can sign in with the same app: on its Credentials step click Use the GitHub App of
Checked¶
Logs¶
Two data sources: the GitHub audit log (membership, teams, repository visibility, branch protection, tokens and apps; needs GitHub Enterprise Cloud, other plans answer 404) and the GitHub webhook (push, member, repository, team, pull request, release, branch protection, secret and code scanning and Dependabot alert events; any plan).
- Audit log (Enterprise Cloud): nothing more with the DRACO GitHub App (it has organization Administration read). With a token: the provider's token when an organization owner created it with organization Administration read, or a classic token with
read:audit_logsaved as atokencredential. - Webhook with the DRACO GitHub App: tick GitHub webhooks and save. Nothing to do in GitHub: the app already sends its events to DRACO, and the source keeps those of its organization. Each delivery is checked with the app's webhook secret.
-
Webhook without the app: create the source (the wizard creates the secret), then Organization Settings > Webhooks > Add webhook with the payload URL
<endpoint>/github/<source id>, content typeapplication/jsonand the secret, or run thegh apicommand of the source page. -
For data residency set the audit log's API URL
https://api.<subdomain>.ghe.com. - Each webhook delivery is accepted only when its
X-Hub-Signature-256matches the secret. - A push carries the paths it added or changed (
x_github_files); the built-in rule GitHub: a .env file committed (off by default) alerts when one of them is a.envfile, templates such as.env.exampleleft out. - GitHub must reach DRACO over HTTPS for webhooks; see the VPN note under Posture.
Directory¶
Pulls the vendor's directory into the ID directory (readable names for alerts, incidents and investigations) and the assets: organization members (owners, two-factor status), outside collaborators and repositories. It signs in with the sign-in of the logs part, so turn logs on first, then turn on Directory on the connection (or tick Pull the directory in the log source's settings) and run Test: the Directory row reads one page of each part and names a missing permission.
Permissions (read), on the token or GitHub App of the audit log:
- fine-grained token or GitHub App: the organization permission Members (read) and the repository permission Metadata (read), on all repositories;
- classic token:
read:organdrepo(repo also grants write: prefer a fine-grained token).
GitHub shows the two-factor status of members to organization owners only: with another token the MFA flag stays empty.
DRACO reads the directory every hour (only what changed, where the vendor's API allows it) and in full once a day. Names and asset facts the vendor no longer lists are removed after the ID retention period. When the pull fails three times in a row, the connection shows the error and a connector health problem is opened.
Response¶
Runs response actions on the GitHub organization from incidents and workflows: Block user (GitHub organization), Create security issue (GitHub), Remove deploy key (GitHub), Remove member or collaborator (GitHub) and Revoke personal access tokens (GitHub).
Setup: Response actions.
If you turn on several parts¶
When you connect GitHub once and tick several parts, the wizard shows one guide for all of them: what to check first, the access to create once, one list of permissions that names the part each one is for, the extra steps of each part, and one test that checks every part on its own. Turning a part on later shows only what it adds.
Posture, the organization audit log, the directory, the webhook events and IaC scans of the organization all use the one GitHub App DRACO creates (the audit log needs GitHub Enterprise Cloud). With a token instead, posture and the audit log share it when an organization owner created it with organization Administration: Read. The webhook needs only its secret, which DRACO makes and shows once after you save. Response actions need write permissions: give them to a separate token or app pasted at the Write access step.
Any part can be skipped (Skip for now) and finished later: the connection is saved with what is done, and its page lists what is not set up yet with a Set up button that opens the wizard at that step.