Zu den Hauptinhalten
  • Bestellungen schnell und einfach aufgeben
  • Bestellungen anzeigen und den Versandstatus verfolgen
  • Profitieren Sie von exklusiven Prämien und Rabatten für Mitglieder
  • Erstellen Sie eine Liste Ihrer Produkte, auf die Sie jederzeit zugreifen können.

Data Protection Advisor:Apache Log4j脆弱性を手動修復するWindows PowerShellスクリプト(CVE-2021-44228、CVE-2021-45046)

Zusammenfassung: この記事では、Apache Log4jの脆弱性(CVE-2021-44228およびCVE-2021-45046)の影響を受けるMicrosoft Windowsノードで実行されているDPAエージェントを手動で修復する手順について説明します。

Dieser Artikel gilt für Dieser Artikel gilt nicht für Dieser Artikel ist nicht an ein bestimmtes Produkt gebunden. In diesem Artikel werden nicht alle Produktversionen aufgeführt.

Weisungen

この修復には、ネイティブのWindowsスクリプト コマンドを使用するWindows PowerShellスクリプトを活用する必要があります。

これらの手順は、DPAアプリケーション、DPAデータストア、スタンドアロンDPAエージェント(サーバーまたは別のタイプのアプリケーション サーバーに単独でインストール)を含む、あらゆるタイプのWindows DPAインストールに適用できます。

Apache Log4jの脆弱性の詳細については、以下のDell Security Advisoryを参照してください。

これらの手順に関する質問やサポートについては、Dellテクニカル サポートにお問い合わせください。

手動による修復の手順:
メモ:

  • これらの手順では、WindowsのインストールにPowerShellがインストールされていて使用可能であることが必要です(デフォルト)。
  • Windows管理者権限とアクセス権が必要です。

 

  1. このKB記事に添付されているテキスト ファイル(log4j_jndiremoval.txt)をダウンロードします。

注:または、log4j_jndiremoval.txtファイルのフル テキストは、これらの手順の最後に提供され、テキスト ファイルにコピーして貼り付けることができます。

  1. 影響を受けるWindowsノードにテキスト ファイルをコピーまたは移動します。
  2. テキスト ファイルの名前を変更し、ファイル拡張子を.txtから.ps1に変更します。注:ファイルの名前を変更する前に、Windowsエクスプローラーのフォルダー オプションの[表示]に移動し、チェックボックスをオンにして「ファイル名の拡張子」を表示する必要がある場合があります。
  3. Windows PowerShellウィンドウを開きます。メニューから[検索]をクリックし、「PowerShell」と入力します。「Windows PowerShell」が表示されます。Windows PowerShellを右クリックして、「管理者として実行」を選択します。

pic_01.JPG

 

  1. DPAエージェント サービスを停止します。Windows Servicesスナップインを使用するか、Windows PowerShellのコマンド ラインを使用してこれを実行します。

Windows PowerShellウィンドウで、DPAアプリケーションまたはDPAデータストアにエージェントをインストールする場合、コマンドは次のようになります。

dpa agent stop

Windows PowerShellウィンドウで、スタンドアロンDPAエージェントをインストールする場合、コマンドは次のようになります。

<dpaエージェントのインストール パス>\dpa stop

Example:   
C:\Program Files\EMC\DPA\agent\etc\dpa stop

  1. Windows PowerShellウィンドウで、スクリプト ファイルのあるディレクトリーにディレクトリーを変更します。

pic_03.JPG

 

  1. PowerShellウィンドウで、「verify」オプションを使用してスクリプトを実行します。これは、影響を受けるファイルをスキャンして検証します。コマンドは次のとおりです。    
.\log4j_jndiremoval.ps1 -verify

pic_04.JPG

  1. Enterを押すと、スクリプトが実行され、DPAインストールへのパスを求めるプロンプトが表示されます。DPAインストールへのフル パスを入力します。

pic_06.JPG

 

  1. Enterを押すと、スクリプトが実行され、脆弱なファイルが特定されます。

pic_07.JPG

 

  1. PowerShellウィンドウで、「verify」オプションを省略してスクリプトを再実行します。このモードでは、影響を受けるファイルがスキャンされ、修正されます。コマンドは次のとおりです。   
.\log4j_jndiremoval.ps1

注:DPAのインストール パスを再度入力する必要があります。

pic_09.JPG

 

  1. Enterを押すと、スクリプトは脆弱性のあるファイルをスキャンして修正します。

pic_10.JPG

 

  1. この時点で、修復は完了です。
  2. オプションの手順として、スクリプトを再度実行して再確認します。PowerShellウィンドウで、「verify」オプションを使用してスクリプトを実行します。このオプションでは、影響を受けるファイルがスキャンされて検証されます。コマンドは次のとおりです。
.\log4j_jndiremoval.ps1 -verify

pic_14.JPG

 

  1. DPAエージェント サービスを開始します。これは、Windows Servicesスナップインを使用するか、Windows PowerShellを使用してコマンド ラインから実行できます。

Windows PowerShellウィンドウで、DPAアプリケーションまたはDPAデータストアにエージェントをインストールする場合、コマンドは次のようになります。

dpa agent start

Windows PowerShellウィンドウで、スタンドアロンDPAエージェントをインストールする場合、コマンドは次のようになります。

