> ## Documentation Index
> Fetch the complete documentation index at: https://docs.iru.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GitHub

> Connect GitHub to Iru Compliance with a personal access token to collect repository inventory, branch protection, organization membership, and audit logs.

### About GitHub

The **GitHub** connector reads repository metadata, branch protection, team membership, organization settings, audit logs, and related security configuration from your **GitHub organization**. That data appears in Iru Compliance as artifacts you can map to actions and controls. The integration is **read-only**. Iru does not open pull requests, change settings, or modify repositories beyond what the GitHub API allows for the scopes you grant.

### How It Works

Iru calls the GitHub REST API using a **personal access token (PAT)** sent as a **Bearer** token:

```http theme={null}
Authorization: Bearer github_pat_XXXX
```

**Fine-grained PATs** (recommended) let you scope repositories and permissions narrowly. **Classic PATs** work but are broader and harder to least-privilege.

If your organization enforces **SAML SSO**, you must **authorize** the PAT for the organization after you create it, or API calls for org-level data will fail.

| Detail             | Value                                                                                                     |
| ------------------ | --------------------------------------------------------------------------------------------------------- |
| **Category**       | Developer tools / source control                                                                          |
| **Authentication** | Bearer token (fine-grained or classic PAT)                                                                |
| **GitHub plan**    | Compatible with GitHub Free, Team, or Enterprise (subject to GitHub’s own API and audit-log availability) |

Official references: [Managing personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens), [REST authentication](https://docs.github.com/en/rest/authentication/authenticating-to-the-rest-api), and [Rate limits](https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api).

### Prerequisites

* GitHub access as a member (or owner) of the organization you want Iru to read.
* **Owner** access on that organization if you need audit logs and org-wide security settings (depending on what your compliance program expects).
* A PAT with **read** permissions aligned to the tables below (fine-grained PAT shown).

**Minimum fine-grained PAT permissions (typical)**

| Area             | Permissions                                                         |
| ---------------- | ------------------------------------------------------------------- |
| **Repository**   | **Contents** (read), **Metadata** (read), **Administration** (read) |
| **Organization** | **Members** (read), **Administration** (read)                       |

Adjust upward only if your controls require additional read scopes.

### Connect GitHub to Iru

#### Create a fine-grained personal access token

<Steps>
  <Step title="Open Developer settings">
    Sign in to GitHub. Select your profile picture → **Settings** → **Developer settings** → **Personal access tokens** → **Fine-grained tokens**.
  </Step>

  <Step title="Create a new token">
    Select **Generate new token**.
  </Step>

  <Step title="Set name, expiration, and resource scope">
    Set a clear **name** (for example **Iru Compliance**) and an **expiration** (fine-grained PATs can run up to **366 days** - set a reminder to rotate early). Under **Resource owner**, choose your **organization** when you need organization-level data. Under **Repository access**, choose **All repositories** or only what compliance covers.
  </Step>

  <Step title="Set repository and organization permissions">
    Under **Permissions**, enable at least the repository and organization **read** permissions listed under **Prerequisites** above.
  </Step>

  <Step title="Generate and copy the token">
    Generate the token and copy it immediately. It is shown once.
  </Step>

  <Step title="Authorize for SAML SSO (if required)">
    If your org uses **SAML SSO**, open **Settings** → **Developer settings** → **Personal access tokens**, find the token, select **Configure SSO**, and **Authorize** it for your organization.
  </Step>
</Steps>

#### Complete the connector in Iru

<Steps>
  <Step title="Open Sources">
    In Iru Compliance, on the left navigation bar, expand **Compliance** and select **Sources**.

    <Frame>
      <img src="https://mintcdn.com/iru/7HsGH7lnQ8GpVmI0/assets/media/images/iru-navigation-compliance-sources.png?fit=max&auto=format&n=7HsGH7lnQ8GpVmI0&q=85&s=595982441fd777b333b3ecfea24adc24" alt="Left navigation: Compliance expanded, Sources selected" width="424" height="1056" data-path="assets/media/images/iru-navigation-compliance-sources.png" />
    </Frame>
  </Step>

  <Step title="Turn on GitHub">
    Find **GitHub** (use **Category** or **Search by name or description**). On that card, turn on the **toggle**. A new tab opens the connector wizard.
  </Step>

  <Step title="Paste the personal access token">
    When you see the bearer token step, paste your PAT into the **Token** field and submit.
  </Step>

  <Step title="Finish the connection">
    Click **Submit Bearer Token**. When the connection succeeds, the wizard shows **Connection Configured**.
  </Step>

  <Step title="Confirm the source is Active">
    Close the **Iru is requesting access to external services** browser tab, then return to **Compliance** → **Sources** and confirm the **GitHub** card is **Active**.
  </Step>
</Steps>

### Troubleshooting

<AccordionGroup>
  <Accordion title="Nothing opens when you turn the source on">
    Check **pop-up blocker** settings for the Iru site and try again.
  </Accordion>

  <Accordion title="401 Unauthorized">
    Confirm the PAT was copied in full, has not expired, and was not revoked.
  </Accordion>

  <Accordion title="Missing organization data">
    For org-wide reads, the PAT’s **resource owner** must be the organization - not only your personal account. Create a new PAT if needed.
  </Accordion>

  <Accordion title="SSO required">
    Authorize the PAT for SAML SSO (see **Create a fine-grained personal access token**).
  </Accordion>

  <Accordion title="Resource not accessible by PAT">
    Regenerate the PAT with the repository and organization permissions your controls require.
  </Accordion>

  <Accordion title="Rate limiting">
    Authenticated REST requests share GitHub’s rate limits (see GitHub’s docs). Iru batches work within those limits; sustained spikes can delay sync.
  </Accordion>
</AccordionGroup>

### Considerations

<CardGroup cols={2}>
  <Card title="Prefer fine-grained PATs with the smallest…" icon="circle-info">
    Prefer **fine-grained PATs** with the smallest repository set and read scopes that still satisfy your controls.
  </Card>

  <Card title="Rotate PATs before expiry and update the connector…" icon="shield">
    Rotate PATs before expiry and update the connector so evidence collection does not stall.
  </Card>

  <Card title="Iru reads metadata and configuration exposed by the…" icon="server">
    Iru reads metadata and configuration exposed by the APIs you allow - it does not bypass GitHub permissions your org enforces.
  </Card>
</CardGroup>

### Related Articles

<CardGroup cols={2}>
  <Card title="Sources Management" icon="plug" href="/en/compliance/sources-management">
    Browse and manage every Compliance source.
  </Card>

  <Card title="Getting Started With Compliance" icon="rocket" href="/en/compliance/getting-started-with-compliance">
    Frameworks, actions, and **Artifacts**.
  </Card>

  <Card title="Iru Overview" icon="layer-group" href="/en/iru/platform-overview/iru-overview">
    How Endpoint, Compliance, and Identity fit together.
  </Card>

  <Card title="Artifacts Management" icon="folder-open" href="/en/compliance/artifacts-management">
    Upload, review, and organize evidence from sources and actions.
  </Card>
</CardGroup>
