1.7. sos レポートの生成と、キーペアをベースにした GPG 暗号化によるセキュリティー保護
この手順では、sos レポートを生成し、GPG キーリングからのキーペアをベースにする GPG2 暗号化を使用してセキュリティーを確保する方法を説明します。サーバーに保存されている sos レポートを保護する場合など、この種類の暗号化を使用して sos レポートのコンテンツを保護できます。
暗号化した sos レポートを作成する場合には、ディスク領域の倍の容量を一時的に使用するため、十分な領域を確保してください。
-
sosユーティリティーは、暗号化されていないsosレポートを作成します。 -
このユーティリティーは、
sosレポートを新しいファイルとして暗号化します。 - 次に、ユーティリティーは暗号化されていないアーカイブを削除します。
前提条件
-
sosをインストールしている。 -
root権限がある。 - GPG2 キーを作成している。
手順
sos reportコマンドを実行し、--encrypt-keyオプションを使用して GPG キーリングを所有するユーザー名を指定します。--uploadオプションを追加すると、sosレポートの生成直後にレポートを Red Hat に転送できます。注記sos reportコマンドを実行するユーザーは、sosレポートの暗号化と復号化に使用する GPG キーリングを所有するユーザーと同じである 必要があります。ユーザーがsudoを使用してsos reportコマンドを実行する場合は、キーリングもsudoを使用して設定するか、ユーザーがそのアカウントへの直接シェルアクセス権を持っている必要があります。[user@server1 ~]$ sudo sos report --encrypt-key root [sudo] password for user: sosreport (version 4.2) This command will collect diagnostic and configuration information from this Red Hat Enterprise Linux system and installed applications. An archive containing the collected information will be generated in /var/tmp/sos.6ucjclgf and may be provided to a Red Hat support representative. ... Press ENTER to continue, or CTRL-C to quit.オプション: Red Hat でテクニカルサポートケースをすでに作成している場合には、ケース番号を入力して
sosレポートファイルの名前に追加します。--uploadオプションを指定している場合は、対象のケースにアップロードされます。ケース番号がない場合は、このフィールドを空白にしておきます。ケース番号の入力は任意であるため、sosユーティリティーの動作には影響はありません。Please enter the case id that you are generating this report for []: <8-digit_case_number>コンソール出力の末尾に表示されている
sosレポートファイルの名前を書き留めておきます。... Finished running plugins Creating compressed archive... Your sosreport has been generated and saved in: /var/tmp/secured-sosreport-server1-23456789-2022-02-27-zhdqhdi.tar.xz.gpg Size 15.44MiB Owner root sha256 bf303917b689b13f0c059116d9ca55e341d5fadcd3f1473bef7299c4ad2a7f4f Please send this file to your support representative.
検証
sosユーティリティーによって、次の要件を満たすアーカイブが作成されたことを確認します。-
ファイル名が
securedで始まる。 -
ファイル名が
.gpg拡張子で終わる。 /var/tmp/ディレクトリーにある。[user@server1 ~]$ sudo ls -l /var/tmp/sosreport* [sudo] password for user: -rw-------. 1 root root 16190013 Jan 24 17:55 /var/tmp/secured-sosreport-server1-23456789-2022-01-27-zhdqhdi.tar.xz.gpg
-
ファイル名が
暗号化に使用したキーと同じキーでアーカイブを復号できることを確認します。
gpgを使用して、アーカイブを復号します。[user@server1 ~]$ sudo gpg --output decrypted-sosreport.tar.gz --decrypt /var/tmp/secured-sosreport-server1-23456789-2022-01-27-zhdqhdi.tar.xz.gpgプロンプトが表示されたら、GPG キーの作成に使用したパスフレーズを入力します。
┌────────────────────────────────────────────────────────────────┐ │ Please enter the passphrase to unlock the OpenPGP secret key: │ │ "GPG User (first key) <root@example.com>" │ │ 2048-bit RSA key, ID BF28FFA302EF4557, │ │ created 2020-01-13. │ │ │ │ │ │ Passphrase: <passphrase> │ │ │ │ <OK> <Cancel> │ └────────────────────────────────────────────────────────────────┘gpgユーティリティーが、暗号化されていない、ファイル拡張子が.tar.gzのアーカイブを生成したことを確認します。[user@server1 ~]$ sudo ll decrypted-sosreport.tar.gz [sudo] password for user: -rw-r--r--. 1 root root 16190013 Jan 27 17:47 decrypted-sosreport.tar.gz