Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Enhance Security Level of your Container

ここではコンテナアプリケーションの開発において、コンテナのセキュリティを強化するための手法について記載します。

コンテナのセキュリティを強化することは、エンドユーザーをはじめとした全ての関係者および社会の信頼を獲得するために重要です。セキュリティの脅威に対処することはそれら関係者および自身のデータとプライバシーを保護し、ビジネス上の信頼を築くために必要不可欠です。セキュリティが脆弱なコンテナイメージを使用することは、関連リスクを増大させ、関係者や社会の信頼を失う可能性があります。また、セキュリティ問題が発生した場合にその対応が求められ、莫大な損失が発生する可能性もあります。

下表はコンテナアプリの開発時に必要とされるセキュリティ対策の一例です。全部またはどれか一つを実施すればよいというものではなく、セキュリティリスクやコストなどのトレードオフを勘案しながら、何をどの程度組み合わせて対策するかを検討する必要があります。本書ではこれら対策のうち一部のみを説明しますが、詳細やその他の対策事項については各位にてベストプラクティスの調査や実際の対応のご検討をお願い致します。

Examples of Security Measures in Container Apps Development

...

No.

...

セキュリティ対策

...

説明

...

1

...

ベースイメージの選択

...

軽量で、信頼性の高いベースイメージを選択します。公式イメージまたはセキュリティが強化されたイメージを使用することを検討してください。i-PROのSDKではベースとなるイメージを提供していますので、追加で必要なものを除きそれらを使用してください。

...

2

...

イメージの脆弱性スキャン

...

コンテナイメージを定期的にツールでスキャンし、脆弱性を特定して修正します。

...

3

...

セキュアなDockerfileの作成

...

不要なパッケージをインストールしない、COPYではなくADDを使用する、ユーザ権限を最小限にするなど、Dockerfileをセキュアに作成します。このようなプラクティスは上記の脆弱性ツールにより多くが検出できます。

...

4

...

セキュリティコンテキストの適用

...

コンテナに適切な権限とリソース制限を設定することで、リスクを最小限に抑えます。i-PROカメラはこれらの設定内容を制限をしており、許可範囲外の設定でコンテナを起動しようとするとエラーとなります。このエラーを避けるために、i-PROから提供されるテンプレート設定をご使用ください。

...

5

...

コンテナのネットワークセキュリティ

...

ネットワーク設定を適切に構成し、不要なポートを開放しないようにします。また、コンテナ間の通信にもセキュリティポリシーを適用します。

...

6

...

ロギングと監視

...

This article describes techniques for strengthening container security when developing container applications.

Enhancing the security of containers is important to gain the trust of all stakeholders, including end users, and society. Addressing security threats is essential to protecting the data and privacy of those stakeholders and yourself, and building business trust. Using container images with weak security increases the associated risks and can lead to a loss of trust among stakeholders and society. Additionally, if a security issue occurs, you will be required to take action, which could result in huge losses.

The table below is an example of security measures required when developing container apps. It is not a matter of implementing all or just one of the measures; instead, it is necessary to consider what measures to take in combination and to what degree, taking into account trade-offs such as security risks and costs. This document explains only some of these measures, but for details and other measures, we ask that you investigate best practices and consider actual responses.

Examples of Security Measures in Container Apps Development

No.

Security measures

Explanation

1

Select base image

Choose a lightweight, reliable base image. Consider using official or security-enhanced images. i-PRO's SDK provides base images, so please use them unless you need additional information.

2

Image vulnerability scan

Regularly scan container images with tools to identify and remediate vulnerabilities.

3

Creating a secure Dockerfile

Create Dockerfile securely. Don't install unnecessary packages, use ADD instead of COPY, minimize user privileges, etc. Many of these practices can be detected by the vulnerability tools listed above.

4

Applying security context

Minimize risk by setting appropriate permissions and resource limits on your containers. The i-PRO camera restricts these settings, and an error will occur if you try to start the container with settings outside the permitted range. To avoid this error, please use the template settings provided by i-PRO.

5

Container network security

Configure your network settings appropriately and avoid opening unnecessary ports. It also applies security policies to communication between containers.

6

Logging and monitoring

Monitor containers and collect logs to quickly detect anomalies and security incidents. It is necessary to implement output logging with an appropriate amount and content.

7

機密データの対策

機密データをコンテナ内に保持しないようにします。機密データを扱いたい場合やアプリケーションの設定を安全に管理するためには、セキュアなストレージソリューションを使用する等の対策が必要です。i-PROカメラでは一手段として named volume によるデータの保存環境を提供しています。

8

CI/CDパイプラインのセキュリティ

ビルド、テスト、デプロイの各ステージでセキュリティチェックを実施し、不正な操作や脆弱性のあるコードを検出・修正します。先述の脆弱性のスキャンツールの使用もその一つです。CI/CDパイプラインに適切なアクセス制御を設定し、セキュリティのベストプラクティスを遵守してください。

9

SBOMの作成と管理

脆弱性の管理やサプライチェーンリスクマネジメントのために、SBOMを作成・管理し、イメージに含まれるOSSを把握することを推奨します。

...