

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# AWS Systems Manager를 사용하여 Windows 레지스트리 항목의 추가 또는 업데이트 자동화
<a name="automate-adding-or-updating-windows-registry-entries-using-aws-systems-manager"></a>

*Appasaheb Bagali, Amazon Web Services*

## 요약
<a name="automate-adding-or-updating-windows-registry-entries-using-aws-systems-manager-summary"></a>

AWS Systems Manager는 Amazon Elastic Compute Cloud(Amazon EC2) 인스턴스에 대한 원격 관리 도구입니다. Systems Manager는 Amazon Web Services의 인프라에 대한 가시성과 제어 기능을 제공합니다. 이 다용도 도구를 사용하여 보안 취약성 스캔 보고서에서 취약성으로 식별된 Windows 레지스트리 변경 사항을 수정할 수 있습니다. 

이 패턴은 환경 안전을 위해 권장되는 레지스트리 변경을 자동화하여 Windows 운영 체제를 실행하는 EC2 인스턴스의 보안을 유지하는 단계를 다룹니다. 이 패턴은 Run Command를 사용하여 명령 문서를 실행합니다. 코드가 연락되어 있으며 코드 일부가 *코드* 섹션에 포함되어 있습니다.

## 사전 조건 및 제한 사항
<a name="automate-adding-or-updating-windows-registry-entries-using-aws-systems-manager-prereqs"></a>
+ 활성 상태의 AWS 계정
+ EC2 인스턴스 및 Systems Manager에 액세스할 수 있는 권한

## 아키텍처
<a name="automate-adding-or-updating-windows-registry-entries-using-aws-systems-manager-architecture"></a>

**대상 기술 스택**
+ 두 개의 서브넷과 Network Address Translation(NAT) 게이트웨이가 있는 Virtual Private Cloud(VPC)
+ 레지스트리 이름 및 값을 추가하거나 업데이트하기 위한 Systems Manager 명령 문서
+ 정된 EC2 인스턴스에서 명령 문서를 실행하기 위한 Systems Manager Run Command

**대상 아키텍처**

