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

# HashiCorp Vault

> Connect Vault to Iru Compliance with a client token and least-privilege policy for mounts, policies, and audit configuration evidence.

### About HashiCorp Vault

Iru reads **secrets engine mounts**, **auth method configuration**, **named policies**, **audit devices**, and related **sys/** metadata using the Vault HTTP API. Each request sends your **client token** in **`X-Vault-Token`**. Iru collects **configuration evidence** - not **secret plaintext** values.

Works with **Vault OSS**, **Enterprise** (namespaces may need extra setup), and **HCP Vault**.

### How It Works

```http theme={null}
X-Vault-Token: hvs.xxxxxxxx
```

Tokens come from any Vault **auth method** (Token, AppRole, LDAP, etc.). The wizard first stores **`vault_addr`** (for example `https://vault.example.com:8200`), then accepts the token.

| Detail             | Value                          |
| ------------------ | ------------------------------ |
| **Category**       | Secrets management             |
| **Authentication** | Client token (`X-Vault-Token`) |

Official references: [Auth concepts](https://developer.hashicorp.com/vault/docs/concepts/auth), [HTTP API](https://developer.hashicorp.com/vault/api-docs), [Policies](https://developer.hashicorp.com/vault/docs/concepts/policies), [AppRole](https://developer.hashicorp.com/vault/docs/auth/approle).

### Prerequisites

* A Vault cluster **reachable from Iru** (network / firewall / PrivateLink as applicable).
* Permission to create a **policy** and **token** (or AppRole) with read-only **`sys/`** access as in the example below.

### Example Read-Only Policy (HCL)

Save as a `.hcl` file and apply with **`vault policy write iru-compliance your-file.hcl`**.

```hcl lines theme={null}
path "sys/mounts" {
  capabilities = ["read", "list"]
}
path "sys/auth" {
  capabilities = ["read", "list"]
}
path "sys/policy" {
  capabilities = ["read", "list"]
}
path "sys/policies/acl/*" {
  capabilities = ["read", "list"]
}
path "sys/audit" {
  capabilities = ["read", "list"]
}
path "auth/token/lookup-self" {
  capabilities = ["read"]
}
```

### Connect HashiCorp Vault to Iru

#### Apply the policy and issue a token

<Steps>
  <Step title="Prepare a workstation with Vault CLI access">
    Use a jump host or admin workstation that can reach **`VAULT_ADDR`** over TLS and has the **Vault CLI** installed (`vault` binary).
  </Step>

  <Step title="Authenticate the CLI to Vault">
    Sign in with your org’s supported method (**`vault login`**, OIDC, etc.) so subsequent commands run with enough privilege to write policies and create tokens.
  </Step>

  <Step title="Write the policy file">
    Save the example policy from above as an `.hcl` file on that machine (for example `iru-compliance.hcl`).
  </Step>

  <Step title="Apply the policy in Vault">
    Run **`vault policy write iru-compliance`** with your policy file path.
  </Step>

  <Step title="Create a renewable token">
    Create a **renewable** token bound to that policy (for example **`vault token create -policy=iru-compliance -ttl=720h -renewable=true`**). Copy the **`hvs.`** token value.
  </Step>

  <Step title="Prefer AppRole for production">
    For production, prefer **AppRole** or another automated flow instead of long-lived static tokens.
  </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 HashiCorp Vault">
    Find **HashiCorp Vault** (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="Configure server variables">
    Enter **`vault_addr`** (for example `https://vault.example.com:8200`) and confirm server variables when prompted.
  </Step>

  <Step title="Paste the Vault token">
    Paste the token into the **`X-Vault-Token`** field when prompted.
  </Step>

  <Step title="Finish the connection">
    Click **Submit API Key**. 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 **HashiCorp Vault** 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="Server variables failed">
    Refresh the wizard by toggling the source; re-enter **`vault_addr`**.
  </Accordion>

  <Accordion title="403 permission denied">
    Attach **`iru-compliance`** policy to the token; check **Enterprise namespaces**.
  </Accordion>

  <Accordion title="Token expired">
    Issue a new token and update Iru; enable **renewal** or use AppRole rotation.
  </Accordion>

  <Accordion title="Connection refused">
    Hostname, port (**8200**), TLS, and outbound routes from Iru.
  </Accordion>

  <Accordion title="503 sealed">
    **Unseal** Vault before testing.
  </Accordion>
</AccordionGroup>

### Considerations

<CardGroup cols={2}>
  <Card title="Vault Enterprise namespaces may require paths or…" icon="circle-info">
    Vault **Enterprise** **namespaces** may require paths or settings beyond this baseline - coordinate with your Vault admins.
  </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>