<dpaエージェントのインストール パス>\dpa start

Example:   
C:\Program Files\EMC\DPA\agent\etc\dpa start

 

付録:
以下は、PowerShellスクリプトの完全なテキストです。このKBに添付されたファイルにアクセスできない場合は、上記の手順で使用するために、このテキストをコピーして、そのままテキスト ファイル(.txt)に貼り付けることができます。

param ( [switch]$verify ) '--------------------------------------------------------------------------' '--------------------------------------------------------------------------' ' Data Protection Advisor CVE-2021-44228, CVE-2021-45046 Patcher 1.1 ' ' Developer : Pankaj Pande(p.pande@dell.com) ' ' Release : 29 Dec 2021 ' '--------------------------------------------------------------------------' 'Welcome to CVE-2021-44228, CVE-2021-45046 Patching Tool.' 'This utility will assist you in patching Data Protection Advisor for CVE-2021-44228 and CVE-2021-45046 on a Windows system.' "Special Note : The tool automates remediation steps for all internal components. Following remediation, validation checks are also run. While this tool remediates these vulnerabilities, all available information from Apache on log4j continues to be monitored. If new CVEs are discovered, Dell Technologies' Engineering teams will clarify impact and new remediation steps where necessary. If needed this tool will be updated to include the new remediation steps." '---------------------------------------------------------------------------' function List-JndiLookup { Param ( [string[]]$JarFiles, [string] $FilenameToRemove ) #initiate the .net namespace add-type -AssemblyName 'System.IO.Compression.filesystem' "The number of files to be processed is : $($JarFiles.Count)" #list the files we are processing # them later foreach ($JarFile in $JarFiles) { "$JarFile" } $processedFiles = 0; $skippedFiles = 0; foreach ($JarFile in $JarFiles) { # Open the jar for updating (.jar files are just .zip files) try { $ProcessJarFile = [io.compression.zipfile]::Open($JarFile,'Update') } catch { # Error Handling } "Checking $JarFile for $FilenameToRemove" $totalFilesInJar = ($ProcessJarFile.Entries | Where FullName -Match $FilenameToRemove).Count if($totalFilesInJar -gt 0){ $processedFiles++ } #close Zip try { $ProcessJarFile.Dispose() } catch { # Error Handling } } if ( $processedFiles -gt 0) { Write-Host "$processedFiles file(s) found vulnerable" -fore red Write-Host "Finished...Please make sure to run the patching on this sytem" -fore red } else { Write-Host "$processedFiles file(s) found vulnerable" -fore green Write-Host "Finished...No Action needed" -fore green } } function Remove-JndiLookup { Param ( [string[]]$JarFiles, [string] $FilenameToRemove ) #initiate the .net namespace add-type -AssemblyName 'System.IO.Compression.filesystem' "The number of files to be processed is : $($JarFiles.Count)" #list the files we are processing # them later foreach ($JarFile in $JarFiles) { "$JarFile" } "Starting patching/Removel Process" $processedFiles = 0; $skippedFiles = 0; foreach ($JarFile in $JarFiles) { # Open the jar for updating (.jar files are just .zip files) try { $ProcessJarFile = [io.compression.zipfile]::Open($JarFile,'Update') } catch { # Error Handling } "Checking $JarFile for $FilenameToRemove" $totalFilesInJar = ($ProcessJarFile.Entries | Where FullName -Match $FilenameToRemove).Count if($totalFilesInJar -gt 0){ "Deleting unwanted file $FilenameToRemove from $JarFile" ($ProcessJarFile.Entries | Where FullName -Match $FilenameToRemove).Delete() $processedFiles++ } else { "File $FilenameToRemove not found inside $JarFile, this may have already been deleted." $skippedFiles++ } # Clean up / close the zip try { $ProcessJarFile.Dispose() } catch { # Error Handling } } "$processedFiles file(s) processed`n$skippedFiles file(s) skipped" Write-Host "Finished..." -fore green } if ( $verify ) { Write-Host "Running in dry-run mode. Will not process any files" -fore green } else { Write-Host "Running in fix mode. Will patch files that are found affected" -fore red } $dpa_path = Read-Host "Enter the DPA location " Write-Host "Running in : '$dpa_path' " -fore green if ($verify) { List-JndiLookup -JarFiles (Get-ChildItem -Exclude 'tmp' -Recurse -Path "$dpa_path" -Filter 'dpa*.jar' | ? { $_.FullName -inotmatch 'tmp' }).FullName -FilenameToRemove 'JndiLookup.class' } else { Remove-JndiLookup -JarFiles (Get-ChildItem -Exclude 'tmp' -Recurse -Path "$dpa_path" -Filter 'dpa*.jar' | ? { $_.FullName -inotmatch 'tmp' }).FullName -FilenameToRemove 'JndiLookup.class' }

 



これらの手順に関する質問やサポートについては、Dellテクニカル サポートにお問い合わせください。

Artikeleigenschaften
Artikelnummer: 000194869
Artikeltyp: How To
Zuletzt geändert: 18 Aug. 2022
Version:  4
Antworten auf Ihre Fragen erhalten Sie von anderen Dell NutzerInnen
Support Services
Prüfen Sie, ob Ihr Gerät durch Support Services abgedeckt ist.