> ## 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.

# Semgrep

> Connect Semgrep AppSec Platform to Iru Compliance with a Bearer API token that includes the Web API scope to collect findings, deployments, and policy evidence.

### About Semgrep

Iru calls Semgrep’s **Web API** for **findings**, **projects**, and **policies**. Tokens must include the **Web API** scope - **Agent/CI**-only tokens return **404**s on web endpoints. **Team** or **Enterprise** tier is typically required for API access.

### How It Works

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

| Detail             | Value                  |
| ------------------ | ---------------------- |
| **Category**       | Application security   |
| **Authentication** | Bearer (Web API scope) |

Official references: [Tokens](https://semgrep.dev/docs/deployment/tokens), [Web API scope](https://semgrep.dev/docs/kb/semgrep-appsec-platform/api-404-token-scope), [API reference](https://semgrep.dev/api/v1/docs/).

### Prerequisites

* **Admin** or **Owner** on the Semgrep org.

### Connect Semgrep to Iru

<Tabs>
  <Tab title="Semgrep">
    <Note>
      Complete this tab before you connect the source in Compliance.
    </Note>

    <Steps>
      <Step title="Sign in to Semgrep">
        Open the **Semgrep AppSec Platform** and sign in with an **Admin** or **Owner** for the organization Iru should read.
      </Step>

      <Step title="Open Settings">
        Select **Settings** (gear or profile menu, depending on Semgrep UI).
      </Step>

      <Step title="Open Tokens">
        Navigate to **Tokens**, then **API tokens** (wording may read **API Tokens** or **Personal access tokens**).
      </Step>

      <Step title="Create a token">
        Select **Create** (or **New token**). Enter a name such as **Iru Compliance**.
      </Step>

      <Step title="Enable Web API scope">
        Enable the **Web API** scope (required for this connector). Remove any write scopes your security team does not want for evidence-only use.
      </Step>

      <Step title="Save and copy the secret">
        **Save** the token, then copy the **secret** once. Semgrep shows it only at creation.
      </Step>
    </Steps>

    <Note>
      Continue on the [**Iru Compliance**](#iru-compliance) tab.
    </Note>
  </Tab>

  <Tab title="Iru Compliance">
    <Note>
      Finish the [**Semgrep**](#semgrep) tab first.
    </Note>

    <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 Semgrep">
        Find **Semgrep** (use **Category** or **Search by name or description**). On that card, turn on the **toggle**. A browser tab or window may open for the connector wizard.
      </Step>

      <Step title="Paste the API token">
        Paste the **Bearer** token when prompted.
      </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 **Semgrep** card is **Active**.
      </Step>
    </Steps>
  </Tab>
</Tabs>

### 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="404 on API">
    Recreate token with **Web API** scope.
  </Accordion>

  <Accordion title="No API features">
    Upgrade to a tier that includes API access.
  </Accordion>
</AccordionGroup>

### 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>
