AWS GovCloud에서 Identity Access Manager 설정
CloudFormation 템플릿(CFT)을 사용하여 관리 계정에서 세 가지 AWS 계정 유형에 대한 IAM(Identity Access Manager) 자원을 생성 AWS CloudFormation 하고 CAM(클라우드 계정 관리)을 GovCloud와 AWS 통합 ServiceNow 합니다.
시작하기 전에
대상 사용자 계정에 필요한 AWS IAM 권한이 있는지 확인합니다. 자세한 내용은 API 권한 정보 Amazon Web Services 문서를 참조하십시오.
주:
IAM 권한을 구현할 때는 항상 조직의 보안 정책을 따르십시오.
필요한 역할: AWS 관리자
이 태스크 정보
AWS GovCloud 계정은 항상 상업용 계정에 연결되므로 IAM 리소스는 다음 세 가지 AWS 계정 유형에서 생성해야 합니다.
- AWS 상업용 관리 계정: GovCloud에 연결되는 표준 AWS 계정입니다.
- AWS GovCloud 루트 관리 계정: GovCloud 환경의 메인 계정입니다.
- AWS GovCloud 조직 관리 계정: GovCloud 환경에서 조직 자원을 관리하기 위한 계정입니다.
프로시저
-
각 CloudFormation 템플릿(CFT) 코드를 확장명
이 .yml인 다른 파일에 복사하고 파일을 저장합니다. - 루트 사용자 자격 증명을 사용하여 관리 콘솔에 AWS 로그인합니다.
-
단계에 따라 각 스크립트를 순서대로 실행합니다.
-
AWS 상업용 관리 계정 CFT 스크립트
- 상업용 AWS 콘솔에 로그인합니다.
- 검색 창에 CloudFormation 을 입력하고 선택하여 CloudFormation 콘솔에 액세스합니다.
- CloudFormation 콘솔에서 스택 작성 > 기존 템플릿 선택 > 템플릿 파일 업로드 > 파일 선택 을 클릭하여 로컬 컴퓨터에서 템플릿 파일을 선택합니다.
스택은 단일 단위로 관리할 수 있는 자원의 AWS 모음입니다.
- 저장된 상업용 CFT 스크립트를 사용하고
SNUserName매개 변수를 설정합니다. - 출력 매개변수(
SNUserARN및SNUser)를 기록합니다.
AWSTemplateFormatVersion: '2010-09-09' Description: This script creates a ServiceNow user in the AWS Commercial Management Account for Cloud Account Management (CAM) integration. Metadata: AWS::CloudFormation::Interface: ParameterGroups: - Label: default: User Credentials Parameters: - SNUserName ParameterLabels: SNUserName: default: User Name in the AWS Commercial environment Parameters: SNUserName: Type: String Description: User name for ServiceNow Cloud Workspace application in AWS Commercial Environment MinLength: '6' MaxLength: '15' ConstraintDescription: The username must be between 6 and 15 characters Resources: # AWS Commercial Resources SnowCWMemberAccountAccessGroup: Type: 'AWS::IAM::Group' Properties: GroupName: SnowCWMemberAccountAccessGroup Description: IAM Group for ServiceNow Cloud Workspace users with permissions to manage AWS Organizations SnowCWAccountAccessPolicy: Type: 'AWS::IAM::Policy' Properties: PolicyName: SnowCWAccountAccessPolicy PolicyDocument: Version: '2012-10-17' Statement: # Create Account Workflow Permissions - Sid: ServiceNowCreateAccountAccess Effect: Allow Action: - 'budgets:CreateBudgetAction' - 'budgets:DescribeBudgetAction' - 'organizations:CreateGovCloudAccount' - 'organizations:DescribeCreateAccountStatus' - 'organizations:MoveAccount' - 'organizations:TagResource' - 'organizations:ListRoots' Resource: '*' # Account Management Workflow Permissions - Sid: ServiceNowAccountManagementAccess Effect: Allow Action: - 'budgets:ListTagsForResource' - 'budgets:ModifyBudget' - 'budgets:ViewBudget' - 'iam:GetAccountPasswordPolicy' - 'iam:GetAccountSummary' - 'iam:GetRole' - 'iam:ListAccountAliases' - 'organizations:AttachPolicy' - 'organizations:DescribePolicy' - 'organizations:DetachPolicy' - 'sts:AssumeRole' Resource: '*' # Discovery Workflow Permissions - Sid: ServiceNowDiscoveryAccess Effect: Allow Action: - 'organizations:DescribeAccount' - 'organizations:DescribeOrganization' - 'organizations:DescribeOrganizationalUnit' - 'organizations:ListAccounts' - 'organizations:ListAWSServiceAccessForOrganization' - 'organizations:ListOrganizationalUnitsForParent' - 'organizations:ListParents' - 'organizations:ListRoots' - 'organizations:ListTagsForResource' Resource: '*' Groups: - !Ref SnowCWMemberAccountAccessGroup Description: Policy that grants permissions required for ServiceNow CAM in the AWS Commercial environment CreateServicenowUser: Type: 'AWS::IAM::User' Properties: Path: / UserName: !Ref SNUserName Tags: - Key: Purpose Value: ServiceNowCAMIntegration Description: IAM user for ServiceNow CAM integration with AWS Commercial environment AddSnowUserToSnowCWMemberAccountAccessGroup: Type: 'AWS::IAM::UserToGroupAddition' Properties: GroupName: SnowCWMemberAccountAccessGroup Users: - !Ref SNUserName DependsOn: CreateServicenowUser Description: Adds the ServiceNow user to the access group Outputs: SNUserARN: Description: ARN of ServiceNow user in AWS Commercial environment Value: !GetAtt CreateServicenowUser.Arn SNUser: Description: Username of the created ServiceNow user in AWS Commercial environment Value: !Ref SNUserName -
AWS GovCloud 루트 관리 계정 CFT 스크립트
- GovCloud AWS 콘솔에 로그인합니다.
- 검색 창에 CloudFormation 을 입력하고 선택하여 CloudFormation 콘솔에 액세스합니다.
- CloudFormation 콘솔에서 스택 작성 > 기존 템플릿 선택 > 템플릿 파일 업로드 > 파일 선택 을 클릭하여 로컬 컴퓨터에서 템플릿 파일을 선택합니다.
- 저장된 GovCloud 루트 CFT 스크립트를 사용하고
SNGovUserName매개변수를 설정합니다. - 출력 매개변수(
SNGovUserARN및SNGovUser)를 기록합니다.
주:간단히 하기 위해 이 템플릿은 SnowCWGovCloudUserPolicy에 대한 리소스 ARN의 와일드카드(*)를 사용하여 사용자가 모든 GovCloud 계정에서 역할을 수임할 수 있도록 합니다 ServiceNow . 이는 기능적으로는 작동하지만 필요 이상으로 많은 권한을 부여합니다.
프로덕션 환경의 경우:- 조직 계정 ID에 대한 매개변수 추가:
OrgAccountId: 유형: 문자열 - 자원 필드를 업데이트합니다.
Resource: !Sub 'arn:aws-us-gov:iam::${OrgAccountId}:role/ServiceNowGovCrossAccountRole' - 여러 계정으로 작업하려면 CloudFormation 파라미터 및 CommaDelimitedList 사용 단원을 참조하십시오.
- IAM 정책 보안에 대한 자세한 지침은 AWS IAM 모범 사례 를 검토하십시오.
AWSTemplateFormatVersion: '2010-09-09' Description: This script creates a ServiceNow user in the AWS GovCloud Management Account for Cloud Account Management (CAM) integration. Metadata: AWS::CloudFormation::Interface: ParameterGroups: - Label: default: User Credentials Parameters: - SNGovUserName ParameterLabels: SNGovUserName: default: AWS User Name in the GovCloud environment Parameters: SNGovUserName: Type: String Description: User name for ServiceNow Cloud Workspace application in AWS GovCloud Environment MinLength: '6' MaxLength: '15' ConstraintDescription: The username must be between 6 and 15 characters Resources: # AWS GovCloud Resources SnowCWGovCloudAccessGroup: Type: 'AWS::IAM::Group' Properties: GroupName: SnowCWGovCloudAccessGroup Description: IAM Group for ServiceNow Cloud Workspace users in AWS GovCloud environment CreateGovCloudServicenowUser: Type: 'AWS::IAM::User' Properties: Path: / UserName: !Ref SNGovUserName Tags: - Key: Purpose Value: ServiceNowCAMIntegration Description: IAM user for ServiceNow CAM integration with AWS GovCloud environment SnowCWGovCloudUserPolicy: Type: 'AWS::IAM::Policy' Properties: PolicyName: SnowCWGovCloudUserPolicy PolicyDocument: Version: '2012-10-17' Statement: - Effect: Allow Action: 'sts:AssumeRole' Resource: 'arn:aws-us-gov:iam::*:role/ServiceNowGovCrossAccountRole' - Effect: Allow Action: 'sts:AssumeRole' Resource: 'arn:aws-us-gov:iam::*:role/OrganizationAccountAccessRole' Groups: - !Ref SnowCWGovCloudAccessGroup Description: Policy that grants basic permissions and ability to assume the cross-account role AddSnowUserToSnowCWGovCloudAccessGroup: Type: 'AWS::IAM::UserToGroupAddition' Properties: GroupName: SnowCWGovCloudAccessGroup Users: - !Ref SNGovUserName DependsOn: - CreateGovCloudServicenowUser - SnowCWGovCloudAccessGroup Description: Adds the ServiceNow GovCloud user to the access group Outputs: SNGovUserARN: Description: ARN of ServiceNow user in AWS GovCloud environment Value: !GetAtt CreateGovCloudServicenowUser.Arn SNGovUser: Description: Username of the created ServiceNow user in AWS GovCloud environment Value: !Ref SNGovUserName -
AWS GovCloud 조직 관리 계정 CFT 스크립트
- GovCloud 조직 AWS 콘솔에 로그인합니다.
- 검색 창에서 CloudFormation 을 입력하고 선택하여 CloudFormation 콘솔에 액세스합니다.
- CloudFormation 콘솔에서 스택 작성 > 기존 템플릿 선택 > 템플릿 파일 업로드 > 파일 선택 을 클릭하여 로컬 컴퓨터에서 템플릿 파일을 선택합니다.
- 저장된 GovCloud 조직 CFT 스크립트를 사용하고
SNGovUserARN매개변수를 AWS GovCloud 루트 관리 계정 CFT 스크립트에서 기록된 출력으로 설정합니다. - 출력 매개변수
RoleARN을 기록합니다.
AWSTemplateFormatVersion: '2010-09-09' Description: This template creates the ServiceNowGovCrossAccountRole in the AWS Organization Management Account for ServiceNow CAM integration. Metadata: AWS::CloudFormation::Interface: ParameterGroups: - Label: default: Role Configuration Parameters: - SNGovUserARN ParameterLabels: SNGovUserARN: default: ServiceNow GovCloud User ARN Parameters: SNGovUserARN: Type: String Description: ARN of the ServiceNow GovCloud user that will assume this role AllowedPattern: '^arn:aws(-[a-z0-9-]+)?:iam::[0-9]{12}:user/.*$' ConstraintDescription: Must be a valid AWS IAM user ARN Resources: ServiceNowGovCrossAccountRole: Type: 'AWS::IAM::Role' Properties: RoleName: ServiceNowGovCrossAccountRole Description: Role used by ServiceNow CAM for cross-account operations in AWS GovCloud AssumeRolePolicyDocument: Version: '2012-10-17' Statement: - Effect: Allow Principal: AWS: !Ref SNGovUserARN Action: 'sts:AssumeRole' Policies: - PolicyName: ServiceNowGovCloudPolicy PolicyDocument: Version: '2012-10-17' Statement: # Create Account Workflow Permissions - Sid: ServiceNowGovCreateAccountAccess Effect: Allow Action: - 'organizations:InviteAccountToOrganization' - 'organizations:ListRoots' - 'organizations:MoveAccount' - 'organizations:TagResource' Resource: '*' # Account Management Workflow Permissions - Sid: ServiceNowGovAccountManagementAccess Effect: Allow Action: - 'iam:GetAccountAuthorizationDetails' - 'iam:GetAccountPasswordPolicy' - 'iam:GetAccountSummary' - 'iam:GetRole' - 'iam:ListAccountAliases' - 'organizations:AttachPolicy' - 'organizations:DescribePolicy' - 'organizations:DetachPolicy' Resource: '*' # Discovery Workflow Permissions - Sid: ServiceNowGovDiscoveryAccess Effect: Allow Action: - 'ec2:DescribeRegions' - 'organizations:DescribeAccount' - 'organizations:DescribeOrganization' - 'organizations:DescribeOrganizationalUnit' - 'organizations:ListAccounts' - 'organizations:ListAWSServiceAccessForOrganization' - 'organizations:ListOrganizationalUnitsForParent' - 'organizations:ListParents' - 'organizations:ListRoots' - 'organizations:ListTagsForResource' Resource: '*' Outputs: RoleARN: Description: ARN of the ServiceNowGovCrossAccountRole Value: !GetAtt ServiceNowGovCrossAccountRole.Arn
-
AWS 상업용 관리 계정 CFT 스크립트
- 다음을 선택하여 템플릿을 계속 진행하고 유효성을 검사합니다.
- 스택 상세 정보 지정 페이지에서 스택 이름 필드에 템플릿의 이름을 입력합니다.
스택 이름:
- 대/소문자를 구분하는 영숫자 문자와 하이픈만 사용할 수 있습니다.
- 알파벳으로 시작해야 함
- 128자를 초과할 수 없습니다.
- 사용자 이름 필드에 서비스 계정 사용자 이름을 입력합니다클라우드 계정 관리.
- 다음을 선택합니다.
- 스택 옵션 구성(Configure stack options) 페이지에서 AWS CloudFormation에서 사용자 지정 이름을 사용하여 IAM 리소스를 생성할 수 있음을 확인함 확인란을 선택하고 다음(Next)을 선택합니다.
-
[Review and create] 페이지에서 [Submit]을 선택하여 스택을 시작합니다.
IAM 계정이 생성됩니다.
-
작성된 두 사용자에 대한 보안 자격 증명을 추가하려면 다음을 수행합니다.
- 리소스를 선택합니다.
- 사용자 이름 링크를 선택합니다.
- 접근 키 섹션에서 접근 키 만들기를 선택합니다.
-
접근 키 베스트 프랙티스 및 대안 페이지에서 외부 공급업체 서비스 옵션을 선택합니다.
이 접근 키를 사용하여 자원을 모니터링하거나 관리하는 타사 애플리케이션 또는 서비스에 대한 액세스를 활성화할 수 있습니다 AWS .
- 위의 권장 사항을 이해하고 액세스 키를 만들려고 합니다 확인란을 선택하고 다음을 선택합니다.
- 접근 키 만들기를 선택합니다.
-
접근 키 검토 페이지에서 접근 키 파일을 다운로드하고 완료를 선택합니다.
주:접근 키와 비밀 키를 관리자 및 ServiceNow AI Platform 관리자와 Terraform 공유합니다.