Versions Compared

Key

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

...

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

Confidential data measures

Avoid keeping sensitive data inside containers. If you want to handle sensitive data or safely manage application settings, you need to take measures such as using a secure storage solution. The i-PRO camera provides a data storage environment using named volumes as a method.

8

CI/CD pipeline security

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

9

SBOMの作成と管理

脆弱性の管理やサプライチェーンリスクマネジメントのために、SBOMを作成・管理し、イメージに含まれるOSSを把握することを推奨します。We perform security checks at each stage of build, test, and deployment to detect and fix unauthorized operations and vulnerable code. This includes using the vulnerability scanning tools mentioned above. Set up appropriate access controls in your CI/CD pipeline and adhere to security best practices.

9

Creating and managing SBOM

Create and manage SBOM for vulnerability management and supply chain risk management. We recommend that you understand the OSS included in the image.

 

Run Vulnerability Checker against your Image

コンテナのセキュリティを強化する方法の一つとして、コンテナイメージ内の脆弱性をツールを用いて抽出し、それら脆弱性を可能な限り取り除いたり修正したりする方法があります。

以下では、コンテナイメージの脆弱性を検知するOSSのツールのうちTrivyとDockleを使用してコンテナイメージの脆弱性を抽出し、セキュリティ強化を図る例を説明します。

...

One way to strengthen container security is to use tools to extract vulnerabilities in container images and remove or fix them as much as possible.

Below, we will explain an example of using Trivy and Dockle, two OSS tools for detecting vulnerabilities in container images, to extract vulnerabilities in container images and strengthen security.

Info

The example in this section uses Trivy and Dockle to extract vulnerabilities in container images, but please choose the appropriate tools and methods depending on the convenience and purpose of your development environment. In addition, each company is responsible for checking the license and usage conditions of each tool before making decisions regarding its use.

コンテナアプリの開発フローと、その中に脆弱性の抽出および対処を組込んだ例を下図に示します。脆弱性の抽出および対処は、早い段階から開発フローの中に組込み、実施することが推奨されます。最低限、イメージが製品リリースされる前の、実際の本番環境にデプロイされる前に必ず実施されるべきです。

...

まず、Dockle をインストールします。Dockle のリリースページから最新版のバイナリをダウンロードできます。下記リンクから Dockle のリリースページにアクセスしてください。

https://github.com/goodwithtech/dockle/releases

リリースページには、Linux、macOS、Windowsなどの各プラットフォーム向けのバイナリが用意されています。自分の環境に合ったバイナリを選択し、ダウンロードしてください。また、Dockle の公式ドキュメントには、各プラットフォームでのインストール方法が詳細に記載されていますので、そちらも参考にしてください。

...

buildhost$ dockle  mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:1.0

INFO     - CIS-DI-0005: Enable Content trust for Docker

  • export DOCKER_CONTENT_TRUST=1 before docker pull/build

INFO     - CIS-DI-0006: Add HEALTHCHECK instruction to the container image

  • not found HEALTHCHECK statement

INFO     - CIS-DI-0008: Confirm safety of setuid/setgid files

  • setuid file: urwxr-xr-x bin/su

  • setuid file: urwxr-xr-x usr/bin/chsh

           <<<<........ SNIP ........>>>>

  • setgid file: grwxr-xr-x sbin/unix_chkpwd

INFO     - DKL-LI-0003: Only put necessary files

  • unnecessary file : app/docker/linux/arm64v8/base/Dockerfile

  • unnecessary file : app/docker/linux/arm32v7/base/Dockerfile

           <<<<........ SNIP ........>>>>

  • unnecessary file : app/docker/windows/arm32v7/base/Dockerfile

...