설명
새 Simple AD 디렉터리의 Administrator 비밀번호는 기본값 없는 NoEcho 파라미터로 전달하세요. 템플릿, Outputs, Metadata에 값을 남기지 마세요.
잠재적 영향
템플릿 이력을 통해 비밀번호가 노출되면 디렉터리에 접속할 수 있는 사람이 사용자나 그룹을 변경할 수 있습니다.
해결 방법
기존 디렉터리의 비밀번호가 노출됐다면 Directory Service의 ResetUserPassword로 Administrator 비밀번호를 재설정하세요. CloudFormation의 Password를 변경하면 디렉터리가 교체됩니다.
예시
VpcId에는 디렉터리의 VPC ID를, DirectorySubnets에는 그 VPC에서 서로 다른 가용 영역에 속한 서브넷 두 개를 지정하세요. 새 디렉터리의 정책을 충족하는 비밀번호를 ParentMasterPassword로 안전하게 입력하세요.
변경 전
yaml
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
VpcId:
Type: AWS::EC2::VPC::Id
DirectorySubnets:
Type: List<AWS::EC2::Subnet::Id>
Resources:
NewAmpApp1:
Type: AWS::DirectoryService::SimpleAD
Properties:
Name: corp.example.com
Password: "asDjskjs73!!"
ShortName: CORP
Size: Small
VpcSettings:
VpcId: !Ref VpcId
SubnetIds: !Ref DirectorySubnets
변경 후
yaml
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
ParentMasterPassword:
Type: String
NoEcho: true
MinLength: 8
MaxLength: 64
VpcId:
Type: AWS::EC2::VPC::Id
DirectorySubnets:
Type: List<AWS::EC2::Subnet::Id>
Resources:
NewAmpApp1:
Type: AWS::DirectoryService::SimpleAD
Properties:
Name: corp.example.com
Password: !Ref ParentMasterPassword
ShortName: CORP
Size: Small
VpcSettings:
VpcId: !Ref VpcId
SubnetIds: !Ref DirectorySubnets