Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

8.6. システムを特定のベースラインに合わせるための修復用 Ansible Playbook の作成

以下の手順に従って、必要な修復のみを含む Ansible Playbook を作成し、システムを特定のベースラインに合わせます。この例では、OSPP (Protection Profile for General Purpose Operating Systems) の保護プロファイルを使用します。この手順では、すでに対応済みの要件は含めずに、より小規模な Playbook を作成します。以下の手順に従うと、システムを変更せずに、後のアプリケーション用にファイルの準備を行うだけです。

前提条件

  • システムに、scap-security-guide パッケージがインストールされている。

手順

  1. システムをスキャンして結果を保存します。
    ~]# oscap xccdf eval --profile ospp --results ospp-results.xml /usr/share/xml/scap/ssg/content/ssg-rhel7-ds.xml
  2. 前の手順で生成されたファイルに基づいて Ansible Playbook を生成します。
    ~]# oscap xccdf generate fix --fix-type ansible --profile ospp --output ospp-remediations.yml ospp-results.xml
  3. ospp-remediations.yml ファイルには、手順 1 で実行されたスキャン中に失敗したルールの Ansible 修復が含まれます。この生成されたファイルを確認したら、ansible-playbook ospp-remediations.yml コマンドを使用して適用できます。

検証

  1. お使いのテキストエディターで、手順 1 で実行したスキャンで失敗したルールが ospp-remediations.yml ファイルに含まれていることを確認します。

関連情報