> 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サーバーを接続する

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つのワークスペースを作成してください。最初のワークスペースを作成した後、左上のドロップダウンから「ワークスペースをもう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 accounts**
* クリック **サービスアカウントを追加**、名前を入力してから保存します

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

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

* 「**新しいトークンを追加**"
* トークンの名前を入力してください。たとえば： `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.
