Show Table of Contents
6.6. Atomic での OpenSCAP の使用
システム上にあるすべてのコンテナーイメージおよびコンテナーが既知の CVE 脆弱性や一般的な設定ミスがないかを検証するには、
atomic scan コマンドを使用して OpenSCAP スキャン機能を使用します。
Atomic スキャン
お使いのシステム上に、コンテナー管理用に
atomic ツールをインストールするには、root で以下のコマンドを実行します。
#yum install atomic
atomic ツールをインストールした後にはスキャナーも必要です。Red Hat は OpenSCAP ベースの rhel7/openscap docker イメージを選択することを推奨します。root として以下のコマンドを実行して、インストールします。
#atomic installrhel7/openscap
OpenSCAP docker イメージが設定されたら、
atomic scan コマンドを実行します。以下のコマンドを root で実行すると、コンテナーおよびコンテナーイメージをスキャンします。
#atomic scan$ID
$ID は、コンテナーの ID に置き換えます。全コンテナーイメージまたはコンテナーをスキャンする場合には、それぞれ
--images または --containers ディレクティブを使用します。どちらのタイプもスキャンするには、--all ディレクティブを使用します。
OpenSCAP スキャナー
atomic scan のデフォルトスキャナーである rhel7/openscap コンテナーイメージは、Red Hat Enterprise Linux システムのみを対象にするスキャンタイプ 2 種をサポートします。サポートされるスキャンタイプは、以下のコマンドを root で実行すると表示できます。
#atomic scan--scanneropenscap--list
デフォルトのスキャンタイプは CVE scan です。Red Hat が発表した CVE OVAL 定義に指定されている既知のセキュリティー脆弱性の対象であるかどうかを確認する際に使用します。
警告
CVE scan タイプで使用する OVAL の定義は、ビルドプロセス時におkんテナーイメージにバンドルされるので、常に最新なわけではありません。
サポートされているスキャンタイプの 2 つ目は standards_compliance ですが、バンドルされた SCAP Security Guide の Standard System Security Profile が評価に使用されます。これは、Red Hat Enterprise Linux のセキュリティーベースラインのプロファイルです。
例6.13 Atomic スキャンでのコンテナーイメージのスキャン
以下に示した
atomic scan の使用例では、Red Hat Enterprise Linux イメージをスキャンして、--verbose ディレクティブで検出された脆弱性を表示する方法を紹介しています。
#docker pullrhel7 Using default tag: latest 98a88a8b722a: Download complete#atomic scan98a88a8b722a Container/Image Cri Imp Med Low --------------- --- --- --- --- 98a88a8b722a 0 0 0 0#atomic scan--verbose98a88a8b722a docker run -t --rm -v /etc/localtime:/etc/localtime -v /run/atomic/2016-10-14-06-42-55-991951:/scanin -v /var/lib/atomic/openscap/2016-10-14-06-42-55-991951:/scanout:rw,Z -v /etc/oscapd:/etc/oscapd:ro rhel7/openscap oscapd-evaluate scan --no-standard-compliance --targets chroots-in-dir:///scanin --output /scanout INFO:OpenSCAP Daemon one-off evaluator 0.1.6 WARNING:Can't import the 'docker' package. Container scanning functionality will be disabled. INFO:Creating tasks directory at '/var/lib/oscapd/tasks' because it didn't exist. INFO:Creating results directory at '/var/lib/oscapd/results' because it didn't exist. INFO:Creating results work in progress directory at '/var/lib/oscapd/work_in_progress' because it didn't exist. INFO:Evaluated EvaluationSpec, exit_code=0. INFO:Evaluated EvaluationSpec, exit_code=0. INFO:[100.00%] Scanned target 'chroot:///scanin/98a88a8b722a71835dd761c88451c681a8f1bc6e577f90d4dc8b234100bd4861' 98a88a8b722a (registry.access.redhat.com/rhel7:latest) 98a88a8b722a passed the scan Files associated with this scan are in /var/lib/atomic/openscap/2016-10-14-06-42-55-991951.
注記
Red Hat Enterprise Linux Atomic Host の製品ドキュメント で、
atomic コマンドの使用方法やコンテナーの詳細にわたる説明を入手できます。Red Hat カスタマーポータでも「Atomic command line interface (CLI)」のガイドが提供されています。

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.