> 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/azure-devops-server-setup-for-local-image-scanning.md).

# Local Image Scanning の Azure DevOps Server 設定

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. 次へ移動 [ローカルスキャナーのイメージ設定ページ](https://app.aikido.dev/settings/container-image-registry/add/localscan)
2. 認証トークンを生成してコピーします。このトークンは一度しか表示できないことに注意してください。
3. このトークンはパイプラインのセットアップで必要です。

### 2. ローカルスキャナーの実行 <a href="#id-2-running-the-local-scanner" id="id-2-running-the-local-scanner"></a>

左側のナビゲーションで Pipelines に移動し、 *パイプライン* をクリックして、次を選択します: *新しいパイプライン* または *パイプラインを作成*。構成ステップで、 *Starter Pipeline*.

```yaml
トリガー:
- master

pool:
  vmImage: ubuntu-latest

steps:
- script: docker build -t my-image .
  displayName: 'Docker イメージをビルド'  
- script: docker run --rm -v /var/run/docker.sock:/var/run/docker.sock aikidosecurity/local-scanner image-scan my-image --apikey $(AIKIDO_API_KEY)
  displayName: 'Aikido スキャンを実行'
```

ビルドとスキャンを別々のステージまたはジョブに分けることもできます。ユースケースに最も合う例を使用し、必要に応じて調整してください。

```yaml
トリガー:
  - master

pool:
  vmImage: ubuntu-latest

stages:
- stage: Build
  displayName: Docker イメージをビルド
  jobs:
  - job: BuildAndSave
    displayName: Docker イメージをビルドして保存
    steps:
      - script: |
          docker build -t my-image .
          docker save my-image -o $(Pipeline.Workspace)/my-image.tar
        displayName: 'Docker イメージを TAR にビルドして保存'
      - task: PublishPipelineArtifact@1
        inputs:
          targetPath: '$(Pipeline.Workspace)/my-image.tar'
          artifactName: 'my-image-tar'
        displayName: 'Docker イメージの TAR を成果物として公開'

- stage: Scan
  displayName: Docker イメージをスキャン
  dependsOn: Build
  jobs:
  - job: RunScanner
    displayName: Aikido Local Scanner でスキャン
    steps:
      - task: DownloadPipelineArtifact@2
        inputs:
          artifact: 'my-image-tar'
          path: '$(Pipeline.Workspace)'
        displayName: '保存されたイメージ TAR をダウンロード'
      - script: |
          docker run --rm -v $(Pipeline.Workspace):$(Pipeline.Workspace) aikidosecurity/local-scanner image-scan $(Pipeline.Workspace)/my-image.tar --image-name my-image --apikey $(AIKIDO_API_KEY)
        displayName: 'Aikido で Docker イメージをスキャン'
```

\
次に、API キーをシークレット変数として追加します。右上の corners の variables をクリックし、新しい変数を追加します。名前に AIKIDO\_API\_KEY を入力します。 *この値を秘密にする* チェックボックスにチェックを入れてください。これでパイプラインを保存して実行します。

### 3. スキャン結果を確認する <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 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/kontenaimjisukyan/local-image-scanning/azure-devops-server-setup-for-local-image-scanning.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.
