OpenSCAPによるシステムセキュリティ
SUSE Multi-Linux ManagerはOpenSCAPを使用してクライアントを監査します。 任意のクライアントのコンプライアンススキャンをスケジュールして表示できます。
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 and compatible systems provide a scap-security-guide package, which contains outdated contents. You are advised to use the scap-security-guide-redhat package you will find in the SUSE Multi-Linux Manager Client Tools.
|
SUSE provides the
SUSE以外のオペレーティングシステムの場合、含まれるプロファイルはコミュニティが提供します。 これらはSUSEによって公式にサポートされていません。 |
3. OpenSCAPコンテンツファイル
OpenSCAPは、SCAPコンテンツファイルを使用してテストルールを定義します。 これらのコンテンツファイルは、XCCDFまたはOVAL標準に基づいて作成されます。 『SCAPセキュリティガイド』に加えて、公開されているコンテンツファイルをダウンロードして、要件に合わせてカスタマイズできます。 デフォルトのコンテンツファイルテンプレート用のSCAPセキュリティガイドパッケージをインストールできます。 または、XCCDFまたはOVALに精通している場合は、独自のコンテンツファイルを作成できます。
|
テンプレートを使用してSCAPコンテンツファイルを作成することをお勧めします。 独自のカスタムコンテンツファイルを作成して使用する場合は、自己責任で作成してください。 カスタムコンテンツファイルを使用してシステムが破損した場合、SUSEのサポートを受けられない可能性があります。 |
When you have created your content files, you need to transfer the file to the client. You can do this in the same way as you move any other file, using physical storage media, or across a network with Salt (for example, salt-cp or the Salt File Server), ftp or scp.
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で、に移動して、スキャンするクライアントを選択します。
Navigate to the
Audittab, and theSchedulesubtab.In the
Path to XCCDF Documentfield, enter the parameters for the SCAP template and profile you want to use on the client. For example:
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
If you use
--fetch-remote-resourcesparameter a lot of RAM is required. In addition, you may need to increase the value offile_recv_max_size.スキャンは、クライアントの次にスケジュールされた同期時に実行されます。
|
XCCDFコンテンツファイルはリモートシステムで実行される前に検証されます。 コンテンツファイルに無効な引数が含まれている場合は、テストに失敗します。 |
開始する前に、スキャンするクライアントにPythonおよびXML-RPCライブラリがインストールされていることを確認します。
Choose an existing script or create a script for scheduling a system scan through
system.scap.scheduleXccdfScan. For example:#!/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>is the system ID (sid).
<path_to_xccdf_file.xml>is the path to the content file location on the client. For example,/usr/share/xml/scap/ssg/content/ssg-sle15-ds.xml.
<profile_name>is an additional argument for theoscapcommand. For example, useunited_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.
To ensure that detailed information about scans is available, you need to enable it on the client. In the SUSE Multi-Linux Manager Web UI, navigate to and click on the organization the client is a part of. Navigate to the Configuration tab, and check the Enable Upload of Detailed SCAP Files option. When enabled, this generates an additional HTML file on every scan, which contains extra information. The results show an extra line similar to this:
Detailed Results: xccdf-report.html xccdf-results.xml scap-yast2sec-oval.xml.result.xml
To retrieve scan information from the command line, use the spacewalk-report command:
spacewalk-report system-history-scap spacewalk-report scap-scan spacewalk-report scap-scan-results
You can also use the SUSE Multi-Linux Manager API to view results, with the system.scap handler.
7. Removing SCAP Scan Results
Only SCAP scans that have passed the configured retention period can be deleted. You can configure the retention period in the Organization Configuration section.
Navigate to .
Under
SCAP, checkAllow Deletion of SCAP Results.Enter a number of days in
Allow Deletion After(default is 90).
Navigate to .
Select the checkbox for the scan or scans you want to delete.
Click Confirm.
8. 修復
クライアントシステムを強化するために、修復用のBashスクリプトとAnsible playbookが同じSCAPセキュリティガイドパッケージで提供されます。 例:
/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を使用して実行できます。
8.1. Bashスクリプトを使用して修復を実行する
Install the scap-security-guide package on all your target systems. For more information, see Ansible制御ノードのセットアップ.
パッケージ、チャンネル、スクリプトは、オペレーティングシステムと配布ごとに異なります。 修復Bashスクリプトの例セクションに例を一覧表示しています。
8.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スクリプトの例セクションに例を一覧表示しています。 |
8.1.2. 複数のシステムでシステムセットマネージャを使用してbashスクリプトを実行する
複数のシステムでリモートコマンドとして一度にBashスクリプトを実行します。
-
When a system group has been created click
System Groups, selectUse in SSMfrom the table. -
From the
System Set Manager, under , write a Bash script such as:#!/bin/bash chmod +x -R /usr/share/scap-security-guide/bash /usr/share/scap-security-guide/bash/sle15-script-stig.sh
-
Schedule をクリックします。
8.2. 修復Bashスクリプトの例
8.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
8.2.2. Red Hat Enterprise LinuxおよびCentOS Bashスクリプトデータ
Red Hat Enterprise LinuxおよびCentOSスクリプトデータの例。
|
|
- パッケージ
-
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
8.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
8.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