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

# GitHub Advanced Security

> Instructions to create a connection with GitHub for findings related to Code Scanning, Secrets Scanning and Dependabot Alerts

## Supported Data Models

* [Vulnerability Findings](/integrations/vulnerability-findings-v2)
  * type: `code`

* Resources
  * type: `repository`

## Create a Connection for GitHub Advanced Security

<Step>
  <Step title="Create a GitHub connection">
    1. With Leen API Key and Customer's Org ID, make an API request to create a new GitHub Connection.

    <Info>
      More information can be found on the [API Reference page.](/api-reference/provisioning/add-new-connection)
    </Info>

    <Accordion title="Example POST body and response">
      ```json theme={null}
        {
          "vendor": "GITHUB"
        }
      ```

      The response will look like this:

      ```json theme={null}
        {
            "id": "c54de187-df62-4e95-b10f-0ab53b095d9d",
            "vendor": "GITHUB",
            "refresh_interval_secs": 14400,
            "timeout_secs": 1800,
            "organization_id": "fbd8b095-3c39-4137-9478-c32308444202",
            "oauth2_authorize_url": "https://github.com/apps/.../installations/new?....."
        }
      ```
    </Accordion>
  </Step>
</Step>

## Onboarding GitHub Advanced Security

Follow the steps below to onboard your environment to our GitHub Advanced Security integration.

<Steps>
  <Step title="Granting permission to Leen app for GitHub">
    1. Open the `oauth2_authorize_url` from the connection creation step.

    2. Select the account/organization for which the github app needs to be installed for access to GitHub Advanced Security Alerts.

           <img src="https://mintcdn.com/leen/vQ2Rhs44KY1LGMJC/images/github/github_select_org.png?fit=max&auto=format&n=vQ2Rhs44KY1LGMJC&q=85&s=ce5eb5559ba6dba24b3017a81850a183" alt="GitHub-select-org" width="1586" height="952" data-path="images/github/github_select_org.png" />

    3. Select the repositories that need to be authorized for the access. (Selection possible for all repositories or specific ones as well.)

           <img src="https://mintcdn.com/leen/vQ2Rhs44KY1LGMJC/images/github/github_select_repos.png?fit=max&auto=format&n=vQ2Rhs44KY1LGMJC&q=85&s=6c883afbdd12e86eb71ce3b5c729a800" alt="GitHub-select-repos" width="1668" height="1494" data-path="images/github/github_select_repos.png" />

    4. Click `Install and Authorize` button to complete the GitHub app installation.

    5. The page will be redirected to Leen on a successful authorization.

           <img src="https://mintcdn.com/leen/vQ2Rhs44KY1LGMJC/images/github/successful_connection.png?fit=max&auto=format&n=vQ2Rhs44KY1LGMJC&q=85&s=b41f3af20e3554231873ae515296b4ff" alt="GitHub-auth-success" width="613" height="625" data-path="images/github/successful_connection.png" />
  </Step>
</Steps>
