> 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/pr-torirsugtingu/gitlab-mr-gating/gitlab-server-ci-mr-gating-via-aikido-dashboard-with-a-service-account-token.md).

# GitLab Premium、Ultimate、Server: MRスキャンのセットアップ

Aikidoの問題についてMRスキャン結果とコメントを公開します。パイプラインコードは不要です。

{% hint style="warning" %}
このセットアップは次の用途向けです **GitLab Premium、GitLab Ultimate、または GitLab Server**.

Service Accounts はこれらのプランで利用できます。MR スキャンを実行する推奨方法です。

もしご利用中のプランが **GitLab Free**の場合は、 [**ユーザーベースの設定**](/docs/docs-ja/pr-torirsugtingu/gitlab-mr-gating/gitlab-free-mr-scans-setup.md) の代わりに。
{% endhint %}

## GitLab MR スキャンを設定する

{% stepper %}
{% step %}
**専用の Service Account を作成する**

GitLab で次へ移動します **グループ** → **設定** → **Service アカウント**.

選択します **Service アカウントを追加**.

次を設定 **Name** と **ユーザー名**:

* 名前： `Aikido Security`
* ユーザー名: `AikidoSec`
* 選択します **作成**.

このアカウントは Aikido 専用に使用してください。

<div data-with-frame="true"><figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-51fea14179491fa5c6d20edb148dab2bedab57ee%2FScreenshot%202026-03-02%20at%2016.36.22.png?alt=media" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**アクセストークンを作成する**

Service アカウントで縦三点リーダー → を選択します **アクセストークンを管理**.

<div data-with-frame="true"><figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-d9b924db9a81347e068bf96e57137ef354285030%2Fimage.png?alt=media" alt="GitLab Service Accounts overview"><figcaption></figcaption></figure></div>

新しいトークンを追加:

* 名前: 例 `Aikido Scans`
* 有効期限: ローテーションポリシーに合った有効期限を設定します
* スコープ: `api`

<div data-with-frame="true"><figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-56519efe89f108bb6956c72f13c70336630ecc78%2FScreenshot%202026-03-02%20at%2013.56.26.png?alt=media" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**トークンを保存**

今すぐトークンをコピーしてください。GitLab では再表示されません。

ステップ 6 で Aikido に貼り付けます。

<div data-with-frame="true"><figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-a2d8d9e3d350207e3a813133cfcc8474971bdf45%2FScreenshot%202026-03-02%20at%2013.58.27.png?alt=media" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**アカウントをグループに招待する**

次へ移動します： **グループ** GitLab で。

有効にしたい各グループで、そのグループを開きます。

次へ移動します： **管理** → **メンバー** → **メンバーを招待**.

Service アカウントを招待します。

<div data-with-frame="true"><figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-7e246d33b363502b5e3855fbac77cc907d9b57af%2FScreenshot%202026-03-02%20at%2013.47.09.png?alt=media" alt=""><figcaption></figcaption></figure></div>

少なくとも **メンテナー** の権限を付与します。

<div data-with-frame="true"><figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-c35caac600cfc32332daa878b30f77c27c573a3d%2FScreenshot%202026-03-02%20at%2016.16.56.png?alt=media" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**連携を有効にする**

