> 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/kontenaimjisukyan/local-image-scanning/setting-up-image-scanning-with-local-scanner.md).

# Local Scannerでイメージスキャンを設定する

Aikido Security Local Scanner は、独自の環境内で Aikido Security のスキャンを実行できるツールであり、データが外部に出ることはありません。スキャンはローカルで行われ、その結果は Aikido Security プラットフォームにアップロードされます。この構成により、イメージがレジストリに送信される前に、自分のマシン上または CI/CD パイプライン内で任意のイメージをローカルにスキャンできます。

## イメージのローカルスキャンを設定する方法 <a href="#how-to-set-up-local-scanning-for-images" id="how-to-set-up-local-scanning-for-images"></a>

### 1. 認証トークンを取得する <a href="#id-1-get-your-authentication-token" id="id-1-get-your-authentication-token"></a>

1. へ移動 [Local Scanner Image 設定ページ](https://app.aikido.dev/settings/container-image-registry/add/localscan)
2. 認証トークンを生成してコピーします。このトークンを表示できるのは 1 回だけです。
3. このトークンを引数として追加します `--apikey` プロジェクトで Local Scanner を実行する際に。

   ![バイナリのダウンロード、トークン生成、セットアップガイドを含むローカルイメージスキャンの設定手順。](https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-becca9fc0c4f64af4409fbd895a3e0ecc945aa53%2Fucarecdn-6376840b-120d-43e5-a42f-92cd51ee0ce8.png?alt=media)

### 2. Local Scanner をプロジェクトに追加する <a href="#id-2-adding-the-local-scanner-to-your-project" id="id-2-adding-the-local-scanner-to-your-project"></a>

Aikido の UI からローカルスキャナーのバイナリをダウンロードします。

### 3. Local Scanner を実行する <a href="#id-3-running-the-local-scanner" id="id-3-running-the-local-scanner"></a>

あとはイメージに対してスキャナーを実行するだけです。

```
aikido-local-scanner image-scan your-image-name --apikey AIK_CI_xxx
```

または、当社の Docker イメージを使用している場合（**前提条件:** Docker デーモンが起動している必要があります）

```
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock aikidosecurity/local-scanner image-scan your-image-name --apikey AIK_CI_xxx
```

CI でこれを実行する場合は、feature ブランチ आधारितのイメージに対してスキャンを実行しないよう注意してください。Aikido で本番環境の結果と feature の結果が混ざらないようにするためです。

スキャナーはリリースまたは PR のゲーティングモードでも実行できます。こちらを確認してください [この記事](/docs/docs-ja/kontenaimjisukyan/local-image-scanning/pr-gating-for-container-images-using-local-image-scanner.md) を参照してください。

### 4. スキャン結果を確認する <a href="#id-4-check-your-scanning-results" id="id-4-check-your-scanning-results"></a>

最初のスキャンが完了したら、Aikido Feed に移動して結果を確認できます。指定した名前のイメージが Aikido UI に作成され、スキャンのすべての結果が含まれています。

***


---

# 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/kontenaimjisukyan/local-image-scanning/setting-up-image-scanning-with-local-scanner.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.
