> 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サーバーを接続する（ブローカー設定）

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の設定を開始**

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

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

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

を有効にする **Aikido broker** 「Advanced Connection Options」セクションのトグルをクリックして。

クリック **グループを作成** 続行するには。

![Aikidoのオンボーディング: 認証するためにGitLabセルフマネージドの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`)
* 移動先 **設定** → **サービスアカウント**
* クリック **サービスアカウントを追加**、名前を入力して保存します

{% 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/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.
