> For the complete documentation index, see [llms.txt](https://help.aikido.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.aikido.dev/docs/docs-ja/kdosukyan/connect-your-source-code/connect-gitlab-self-managed-server-to-aikido.md).

# GitLab Self-Managed Serverを接続する

Aikidoでは、セルフマネージドのGitLabインスタンスを接続して、コードをスキャンし保護できます。以下の手順に従って、GitLabサーバーをAikidoに接続してください。

### 始める前に

* GitLabがファイアウォールの内側にある場合は、 [AikidoのIPアドレスを許可リストに追加してください](/docs/docs-ja/kdosukyan/miscellaneous/allowing-ip-addresses-for-code-container-scanning.md) そうすればAikidoからアクセスできます。
* この設定を行う人は、GitLabインスタンスにアクセスできる必要があります **および** 接続したいGitLabグループにもアクセスできる必要があります。

{% hint style="warning" %}
Aikidoのワークスペースは常に1つのGitLabグループに対応します。

Aikidoを、すべてのサブグループを含むトップレベル（ルート）グループに接続することをおすすめします。ルートグループがない場合は、GitLabグループごとに1つのワークスペースを作成してください。最初のワークスペースを作成した後、左上のドロップダウンから「Add another workspace」を選択して行えます。
{% endhint %}

## 設定

{% stepper %}
{% step %}
**Aikidoアカウントを作成**

GitLabサーバーを接続するには、まずGoogleまたはMicrosoftを使ってAikidoにサインアップするかログインしてください。 [サインアップ画面](https://app.aikido.dev/login)、次をクリックします： **Google / Microsoft**.
{% endstep %}

{% step %}
**GitLabのセットアップを開始**

認証が完了したら、新しいワークスペースを作成するには **Self-Managed** GitLabセクションで。

<figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2F4sTOuIM7t0NfOb9gOXdV%2Fimage.png?alt=media&amp;token=2aa626e3-014b-4715-a62c-6b156edc85b4" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**GitLabの詳細を入力**

ワークスペースを作成するには、Aikidoが接続できるように、セルフマネージドのGitLabインスタンスに関するいくつかの情報を入力してください。

{% hint style="info" %}
GitLabがファイアウォールの内側で動作している場合は、 [AikidoのIPアドレスを許可リストに追加してください](/docs/docs-ja/kdosukyan/miscellaneous/allowing-ip-addresses-for-code-container-scanning.md) それにアクセスできるようにしてください。もしそれができない場合は、 [Brokerのセットアップガイド](/docs/docs-ja/kdosukyan/connect-your-source-code/connect-gitlab-self-managed-server-to-aikido/connect-gitlab-self-managed-server-broker-set-up.md).
{% endhint %}

最初の入力欄にGitLabサーバーのURLを入力してください。

<figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2FuTgmEBzm7bnWEBGJkK9S%2Fimage.png?alt=media&amp;token=d2a25d08-2777-47d4-bb3c-b41d540a56c6" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**GitLabの個人アクセストークン（PAT）を作成**

次に、個人アクセストークン（PAT）を作成してください。専用のサービスアカウントを使用することをおすすめします。

* GitLab サーバーにログインしてください
* 管理エリアに移動し（`/admin`)
* 次へ移動してください: **設定** → **サービスアカウント**
* クリック： **サービスアカウントを追加**、名前を入力してから保存します

{% hint style="warning" %}
サービスアカウントを、他のユーザーと同様に、接続したい GitLab グループに追加します。GitLab のドキュメントの [グループメンバー](https://docs.gitlab.com/ee/user/group/members/).
{% endhint %}

サービスアカウントが作成されたので、3 つの点をクリックし、「**アクセス トークンの管理**"

* 「**新しいトークンを追加**"
* トークンの名前を入力します。例: `Aikido Security Access Token`
* 有効期限は、社内ポリシーに合うように設定してください。トークンは期限切れ前にローテーションしてください。
* 次のスコープを選択する必要があります:
  * **read\_user**
  * **read\_api**
  * **read\_repository**
* 次をクリック: **トークンを作成** フォームの下部にあるボタン。

<figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-9580b9f27271b25d26f35bce335ad028ad0c101f%2FScherm%C2%ADafbeelding%202025-08-11%20om%2015.00.51.png?alt=media" alt=""><figcaption></figcaption></figure>

* 画面に表示されているトークンをコピーし、入力欄に入力してください。

**重要:** この画面を離れると、トークンは再び表示されません。続行する前にコピーしてください。

AikidoがGitLabサーバーへの接続を確認します。失敗した場合は、サーバーURLとトークンを再確認してください。
{% endstep %}

{% step %}
**インストールを完了する**

をクリックしたら **次に、グループを接続**、最初に使用するグループを選択してください。後からいつでもさらにグループを接続できます。

<figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2FCD94elC0ngkk88ldV7oC%2Fimage.png?alt=media&amp;token=25f3d63e-82a0-40a7-8ef4-5e94c28f39ab" alt=""><figcaption></figcaption></figure>

最後の手順で、Aikidoに監視させたいリポジトリを選択してください。

<figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fkn3kK2SSMVKgLMKnAWCs%2Fimage.png?alt=media&amp;token=99b8f8e1-8eb8-490e-be47-348c88901e9c" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.aikido.dev/docs/docs-ja/kdosukyan/connect-your-source-code/connect-gitlab-self-managed-server-to-aikido.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