Aikido で、次を開きます: [連携](https://app.aikido.dev/settings/integrations?section=ci) ページ。次に、 **GitLab CI** 以下の **MR 品質ゲート**.

<div data-with-frame="true"><figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-64c8b67d18466ff94b5a629a760a8c3125689a9d%2FScreenshot%202026-03-02%20at%2015.11.44.png?alt=media" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**アクセストークンを貼り付ける**

ステップ 3 で作成したトークンを貼り付けます。

クリックします **トークンを更新**.

Aikido はグループへのアクセスと必要な権限を検証します。

<div data-with-frame="true"><figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-3f1c76782c61b3fad343be2f35571435563dc3d5%2FScreenshot%202026-03-02%20at%2015.02.03.png?alt=media" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**最初のリポジトリを設定する**

認証後、Aikido は次を開きます: [GitLab MR チェック](https://app.aikido.dev/settings/integrations/gitlab/checks) ページ上で使用します。

まずは **1つのリポジトリ** を最初に設定します。全体に展開する前に、すべてが正しく動作することを確認してください。

<div data-with-frame="true"><figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-4ebb8e939094cacb54ef2a025b41f8790882b46e%2FScreenshot%202026-03-02%20at%2015.17.32.png?alt=media" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**新しい MR で確認する**

設定したリポジトリで新しいマージリクエスト（MR）を開きます。

その後、チェックが次の場所で実行されていることを確認します **パイプライン** タブを選択します。

<div data-with-frame="true"><figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-786233c307851e75f090b380acf5e92e19dc9980%2FScreenshot%202026-03-02%20at%2015.20.37.png?alt=media" alt=""><figcaption></figcaption></figure></div>

コメントはサービスアカウントとして表示されるはずです。たとえば、 `@AikidoSec`.

<div data-with-frame="true"><figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-b93504f36ded78794326be2c72ad675e256aa439%2FScreenshot%202026-03-02%20at%2016.22.11.png?alt=media" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**スキャンの成功を必須にする**

スキャンが成功するまでマージをブロックしたい場合は、 **マージチェック** GitLab で。

GitLab で次へ移動します **\[リポジトリ]** → **設定** → **マージリクエスト**。チェックを有効にします `パイプラインは成功する必要があります`.

<div data-with-frame="true"><figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-0489b10288ea70368a19b14a5c3b5c85f39a45d7%2FScreenshot%202026-03-02%20at%2015.56.26.png?alt=media" alt=""><figcaption></figcaption></figure></div>

<div data-with-frame="true"><figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-c7a21923d205813b58496d7adf5e0929c38d71b5%2FScreenshot%202026-03-02%20at%2015.57.29.png?alt=media" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**すべてのリポジトリで有効にする**

結果に満足したら、 [GitLab MR チェック](https://app.aikido.dev/settings/integrations/gitlab/checks) ページに戻り、残りのリポジトリでチェックを有効にします。

<div data-with-frame="true"><figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-93adec5ff3627aaaf0030cd8ff160ffa3f594305%2FScreenshot%202026-03-02%20at%2015.36.19.png?alt=media" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**新しいリポジトリのデフォルトを設定する**

右上で、次を開きます: `アクション` and select `新しいリポジトリのデフォルトを設定` また、今後追加されるリポジトリに対して自動設定を有効にします。

UI の手順ガイドが必要ですか？こちらをご覧ください [新しいリポジトリに対するデフォルトのPR/MRゲーティング設定](/docs/docs-ja/pr-torirsugtingu/aikido-ci-gating-functionality/default-pr-mr-gating-configuration-for-new-repositories.md).
{% endstep %}
{% endstepper %}

## MR コメントから直接問題を無視する <a href="#ignore-issues-directly-from-mr-comments" id="ignore-issues-directly-from-mr-comments"></a>

Aikido が検出結果に対してインラインの MR コメントを投稿した場合、コメントに次のように返信することで GitLab から直接その問題を無視できます:

`@AikidoSec ignore: [無視する理由]`

例:

`@AikidoSec ignore: このシークレットはテスト専用です。`

置き換えてください `@AikidoSec` ステップ 1 で作成した Service アカウントのユーザー名と、異なる場合はそれに置き換えてください。

これは、Aikido プラットフォームで手動で問題を無視するのと同じ操作です:

* 問題は Aikido で無視済みとしてマークされます。
* 無視理由が保存されます。
* すべてのブロッキングな問題が解決または無視されると、MR ゲーティングは緑になります。

{% hint style="info" %}
無視権限がない場合、このコメントは次の場所にリクエストを作成します: [承認受信箱](/docs/docs-ja/hajimeni/core-functionalities/approval-inbox-for-ignored-issues.md) すぐに問題を無視する代わりに、検出結果は管理者が承認または却下するまでフィードに残ります。
{% endhint %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.aikido.dev/docs/docs-ja/pr-torirsugtingu/gitlab-mr-gating/gitlab-server-ci-mr-gating-via-aikido-dashboard-with-a-service-account-token.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
