> 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つのワークスペースを作成してください。最初のワークスペースを作成したあと、左上のドロップダウンの「別のワークスペースを追加」からこれを行えます。
{% endhint %}

## 設定

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

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

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

認証が完了したら、クリックして新しいワークスペースを作成します **セルフマネージド** GitLabセクション内で。

![接続するソース管理プロバイダーを選択してください: GitHub、Azure DevOps、GitLab、またはBitbucket。](/files/b38e9d8ab9a92db663d4859432cf997fa671f84d)
{% endstep %}

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

ワークスペースを作成するには、自社運用のGitLabインスタンスに関するいくつかの詳細を入力して、Aikidoが接続できるようにしてください。

{% hint style="info" %}
GitLabがファイアウォールの背後で動作している場合、 [AikidoのIPアドレスを許可リストに追加してください](/docs/docs-ja/kdosukyan/miscellaneous/allowing-ip-addresses-for-code-container-scanning.md) Aikidoがアクセスできるようにしてください。それが不可能な場合は、 [ブローカー設定ガイド](/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を入力してください。

![Aikidoのオンボーディング: GitLabセルフマネージドのURLとアクセス トークンを入力して認証します。](/files/8ea6c6f795f02601c26a79f47e8413e3c0cdbc16)
{% endstep %}

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

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

* GitLabサーバーにログインします
* 管理エリアへ移動（`/admin`)
* 移動先 **設定** → **Service account**
* クリック **service account を追加**、名前を入力してから保存します

{% 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="/files/c715577a2ff0c4798120a771a9327061fdabb5fb" alt=""><figcaption></figcaption></figure>

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

**重要：** この画面を離れると、トークンを再度確認することはできません。続行する前にコピーしてください。

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

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

クリックした後 **次へ、グループを接続**、開始するグループを選択します。後からいつでもさらにグループを接続できます。

最後のステップで、Aikidoに監視させたいリポジトリを選択します。
{% 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.
