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

# Aikido Security

> Prepare an Aikido workspace so Arch can read its code repositories and the issues Aikido found in them.

## Before you start

You need to be an admin of the Aikido workspace that scans your code repositories. Only a workspace admin can
create the REST API credential Arch signs in with.

## Setup steps

1. Sign in to Aikido and open Settings, then Integrations, then REST API. See
   [Authorization](https://apidocs.aikido.dev/reference/authorization).
2. Create a client ID and client secret on that page. See
   [Authorization](https://apidocs.aikido.dev/reference/authorization).
3. Give the credential the scopes basics:read, repositories:read and issues:read. Aikido's API reference
   describes each scope: see [Get workspace info](https://apidocs.aikido.dev/reference/getworkspaceinfo-1).
4. Copy the client ID and the client secret. You cannot see the client secret again after you leave the page.
5. Note the address you sign in to Aikido at. It tells you your workspace's region, which you choose under
   Fields.

## Fields

| Field | What to enter |
| - | - |
| Client ID | The client ID of the REST API credential, from Settings, then Integrations, then REST API, in Aikido. |
| Client Secret | The client secret of the same credential. Aikido shows it once, when you create the credential, so copy it then. |
| Region | Where your Aikido workspace lives. Choose Europe if you sign in at app.aikido.dev, US for app.us.aikido.dev, Australia for app.au.aikido.dev and Middle East for app.me.aikido.dev. Choose Detect automatically to let Arch find it. The region cannot change later. |

You do not enter an address. Arch sends the credential only to the Aikido host of the region you choose.

## Permissions

| Permission | What Arch reads with it |
| - | - |
| repositories:read | The workspace's code repositories: each one's name and default branch. |
| basics:read | The workspace's name and the code organization it links. The connection test reads it to name the workspace. |
| issues:read | The issues Aikido found in those repositories: leaked secrets, code flaws and vulnerable dependencies. |

Arch only reads with these scopes. You choose the scopes when you create the credential. If a credential lacks
one, create a new credential with all three scopes and enter its client ID and secret in Arch. See
[Authorization](https://apidocs.aikido.dev/reference/authorization).

## Sign-in

Arch signs in by exchanging the client ID and the client secret for an Aikido token at your region's host. On
Detect automatically, Arch asks Europe, the US, Australia and the Middle East in turn, and takes the first
region that issues a token. When the sign-in works, the connection test goes on to read the workspace, which
needs basics:read. The test does not list repositories, so a missing repositories:read or issues:read shows at
the first run.

If the sign-in fails, check that you copied the client ID and the client secret of the same credential, and
that the region matches the address you sign in to Aikido at. If the credential was deleted or its secret was
replaced, create a new one under Settings, then Integrations, then REST API, in Aikido.

## Test answers

A passing test shows "Connected to" with your workspace's name, the code organization it links when Aikido
names one, and the region.

| Message | What it means and what to do |
| - | - |
| These Aikido credentials are incomplete. | A field is empty. Enter the client ID, the client secret and the region. |
| Arch does not support this Aikido region. | The region is not one Arch offers. Pick one of the regions in the list. |
| Aikido answered the sign-in with a redirect, which Arch does not follow. | Aikido sent the sign-in to another address. Check the region you picked. If it is right, try again in a few minutes. |
| Aikido refused this client ID and secret. | Aikido did not accept the credential. Check the client ID, the client secret and the region. If the credential was deleted or its secret was replaced, create a new one. If your workspace moved to another region, create a new connection. |
| No Aikido region issued a token for these credentials. | On Detect automatically, no region accepted the credential. When every region refused it, check the client ID and the client secret. When a region did not answer, try again in a few minutes, or pick your workspace's region. |
| issued a token but did not answer the workspace read; no other region was tried. | On Detect automatically, the region that accepted the credential did not answer the next read. Try again in a few minutes. If it keeps failing, pick your workspace's region instead of Detect automatically. |
| This Aikido credential cannot read the workspace. It needs the basics:read scope. | The credential lacks basics:read. Create a credential with the scopes basics:read, repositories:read and issues:read, then enter its client ID and secret. |
| Aikido is temporarily unavailable. | Aikido is down or is rate-limiting the credential. Try again in a few minutes. |
| Aikido did not answer conclusively. | Arch could not reach Aikido or could not read its answer. Try again in a few minutes. |

When Arch knows the region, a refused credential's message names it. The message for a region that did not
answer the workspace read starts with that region's name. The message for no region names each region and
whether it refused or did not answer.

## Limits

* Arch brings in every code repository the workspace lists, with its name and default branch. It also brings in,
  as findings, the leaked secrets Aikido found (the rule that matched and where, never the secret's value), the
  code flaws that name a weakness class (CWE) and the vulnerable dependencies that name a CVE.
* Code flaws with no CWE, dependency issues with no CVE, issues on a repository the workspace does not list, and
  every other kind of Aikido issue, such as cloud, container or domain issues, are not brought in.
* Arch reads the data once a day by default. You can choose every 6 or 12 hours, or once a day.
* Each run reads the whole repository list and every issue, because Aikido cannot list only what changed.
* One connection reads one workspace, and one Aikido workspace connects to Arch once. A second connection to
  the same workspace is refused. Aikido allows 20 calls a minute for each workspace, which Arch shares with any other tool that calls the Aikido REST API.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.