> 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/autofix-to/configure/autofix-for-gitlab-self-managed.md).

# GitLab セルフマネージド向けの AutoFix

## はじめに

Aikido AutoFix は、プロジェクト内のサードパーティ依存関係にある脆弱性を解消するために設計されたツールです。パッケージを更新したり、脆弱性を除去するための他の解決策を実装したりするプルリクエストを生成することで、これを実現します。場合によっては、Aikido AutoFix は単一の問題だけでなく、脆弱性の一群全体に対処できます。

## GitLab Self Managed 用の Autofix を設定する

デフォルトでは、Aikido はあなたの GitLab Self Managed インスタンスに対して読み取り専用アクセスしか持っていません。Aikido AutoFix を使用するには、書き込みアクセス権を持つ別のアクセストークンが必要です。

**手順 1.** で書き込みアクセスを有効にし、 [AutoFix 設定](https://app.aikido.dev/settings/integrations/autofix) ページ上で使用します。

**手順 2.** クリックします **承認**すると、このモーダルが表示されます：

![](https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-ffe05573d8848a62cde8f2467de7b83f7343f8c4%2Fucarecdn-847dce22-b557-4a36-8592-c8b97e558f46.png?alt=media)

**手順 3.** Self Managed の GitLab アカウントに移動します。左上の個人アカウントアイコンをクリックし、設定へ進みます。

![](https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-733c8d013b17a93ee8982306c599fd6710522189%2Fucarecdn-1aa79b23-ea0e-473c-beb6-e60b3ff03d73.png?alt=media)

**手順 4.** サイドバーで「Access Token」を選択します。次に「Add new token」ボタンをクリックします。

![](https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-f694bf86108ac5ac18d1d436aabf1edfc548f5b3%2Fucarecdn-696b35be-f6ea-4bce-978d-0bede8b663ee.png?alt=media)

**手順 5.** トークン名を「Aikido Autofix」とし、次の権限を追加します： `api` & `write_repository`

![](https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-39121ea57866ac8269739b8f0183f346dd8d5e25%2Fucarecdn-0a39f5aa-0e23-4e69-91a3-c94163f81db7.png?alt=media)

**手順 6.** 新しく作成したトークンをコピーし、Aikido のモーダルに貼り付けます。

![](https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-64c318e10c8ba4d83dd33babf7eef03eeeedd4af%2Fucarecdn-75bb003e-2ebf-4687-8b8c-3c6049717027.png?alt=media)

![](https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-b9cea0a66b77523b568bcb9fb8c897fb1a56bd03%2Fucarecdn-c1669df1-17da-4e97-b521-c71fc46b8e5d.png?alt=media)

**手順 7.** 保存をクリックすれば完了です。これで、以下から autofix の PR を実行できるようになります： [Autofix ページ](https://app.aikido.dev/issues/fix) または、サイドバーのサブイシューのアクションメニューから。

## サービスアカウントの使用

GitLab ユーザー用の PAT で Autofix を設定すると、AutoFix によって作成された Merge Request の作成者があなたになり、分かりにくくなることがあります。

プレミアム版の GitLab Self Managed ユーザーには、Aikido AutoFix 用のサービスアカウントを設定することをおすすめします。これにより、どの PR が Aikido から来たものかを簡単に見分けられます。

**ステップ 1. サービスアカウントを設定する**

GitLab で、Group > `あなたのグループ` > Settings > Service accounts に移動して、サービスアカウントを設定します。

**ステップ 2. サービスアカウント用の PAT を作成する**

クリックします `アクセストークンを管理` GitLab のサービスアカウントページにある 3 点メニューから、新しいアクセストークンを作成します。以下の `api` と `write_repository` 権限を持つ PAT を作成します。

**ステップ 3. サービスアカウントを GitLab グループのメンバーとして追加する**

GitLab で、Group > `あなたのグループ` > Manage > Members > Invite Members に進み、新しく作成したサービスアカウントを GitLab グループのメンバーとして追加します。

**ステップ 4. PAT を Aikido UI に貼り付ける**

GitLab で新しく作成したトークンをコピーし、Aikido のモーダルに貼り付けます。


---

# 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/autofix-to/configure/autofix-for-gitlab-self-managed.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.
