OpenSCAPによるシステムセキュリティ
SUSE Multi-Linux ManagerはOpenSCAPを使用してクライアントを監査します。 任意のクライアントのコンプライアンススキャンをスケジュールして表示できます。
|
An enhanced SCAP auditing experience is available as a beta feature. It provides centralized content management, reusable scan policies, recurring scans, and built-in remediation from the Web UI. To get started, see Enhanced SCAP Auditing (Beta). |
1. SCAPについて
Security Content Automation Protocol (SCAP)は、コミュニティのアイデアから派生した相互運用可能な仕様を統合したものです。 これは、エンタープライズシステムのシステムセキュリティを維持するために、National Institute of Standards and Technology (NIST)によって維持されている一連の仕様です。
SCAPは、システムのセキュリティを維持するための標準化されたアプローチを提供するために作成されました。また、使用される標準は、コミュニティや企業のビジネスニーズを満たすために継続的に変更されます。 新しい仕様はNISTのSCAPリリースサイクルによって管理され、一貫性のある再現可能な改訂ワークフローを提供します。 詳細については、以下を参照してください。
SUSE Multi-Linux ManagerはOpenSCAPを使用してSCAP仕様を実装します。 OpenSCAPは、Extensible Configuration Checklist Description Format (XCCDF)を利用した監査ツールです。 XCCDFは、チェックリストの内容を表現する標準的な方法であり、セキュリティチェックリストを定義します。また、Common Platform Enumeration (CPE)、Common Configuration Enumeration (CCE)、Open Vulnerability and Assessment Language (OVAL)などの他の仕様と組み合わせて、SCAP検証済みの製品で処理できるSCAP表現のチェックリストを作成します。
OpenSCAPはSUSEセキュリティチームが作成したコンテンツを使用して、パッチの存在を確認します。 OpenSCAPは、システムセキュリティ設定をチェックし、標準と仕様に基づいたルールを使用して、システムに侵害の兆候がないかどうかを検査します。 SUSEセキュリティチームの詳細については、https://www.suse.com/support/securityを参照してください。
2. SCAPスキャンのためのクライアントの準備
開始する前に、SCAPスキャン用にクライアントシステムを準備する必要があります。
|
OpenSCAP監査は、SSH接続メソッドを使用するSaltクライアントでは使用できません。 |
|
スキャンクライアントは、スキャンするクライアントのメモリと計算能力を大量に消費する可能性があります。 Red Hatクライアントの場合、スキャンする各クライアントで少なくとも2GBのRAMが使用可能であることを確認してください。 |
開始する前にOpenSCAPスキャナとSCAPセキュリティガイド(コンテンツ)パッケージをインストールしてください。オペレーティングシステムに応じて、これらのパッケージはベースオペレーティングシステムまたはSUSE Multi-Linux Managerクライアントツールのいずれかに含まれています。
次の表に、必要なパッケージを一覧表示します。
| オペレーティングシステム | スキャナ | コンテンツ |
|---|---|---|
SLES |
openscap-utils |
scap-security-guide |
openSUSE |
openscap-utils |
scap-security-guide |
RHEL |
openscap-utils |
scap-security-guide-redhat |
CentOS |
openscap-utils |
scap-security-guide-redhat |
Oracle Linux |
openscap-utils |
scap-security-guide-redhat |
Ubuntu |
libopenscap8 |
scap-security-guide-ubuntu |
Debian |
libopenscap8 |
scap-security-guide-debian |
RHEL 7および互換システムでは、scap-security-guideパッケージが提供されています。このパッケージには、古い内容が含まれています。 SUSE Multi-Linux Managerクライアントツールにあるscap-security-guide-redhatパッケージを使用することをお勧めします。
|
SUSEは、異なるOpenSCAPプロファイル用の
SUSE以外のオペレーティングシステムの場合、含まれるプロファイルはコミュニティが提供します。 これらはSUSEによって公式にサポートされていません。 |
3. OpenSCAPコンテンツファイル
OpenSCAPは、SCAPコンテンツファイルを使用してテストルールを定義します。 これらのコンテンツファイルは、XCCDFまたはOVAL標準に基づいて作成されます。 『SCAPセキュリティガイド』に加えて、公開されているコンテンツファイルをダウンロードして、要件に合わせてカスタマイズできます。 デフォルトのコンテンツファイルテンプレート用のSCAPセキュリティガイドパッケージをインストールできます。 または、XCCDFまたはOVALに精通している場合は、独自のコンテンツファイルを作成できます。
|
テンプレートを使用してSCAPコンテンツファイルを作成することをお勧めします。 独自のカスタムコンテンツファイルを作成して使用する場合は、自己責任で作成してください。 カスタムコンテンツファイルを使用してシステムが破損した場合、SUSEのサポートを受けられない可能性があります。 |
コンテンツファイルを作成したら、ファイルをクライアントに転送する必要があります。 これは、物理的なストレージメディアを使用して他のファイルを移動するのと同じ方法で行うことができます。または、Salt (たとえば、salt-cpやSalt File Server)、ftpやscpを使用してネットワークを介して移動することもできます。
|
If you use the Enhanced SCAP Auditing (Beta) features, you do not need to manually transfer content files. The server automatically deploys the required DataStreams and tailoring files to the client at runtime. |
SUSE Multi-Linux Managerで管理しているクライアントにコンテンツファイルを配布するパッケージを作成することをお勧めします。 パッケージの整合性を確認するために、パッケージに署名して検証することができます。 詳細については、カスタムチャンネルを参照してください。
4. OpenSCAPプロファイルの検索
オペレーティングシステムによって、使用可能なOpenSCAPコンテンツファイルとプロファイルが異なります。 1つのコンテンツファイルに複数のプロファイルを含めることができます。
RPMベースのオペレーティングシステムでは、次のコマンドを使用して、使用可能なSCAPファイルの場所を決定します。
rpm -ql <scap-security-guide-package-name-from-table>
DEBベースのオペレーティングシステムでは、次のコマンドを使用して、使用可能なSCAPファイルの場所を決定します。
dpkg -L <scap-security-guide-package-name-from-table>
ニーズに合う1つの SCAPコンテンツファイルを特定したら、クライアントに使用可能なプロファイルを一覧にします。
oscap info /usr/share/xml/scap/ssg/content/ssg-sle15-ds.xml
Document type: Source Data Stream
Imported: 2021-03-24T18:14:45
Stream: scap_org.open-scap_datastream_from_xccdf_ssg-sle15-xccdf-1.2.xml
Generated: (null)
Version: 1.2
Checklists:
Ref-Id: scap_org.open-scap_cref_ssg-sle15-xccdf-1.2.xml
Status: draft
Generated: 2021-03-24
Resolved: true
Profiles:
Title: CIS SUSE Linux Enterprise 15 Benchmark
Id: xccdf_org.ssgproject.content_profile_cis
Title: Standard System Security Profile for SUSE Linux Enterprise 15
Id: xccdf_org.ssgproject.content_profile_standard
Title: DISA STIG for SUSE Linux Enterprise 15
Id: xccdf_org.ssgproject.content_profile_stig
Referenced check files:
ssg-sle15-oval.xml
system: http://oval.mitre.org/XMLSchema/oval-definitions-5
ssg-sle15-ocil.xml
system: http://scap.nist.gov/schema/ocil/2
https://ftp.suse.com/pub/projects/security/oval/suse.linux.enterprise.15.xml
system: http://oval.mitre.org/XMLSchema/oval-definitions-5
Checks:
Ref-Id: scap_org.open-scap_cref_ssg-sle15-oval.xml
Ref-Id: scap_org.open-scap_cref_ssg-sle15-ocil.xml
Ref-Id: scap_org.open-scap_cref_ssg-sle15-cpe-oval.xml
Dictionaries:
Ref-Id: scap_org.open-scap_cref_ssg-sle15-cpe-dictionary.xml
スキャンを実行するためのファイルパスとプロファイルをメモします。
5. 監査スキャンの実行
コンテンツファイルをインストールまたは転送したら、監査スキャンを実行できます。 監査スキャンは、SUSE Multi-Linux Manager Web UIを使用してトリガできます。 SUSE Multi-Linux Manager APIを使用して、定期的なスキャンをスケジュールすることもできます。
SUSE Multi-Linux Manager Web UIで、に移動して、スキャンするクライアントを選択します。
[
監査]タブ、および[スケジュール]サブタブに移動します。[
XCCDFドキュメントへのパス]フィールドに、クライアントで使用するSCAPテンプレートとプロファイルのパラメータを入力します。 例:
Command: /usr/bin/oscap xccdf eval
Command-line arguments: --profile xccdf_org.ssgproject.content_profile_stig
Path to XCCDF document: /usr/share/xml/scap/ssg/content/ssg-sle15-ds.xml
--fetch-remote-resourcesパラメータを使用する場合は、大量のRAMが必要です。 さらに、file_recv_max_sizeの値を増やす必要がある場合があります。スキャンは、クライアントの次にスケジュールされた同期時に実行されます。
|
XCCDFコンテンツファイルはリモートシステムで実行される前に検証されます。 コンテンツファイルに無効な引数が含まれている場合は、テストに失敗します。 |
開始する前に、スキャンするクライアントにPythonおよびXML-RPCライブラリがインストールされていることを確認します。
既存のスクリプトを選択するか、
system.scap.scheduleXccdfScanを使用してシステムスキャンをスケジュールするスクリプトを作成します。 例:#!/usr/bin/python3 import xmlrpc.client client = xmlrpc.client.ServerProxy('https://server.example.com/rpc/api') key = client.auth.login('username', 'password') client.system.scap.scheduleXccdfScan(key, <1000010001>, '<path_to_xccdf_file.xml>', '--profile <profile_name>') client.auth.logout(session_key)この例では:
<1000010001>はシステムID (sid)です。
<path_to_xccdf_file.xml>は、クライアント上のコンテンツファイルの場所へのパスです。 たとえば、/usr/share/xml/scap/ssg/content/ssg-sle15-ds.xml。
<profile_name>はoscapコマンドの追加の引数です。 たとえば、united_states_government_configuration_baseline(USGCB)を使用します。コマンドプロンプトから、スキャンするクライアント上でスクリプトを実行します。
6. スキャン結果
Information about the scans you have run is in the SUSE Multi-Linux Manager Web UI. Navigate to for a table of results. For more information about the data in this table, see All Scans.
スキャンに関する詳細情報を使用できるようにするには、クライアントで有効にする必要があります。 SUSE Multi-Linux Manager Web UIで、に移動し、クライアントが属する組織をクリックします。 [設定]タブに移動し、[詳細なSCAPファイルのアップロードを有効にする]オプションをオンにします。 有効にすると、スキャンごとに、追加情報を含む追加のHTMLファイルが生成されます。 結果には、次のような追加の行が表示されます。
Detailed Results: xccdf-report.html xccdf-results.xml scap-yast2sec-oval.xml.result.xml
コマンドラインからスキャン情報を取得するには、spacewalk-reportコマンドを使用します。
spacewalk-report system-history-scap spacewalk-report scap-scan spacewalk-report scap-scan-results
SUSE Multi-Linux Manager APIを使用して、system.scapハンドラを使用して結果を表示することもできます。
7. 修復
Remediation Bash scripts and Ansible playbooks are provided in the same SCAP Security Guide packages to harden the client systems.
|
If you have the beta SCAP features enabled, you can apply remediation directly from scan results in the Web UI, including custom per-rule remediation scripts. See Enhanced SCAP Auditing - Remediation. |
例:
/usr/share/scap-security-guide/bash/sle15-script-cis.sh /usr/share/scap-security-guide/bash/sle15-script-standard.sh /usr/share/scap-security-guide/bash/sle15-script-stig.sh
/usr/share/scap-security-guide/ansible/sle15-playbook-cis.yml /usr/share/scap-security-guide/ansible/sle15-playbook-standard.yml /usr/share/scap-security-guide/ansible/sle15-playbook-stig.yml
クライアントシステムでAnsibleを有効にした後、リモートコマンドまたはAnsibleを使用して実行できます。
7.1. Bashスクリプトを使用して修復を実行する
scap-security-guideパッケージをすべてのターゲットシステムにインストールします。 詳細については、Ansible制御ノードのセットアップを参照してください。
パッケージ、チャンネル、スクリプトは、オペレーティングシステムと配布ごとに異なります。 修復Bashスクリプトの例セクションに例を一覧表示しています。
7.1.1. リモートコマンドとして単一システムでBashスクリプトを実行する
単一システムでリモートコマンドとしてBashスクリプトを実行します。
-
タブから、インスタンスを選択します。 次に、で、Bashスクリプトを次のように記述します。
#!/bin/bash chmod +x -R /usr/share/scap-security-guide/bash /usr/share/scap-security-guide/bash/sle15-script-stig.sh
-
Schedule をクリックします。
|
配布とバージョンの間でフォルダ名とスクリプト名が変わります。 修復Bashスクリプトの例セクションに例を一覧表示しています。 |
7.1.2. 複数のシステムでシステムセットマネージャを使用してbashスクリプトを実行する
複数のシステムでリモートコマンドとして一度にBashスクリプトを実行します。
-
システムグループが作成されたら[
システムグループ]をクリックし、テーブルから[SSM で 使用]を選択します。 -
[
システムセットマネージャ]から、の下で、次のようなBashスクリプトを記述します。#!/bin/bash chmod +x -R /usr/share/scap-security-guide/bash /usr/share/scap-security-guide/bash/sle15-script-stig.sh
-
Schedule をクリックします。
7.2. 修復Bashスクリプトの例
7.2.1. SUSE Linux Enterprise openSUSEおよび亜種
SUSE Linux EnterpriseおよびopenSUSEスクリプトデータの例。
- パッケージ
-
scap-security-guide
- チャンネル
-
-
SLE12: SLES12 Updates
-
SLE15: SLES15 Module Basesystem Updates
-
- Bashスクリプトディレクトリ
-
/usr/share/scap-security-guide/bash/ - Bashスクリプト
-
opensuse-script-standard.sh sle12-script-standard.sh sle12-script-stig.sh sle15-script-cis.sh sle15-script-standard.sh sle15-script-stig.sh
7.2.2. Red Hat Enterprise LinuxおよびCentOS Bashスクリプトデータ
Red Hat Enterprise LinuxおよびCentOSスクリプトデータの例。
|
centos7-updatesの |
- パッケージ
-
scap-security-guide-redhat
- チャンネル
-
-
SUSE Managerツール
-
- Bashスクリプトディレクトリ
-
/usr/share/scap-security-guide/bash/ - Bashスクリプト
-
centos7-script-pci-dss.sh centos7-script-standard.sh centos8-script-pci-dss.sh centos8-script-standard.sh fedora-script-ospp.sh fedora-script-pci-dss.sh fedora-script-standard.sh ol7-script-anssi_nt28_enhanced.sh ol7-script-anssi_nt28_high.sh ol7-script-anssi_nt28_intermediary.sh ol7-script-anssi_nt28_minimal.sh ol7-script-cjis.sh ol7-script-cui.sh ol7-script-e8.sh ol7-script-hipaa.sh ol7-script-ospp.sh ol7-script-pci-dss.sh ol7-script-sap.sh ol7-script-standard.sh ol7-script-stig.sh ol8-script-anssi_bp28_enhanced.sh ol8-script-anssi_bp28_high.sh ol8-script-anssi_bp28_intermediary.sh ol8-script-anssi_bp28_minimal.sh ol8-script-cjis.sh ol8-script-cui.sh ol8-script-e8.sh ol8-script-hipaa.sh ol8-script-ospp.sh ol8-script-pci-dss.sh ol8-script-standard.sh rhel7-script-anssi_nt28_enhanced.sh rhel7-script-anssi_nt28_high.sh rhel7-script-anssi_nt28_intermediary.sh rhel7-script-anssi_nt28_minimal.sh rhel7-script-C2S.sh rhel7-script-cis.sh rhel7-script-cjis.sh rhel7-script-cui.sh rhel7-script-e8.sh rhel7-script-hipaa.sh rhel7-script-ncp.sh rhel7-script-ospp.sh rhel7-script-pci-dss.sh rhel7-script-rhelh-stig.sh rhel7-script-rhelh-vpp.sh rhel7-script-rht-ccp.sh rhel7-script-standard.sh rhel7-script-stig_gui.sh rhel7-script-stig.sh rhel8-script-anssi_bp28_enhanced.sh rhel8-script-anssi_bp28_high.sh rhel8-script-anssi_bp28_intermediary.sh rhel8-script-anssi_bp28_minimal.sh rhel8-script-cis.sh rhel8-script-cjis.sh rhel8-script-cui.sh rhel8-script-e8.sh rhel8-script-hipaa.sh rhel8-script-ism_o.sh rhel8-script-ospp.sh rhel8-script-pci-dss.sh rhel8-script-rhelh-stig.sh rhel8-script-rhelh-vpp.sh rhel8-script-rht-ccp.sh rhel8-script-standard.sh rhel8-script-stig_gui.sh rhel8-script-stig.sh rhel9-script-pci-dss.sh rhosp10-script-cui.sh rhosp10-script-stig.sh rhosp13-script-stig.sh rhv4-script-pci-dss.sh rhv4-script-rhvh-stig.sh rhv4-script-rhvh-vpp.sh sl7-script-pci-dss.sh sl7-script-standard.sh
7.2.3. Ubuntu Bashスクリプトデータ
Ubuntuスクリプトデータの例。
- パッケージ
-
scap-security-guide-ubuntu
- チャンネル
-
-
SUSE Managerツール
-
- Bashスクリプトディレクトリ
-
/usr/share/scap-security-guide/ - Bashスクリプト
-
ubuntu1804-script-anssi_np_nt28_average.sh ubuntu1804-script-anssi_np_nt28_high.sh ubuntu1804-script-anssi_np_nt28_minimal.sh ubuntu1804-script-anssi_np_nt28_restrictive.sh ubuntu1804-script-cis.sh ubuntu1804-script-standard.sh ubuntu2004-script-standard.sh
7.2.4. Debian Bashスクリプトデータ
Debianスクリプトデータの例。
- パッケージ
-
scap-security-guide-debian
- チャンネル
-
-
SUSE Managerツール
-
- Bashスクリプトディレクトリ
-
/usr/share/scap-security-guide/bash/ - Bashスクリプト
-
# Debian 12 debian12-script-anssi_np_nt28_average.sh debian12-script-anssi_np_nt28_high.sh debian12-script-anssi_np_nt28_minimal.sh debian12-script-anssi_np_nt28_restrictive.sh debian12-script-standard.sh