> 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/local-code-scanning/linux-setup-for-local-code-scanning.md).

# ローカルコードスキャンのためのLinuxセットアップ

**目次:**

* [要件](#requirements)
* [一時フォルダ​](#temporary-folder)
* [ローカルスキャンのセットアップ方法](#how-to-set-up-local-scanning)
  * [1. 認証トークンを取得する](#1-get-your-authentication-token)
  * [2. Local Scanner をプロジェクトに追加する](#2-adding-the-local-scanner-to-your-project)
  * [3. Local Scanner を実行する](#3-running-the-local-scanner)
  * [4. スキャン結果を確認する](#4-check-your-scanning-results)

## ローカルコードスキャンのためのLinuxセットアップ

Aikido Security Local Scanner は、Aikido Security のスキャンをお使いの環境内で実行できるツールで、コードが決してお使いの環境外に出ないことを保証します。スキャンはローカルで行われ、その結果は Aikido Security プラットフォームにアップロードされます。この設定により、自分のマシン上で任意のリポジトリをローカルにスキャンできます。

### 要件 <a href="#requirements" id="requirements"></a>

現在、x86\_64 および ARM64 のオペレーティングシステムアーキテクチャをサポートしています。

### 一時フォルダ​ <a href="#temporary-folder" id="temporary-folder"></a>

スキャナーは、いくつかの処理を行うために一時的なローカルフォルダー（デフォルトは .aikidotmp）を作成します:

* 効率的にスキャンを実行するために、特定のロックファイルをコピーします。
* スキャナーの結果を書き込みます。

このフォルダーは、スキャン完了後にクリーンアップされます。

さらに、一部のファイルは一時的な作業ディレクトリにコピーされます。十分な空き容量があることを確認してください。最低でも 10GB を推奨します。​

### ローカルスキャンのセットアップ方法 <a href="#how-to-set-up-local-scanning" id="how-to-set-up-local-scanning"></a>

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

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

#### 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>

あとは、スキャンしたいディレクトリでスキャナーを実行するだけです。

```shellscript
./aikido-local-scanner scan path_to_my_repository --apikey AIK_CI_xxx --repositoryname DemoApp --branchname main
```

デフォルトではすべてのスキャナーが実行されます。スキャナーの一部だけを実行したい場合は、スキャナー名を指定することで実行できます。 `--scanners` オプション。CLI オプションの詳細は [こちら](https://help.aikido.dev/en/articles/9027526-local-scanner-cli-options).

または、以下から Docker イメージを使用することもできます。 [Docker Hub](https://hub.docker.com/r/aikidosecurity/local-scanner) または [AWS Elastic Container Registry](https://gallery.ecr.aws/z1o3v2w5/aikidosecurity/local-scanner) を使ってリポジトリをスキャンできます。続行する前に、 [Docker がインストールされている](https://docs.docker.com/desktop/) ことを確認してください。まず、スキャンしたいディレクトリに移動し、次のようなコマンドでスキャンを実行します。

```shellscript
docker run --rm -v "$(pwd):/my-app" aikidosecurity/local-scanner scan /my-app --apikey AIK_CI_xxx --repositoryname RepoName --branchname main
```

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

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


---

# 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/kdosukyan/local-code-scanning/linux-setup-for-local-code-scanning.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.
