> For the complete documentation index, see [llms.txt](https://coky-t.gitbook.io/owasp-devsecops-guideline-ja/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://coky-t.gitbook.io/owasp-devsecops-guideline-ja/v0.1/02-vulnerability-scanning/02f-container-vulnerability-scanning.md).

# 02f. コンテナ脆弱性スキャン

### コンテナ脆弱性スキャン

コンテナがアプリケーションをパッケージ化しデプロイする方法としてよく使われるようになるにつれ、マルウェアの出現率が高まっています。現在、コンテナのセキュリティ確保は DevOps エンジニアにとって最優先事項となりました。幸いなことに、コンテナやコンテナイメージをスキャンするオープンソースプログラムが多数利用可能です。そのようなツールを五つ見てましょう。

#### コンテナセキュリティスキャンは何ができるか？

* セキュアでないコンテナの検出
  * 古いライブラリの検出
  * 正しく構成されていないコンテナの検出
  * 古いオペレーティングシステムの検出
* コンプライアンスバリデーションの検出
* ベストプラクティスの提案

#### コンテナセキュリティスキャナの問題点

* 使用するツールにより深さのレベルが異なります。そのため選択するツールのタイプにより、得られる結果は大きく異なります。
* 設定が "やりすぎ" になりやすい。さまざまな設定を構成できるツールがあり、簡単に失敗します。
* スキャン結果が実用的なイベントにつながらないかもしれません。

#### コンテナスキャナをいつどこで使用するか？

![](/files/CfKxAFuWvlhmHSQuzA58)

たとえば Dockerfile を実際にビルドし、作成されたイメージを確認する際の build フェーズで使用できます。コンテナスキャナを実行する別の場所としては、コンテナをレジストリにプッシュするときや、コンテナをレジストリからプルするときがあります。しかし、信頼できるコンテナレジストリにプッシュする前にスキャンすることがよいアプローチです。そうすれば、すべてのイメージがスキャンされたものであるコンテナレジストリがあると言うことができ、本番環境にデプロイする際にはこの信頼できるコンテナレジストリからプルできます。 (以下の画像をご覧ください)

![](/files/Amw3c9BT2dfzrdbsjJs4)

***

### ツール:

* **オープンソース:**
  * [Clair](https://github.com/quay/clair) - コンテナ向けの脆弱性静的解析です
  * [Anchore](https://anchore.com/opensource/) - docker イメージの詳細な解析のためのオープンソースプロジェクトです
  * [Dagda](https://github.com/eliasgranderubio/dagda/) - docker イメージやコンテナの既知の脆弱性、トロイの木馬、ウィルス、マルウェア、およびその他の悪意のある脅威の静的解析を実行し、docker デーモンと docker コンテナを監視して異常なアクティビティを検出するツールです
  * [Falco](https://falco.org/) - クラウドネイティブなランタイムセキュリティプロジェクトである Falco は、デファクトの Kubernetes 脅威検出エンジンです
  * [Harbor](https://goharbor.io/) - Harbor はポリシーとロールベースのアクセス制御でアーティファクトを保護するオープンソースレジストリです。イメージがスキャンされて脆弱性がないことを確認し、信頼できるものとしてイメージに署名します。
  * [Trivy](https://aquasecurity.github.io/trivy/) - Trivy はコンテナや他のアーティファクトのためのシンプルで包括的な脆弱性/ミスコンフィギュレーションスキャナです。
  * [Kbescape](https://github.com/armosec/kubescape) - Kubescape は K8s オープンソースツールで、リスク分析、セキュリティコンプライアンス、RBAC ビジュアライザー、イメージ脆弱性スキャンなど、マルチクラウドの K8s の単一の管理画面 (single pane of glass) を提供します。
* **商用:**
  * [Aquasec](https://www.aquasec.com/products/container-vulnerability-scanning/) - Aqua の高度な脆弱性スキャンと管理により DevOps は開発サイクルの中で脆弱性、埋め込まれたシークレット、その他のリスクを検出し、リスクベースの視点で緩和策の優先順位付けができます。Aqua Enterprise、セルフホスト、SaaS で利用可能です。

***

#### 参考情報

* [Opensource.com - tools for container security](https://opensource.com/article/18/8/tools-container-security)


---

# 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://coky-t.gitbook.io/owasp-devsecops-guideline-ja/v0.1/02-vulnerability-scanning/02f-container-vulnerability-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.
