Menu Close
Red Hat Training
A Red Hat training course is available for Red Hat Enterprise Linux
8.11.2. atomic scan を使用したコンテナーイメージとコンテナーの設定コンプライアンスの修正
オリジナルのコンテナーイメージに対して設定コンプライアンススキャンを実行し、DISA STIG ポリシーへの準拠を確認することができます。スキャン結果に基づき、失敗したスキャン結果に対して、bash による修復を含む修正スクリプトが生成されます。その後、修正スクリプトを元のコンテナーイメージに適用します。これを修復と呼びます。修復の結果、設定が変更されたコンテナーイメージが作成され、元のコンテナーイメージの上に新しいレイヤーとして追加されます。
重要
元のコンテナーイメージは変更されず、新しいレイヤーがその上に作成されるだけである点に注意してください。修復プロセスでは、すべての設定の改善を含む新しいコンテナーイメージが構築されます。このレイヤーの内容は、スキャニングのセキュリティーポリシー (前の例では DISA STIG ポリシー) によって定義されます。これは、修復されたコンテナーイメージが Red Hat によって署名されなくなったことも意味します。これは想定内であり、修復されたレイヤーが含まれているという点で、元のコンテナーイメージとは異なることが原因となっています。
前提条件
- OpenSCAP コンテナーイメージを Red Hat Container Catalog (RHCC) から atomic install rhel7/openscap コマンドを実行してダウンロードしてインストールしました。
手順
- configuration_compliance スキャンの OpenSCAP イメージで提供される SCAP コンテントの一覧を表示するには、以下のコマンドを実行します。
~]#
atomic help registry.access.redhat.com/rhel7/openscap - コンテナーイメージを指定されたポリシーに修復するには、設定への準拠をスキャンする際に、
--remediate
オプションを atomic scan コマンドに追加します。次のコマンドは、Red Hat Enterprise Linux 7 コンテナーイメージから DISA STIG ポリシーに準拠した新しい修復済みコンテナーイメージをビルドします。~]#
atomic scan--remediate
--scan_type
configuration_compliance--scanner_args
profile=
xccdf_org.ssgproject.content_profile_stig-rhel7-disa,report
registry.access.redhat.com/rhel7:latest registry.access.redhat.com/rhel7:latest (db7a70a0414e589) The following issues were found: ............ Configure Time Service Maxpoll Interval Severity: Low XCCDF result: fail Configure LDAP Client to Use TLS For All Transactions Severity: Moderate XCCDF result: fail ............ Remediating rule 43/44: 'xccdf_org.ssgproject.content_rule_chronyd_or_ntpd_set_maxpoll' Remediating rule 44/44: 'xccdf_org.ssgproject.content_rule_ldap_client_start_tls' Successfully built 9bbc7083760e Successfully built remediated image 9bbc7083760e from db7a70a0414e589d7c8c162712b329d4fc670fa47ddde721250fb9fcdbed9cc2. Files associated with this scan are in /var/lib/atomic/openscap/2017-11-06-13-01-42-785000. - オプション: atomic scan コマンドの出力は、修復されたイメージ ID を報告します。イメージを覚えやすくするために、以下のような名前を付けてください。
~]#
dockertag
9bbc7083760e rhel7_disa_stig