> 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/connect-gitlab-self-managed-server-broker-set-up.md).

# GitLab Self-Managed サーバーを接続する（Broker セットアップ）

Aikido を使うと、セルフマネージドの GitLab インスタンスを接続して、コードをスキャンし保護できます。以下の手順に従って GitLab サーバーを 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 のセットアップを開始する**

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

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

{% step %}
**Broker アクセスを有効にする**

有効にする **Aikido ブローカー** を、「高度な接続オプション」セクションのトグルをクリックして有効化します。

をクリック **グループを作成** して続行します。

![Aikido のオンボーディング: GitLab Self-Managed の URL とアクセス トークンを入力して認証します。](/files/67441510fccf7c71366fa0f65d5439fdcfbff759)
{% endstep %}

{% step %}
**Broker を設定する**

以下のガイドに従って Broker を設定してください。デプロイしたら、ここに戻って GitLab のセットアップを完了します。

{% content-ref url="/pages/57eb4d0e1ea0df52e494af68c47a0c2a1e884bc1" %}
[社内アプリケーション向け Aikido Broker](/docs/docs-ja/miscellaneous-info/aikido-broker-for-internal-applications.md)
{% endcontent-ref %}

<figure><img src="/files/ccb7921882edf1abbe948179a424e663d283c751" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**GitLab サーバーのセットアップを完了する**

Broker を作成して環境にデプロイしたら、GitLab のセットアップを完了できます。

まず、 **Broker URL**をコピーします。以下のような形式です:

```
https://55673-355dsfwea68cb.aikidobroker.com
```

その後、 **GitLab サーバーのセットアップを完了**.

<figure><img src="/files/1379216267d5493ae40e33a1c32eb13debf09327" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Broker URL を入力する**

前の手順でコピーした Broker のリソース URL を、「server URL」の入力欄に貼り付けます。

<figure><img src="/files/31d3e4f961e7411a62faaaba3000dc2a4ffc3e53" alt=""><figcaption></figcaption></figure>
{% endstep %}

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

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

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

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

サービスアカウントが作成されたので、3つの点をクリックして「**GitLab のサービスアカウントページにある 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/connect-gitlab-self-managed-server-broker-set-up.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.