![\[AWS Systems Manager를 사용하여 Windows 레지스트리 항목의 추가 또는 업데이트 자동화하는 방법.\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/images/pattern-img/2ecf680d-9f36-4070-8a19-2af262db7fcc/images/c992bcb0-d894-4aa7-9bb3-3d60c9c79e8d.png)


 

## 도구
<a name="automate-adding-or-updating-windows-registry-entries-using-aws-systems-manager-tools"></a>

**도구**
+ [IAM 정책 및 역할](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html) - AWS Identity and Access Management(IAM)는 AWS 리소스에 대한 사용자의 액세스를 안전하게 제어할 수 있게 지원하는 웹 서비스입니다. IAM을 사용하여 리소스를 사용하도록 인증(로그인) 및 권한 부여(권한 있음)된 대상을 제어합니다.
+ [Amazon Simple Storage Service](https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html) - Amazon Simple Storage Service(S3)는 인터넷 스토리지 서비스입니다. 이 서비스는 개발자가 더 쉽게 웹 규모 컴퓨팅 작업을 수행할 수 있도록 설계되었습니다. 이 패턴에서 S3 버킷은 Systems Manager 로그를 저장하는 데 사용됩니다.
+ [AWS Systems Manager](https://docs.aws.amazon.com/systems-manager/latest/userguide/what-is-systems-manager.html) - AWS Systems Manager는 AWS에서 인프라를 보고 제어하기 위해 사용할 수 있는 AWS 서비스입니다. Systems Manager는 *관리형 인스턴스*를 검사하고 탐지된 정책 위반을 보고(또는 시정 조치)함으로써 보안 및 규정 준수를 유지하는 데 도움이 됩니다.
+ [AWS Systems Manager 명령 문서](https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-ssm-docs.html) — AWS Systems Manager 명령 문서는 Run Command에 사용됩니다. 대부분의 명령 문서는 Systems Manager에서 지원하는 모든 Linux 및 Windows 서버 운영 체제에서 지원됩니다.
+ [AWS Systems Manager Run Command](https://docs.aws.amazon.com/systems-manager/latest/userguide/execute-remote-commands.html) — AWS Systems Manager Run Command를 사용하면 관리형 인스턴스의 구성을 원격으로 안전하게 관리할 수 있습니다. Run Command를 사용하면 일반적인 관리 작업을 자동화하고 일회성 구성 변경을 대규모로 수행할 수 있습니다.

**코드**

다음 예제 코드를 사용하여 Microsoft Windows 레지스트리 이름을 `Version`에, 레지스트리 경로를 `HKCU:\Software\ScriptingGuys\Scripts`에, 그리고 값을 `2`에 추가하거나 업데이트할 수 있습니다.

```
#Windows registry path which needs to add/update
$registryPath ='HKCU:\\Software\\ScriptingGuys\\Scripts'
#Windows registry Name  which needs to add/update
$Name = 'Version'
#Windows registry value  which needs to add/update
$value = 2
# Test-Path cmdlet to see if the registry key exists. 
IF(!(Test-Path $registryPath))
        {
           New-Item -Path $registryPath -Force | Out-Null
           New-ItemProperty -Path $registryPath -Name $name -Value     $value ` -PropertyType DWORD -                 Force | Out-        Null 
        } ELSE {
                      New-ItemProperty -Path $registryPath -Name $name -Value $value ` -PropertyType            DWORD        -Force | Out-Null
            }
echo 'Registry Path:'$registryPath
 echo 'Registry Name:'$registryPath
 echo 'Registry Value:'(Get-ItemProperty -Path $registryPath -Name $Name).version
```

전체 Systems Manager 명령 문서 JavaScript Object Notation(JSON) 코드 예제가 첨부되어 있습니다. 

## 에픽
<a name="automate-adding-or-updating-windows-registry-entries-using-aws-systems-manager-epics"></a>

### VPC 설정
<a name="set-up-a-vpc"></a>


| 작업 | 설명 | 필요한 기술 | 
| --- | --- | --- | 
| VPC를 생성합니다. | AWS Management Console에서 퍼블릭 및 프라이빗 서브넷과 NAT 게이트웨이가 있는 VPC를 생성합니다. 자세한 내용은 [AWS 설명서](https://docs.aws.amazon.com/batch/latest/userguide/create-public-private-vpc.html)를 참조하십시오. | 클라우드 관리자 | 
| 보안 그룹을 생성합니다. | 각 보안 그룹이 소스 IP 주소에서 원격 데스크톱 프로토콜(RDP)에 액세스할 수 있도록 허용하는지 확인하십시오. | 클라우드 관리자 | 

### IAM 정책 및 IAM 역할 생성
<a name="create-an-iam-policy-and-an-iam-role"></a>


| 작업 | 설명 | 필요한 기술 | 
| --- | --- | --- | 
| IAM 정책을 생성합니다. | Amazon S3, Amazon EC2 및 Systems Manager에 대한 액세스 권한을 부여하는 IAM 정책을 생성합니다. | 클라우드 관리자 | 
| IAM 역할을 생성합니다. | IAM 역할을 생성하고 Amazon S3, Amazon EC2 및 Systems Manager에 대한 액세스 권한을 부여하는 IAM 정책을 연결하십시오. | 클라우드 관리자 | 

### 자동화 실행
<a name="run-the-automation"></a>


| 작업 | 설명 | 필요한 기술 | 
| --- | --- | --- | 
| Systems Manager 명령 문서를 생성하십시오. | 추가하거나 업데이트할 Microsoft Windows 레지스트리 변경 내용을 배포할 Systems Manager 명령 문서를 만드십시오. | 클라우드 관리자 | 
| Systems Manager Run Command를 실행합니다. | 명령 문서와 Systems Manager 대상 인스턴스를 선택하여 Systems Manager Run Command를 실행합니다. 이렇게 하면 선택한 명령 문서의 Microsoft Windows 레지스트리 변경 내용이 대상 인스턴스로 푸시됩니다. | 클라우드 관리자 | 

## 관련 리소스
<a name="automate-adding-or-updating-windows-registry-entries-using-aws-systems-manager-resources"></a>
+ [AWS Systems Manager](https://aws.amazon.com/systems-manager/)
+ [AWS Systems Manager 문서](https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-ssm-docs.html)
+ [AWS Systems Manager Run Command](https://docs.aws.amazon.com/systems-manager/latest/userguide/execute-remote-commands.html)

## 첨부
<a name="attachments-2ecf680d-9f36-4070-8a19-2af262db7fcc"></a>

이 문서와 관련된 추가 콘텐츠에 액세스하려면 [attachment.zip](samples/p-attach/2ecf680d-9f36-4070-8a19-2af262db7fcc/attachments/attachment.zip) 파일의 압축을 풉니다.