Data Protection Advisor: Apache Log4j 취약성에 대한 수동 문제 해결 Windows PowerShell 스크립트(CVE-2021-44228, CVE-2021-45046)

Summary: 이 문서에서는 Apache Log4j 취약성(CVE-2021-44228 및 CVE-2021-45046)의 영향을 받는 Microsoft Windows 노드에서 실행되는 DPA 에이전트의 수동 문제 해결에 대한 지침을 제공합니다.

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Instructions

이 문제 해결에는 기본 Windows 스크립팅 명령을 사용하는 Windows PowerShell 스크립트를 활용하는 작업이 포함됩니다.

이러한 지침은 DPA 애플리케이션, DPA Datastore 및 독립 실행형 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 탐색기 폴더 옵션에서 View로 이동하여 "파일 이름 확장명"을 표시하는 확인란을 선택해야 할 수 있습니다.
  3. Windows PowerShell 창을 엽니다. 메뉴에서 Search를 클릭하고 PowerShell을 입력합니다. "Windows PowerShell"이 표시되어야 합니다. Windows PowerShell을 마우스 오른쪽 버튼으로 클릭하고 "Run as Administrator"를 선택합니다.

pic_01.JPG

 

  1. DPA Agent 서비스를 중지합니다. Windows 서비스 스냅인을 사용하거나 명령줄에서 Windows PowerShell을 사용하여 이 작업을 수행합니다.

Windows PowerShell 창에서 DPA 애플리케이션 또는 DPA Datastore에 Agent를 설치하는 경우 명령은 다음과 같습니다.

dpa agent stop

Windows PowerShell 창에서 독립 실행형 DPA 에이전트 설치인 경우 명령은 다음과 같습니다.

\dpa stop

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

  1. Windows PowerShell 창에서 디렉토리를 스크립트 파일이 있는 디렉토리로 변경합니다.

pic_03.JPG

 

  1. 영향을 받는 파일을 스캔하고 확인하는 확인 옵션을 사용하여 PowerShell 창에서 스크립트를 실행합니다. 명령은 다음과 같습니다.    
.\log4j_jndiremoval.ps1 -verify

pic_04.JPG

  1. 키를 누르면 스크립트가 실행되고 DPA 설치 경로를 묻는 메시지가 표시됩니다. DPA 설치의 전체 경로를 입력합니다.

pic_06.JPG

 

  1. 키를 누르면 스크립트가 실행되어 취약한 파일을 식별합니다.

pic_07.JPG

 

  1. Verify 옵션을 생략하고 PowerShell 창에서 스크립트를 다시 실행합니다. 이 모드에서는 스크립트가 영향을 받는 모든 파일을 스캔하여 수정합니다. 명령은 다음과 같습니다.   
.\log4j_jndiremoval.ps1

참고: DPA 설치 경로를 다시 입력해야 합니다.

pic_09.JPG

 

  1. 키를 누르면 스크립트가 발견된 취약한 파일을 스캔하고 수정합니다.

pic_10.JPG

 

  1. 이 시점에서 문제 해결이 완료됩니다.
  2. 선택적 단계로 스크립트를 다시 실행하여 다시 확인합니다. 영향을 받는 파일을 스캔하고 확인하는 Verify 옵션을 사용하여 PowerShell 창에서 스크립트를 실행합니다. 명령은 다음과 같습니다.
.\log4j_jndiremoval.ps1 -verify

pic_14.JPG

 

  1. DPA 에이전트 서비스를 시작합니다. 이 작업은 Windows 서비스 스냅인을 사용하거나 명령줄에서 Windows PowerShell을 사용하여 수행할 수 있습니다.

Windows PowerShell 창에서 DPA 애플리케이션 또는 DPA Datastore에 Agent를 설치하는 경우 명령은 다음과 같습니다.

dpa agent start

Windows PowerShell 창에서 독립 실행형 DPA 에이전트 설치인 경우 명령은 다음과 같습니다.

\dpa start

예:   
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 기술 지원 부서에 문의하십시오.

Article Properties
Article Number: 000194869
Article Type: How To
Last Modified: 18 Aug 2022
Version:  4
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.