기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.
다음 예제에서는 Amazon EC2 인스턴스를 실행하는 IAM 보안 주체가 KMS 키로 암호화된 데이터 볼륨을 생성하고 탑재합니다. 이 작업은 여러 CloudTrail 로그 레코드를 생성합니다.
볼륨이 생성되면 고객을 대신하는 Amazon EC2는 AWS KMS ()에서 암호화된 데이터 키를 가져옵니다GenerateDataKeyWithoutPlaintext
. 그런 다음 데이터 키를 복호화할 수 있는 권한 부여(CreateGrant
)를 생성합니다. 볼륨이 마운트되면 Amazon EC2는를 호출 AWS KMS 하여 데이터 키()를 복호화합니다Decrypt
.
Amazon EC2 인스턴스의 instanceId
("i-81e2f56c"
)는 RunInstances
이벤트에 나타납니다. 동일한 인스턴스 ID는 생성된 권한 부여("111122223333:aws:ec2-infrastructure:i-81e2f56c"
)의 granteePrincipal
및 Decrypt
호출("arn:aws:sts::111122223333:assumed-role/aws:ec2-infrastructure/i-81e2f56c"
)에서 보안 주체인 위임된 역할에 자격을 부여합니다.
데이터 볼륨를 보호하는 KMS 키의 키 ARN은 세 가지 AWS KMS 호출(arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
,CreateGrant
GenerateDataKeyWithoutPlaintext
및 ) 모두에 나타납니다Decrypt
.
{
"Records": [
{
"eventVersion": "1.02",
"userIdentity": {
"type": "IAMUser",
"principalId": "EX_PRINCIPAL_ID",
"arn": "arn:aws:iam::111122223333:user/Alice",
"accountId": "111122223333",
"accessKeyId": "EXAMPLE_KEY_ID",
"userName": "Alice"
},
"eventTime": "2014-11-05T21:35:27Z",
"eventSource": "ec2.amazonaws.com",
"eventName": "RunInstances",
"awsRegion": "us-west-2",
"sourceIPAddress": "192.0.2.0",
"userAgent": "AWS Internal",
"requestParameters": {
"instancesSet": {
"items": [
{
"imageId": "ami-b66ed3de",
"minCount": 1,
"maxCount": 1
}
]
},
"groupSet": {
"items": [
{
"groupId": "sg-98b6e0f2"
}
]
},
"instanceType": "m3.medium",
"blockDeviceMapping": {
"items": [
{
"deviceName": "/dev/xvda",
"ebs": {
"volumeSize": 8,
"deleteOnTermination": true,
"volumeType": "gp2"
}
},
{
"deviceName": "/dev/sdb",
"ebs": {
"volumeSize": 8,
"deleteOnTermination": false,
"volumeType": "gp2",
"encrypted": true
}
}
]
},
"monitoring": {
"enabled": false
},
"disableApiTermination": false,
"instanceInitiatedShutdownBehavior": "stop",
"clientToken": "XdKUT141516171819",
"ebsOptimized": false
},
"responseElements": {
"reservationId": "r-5ebc9f74",
"ownerId": "111122223333",
"groupSet": {
"items": [
{
"groupId": "sg-98b6e0f2",
"groupName": "launch-wizard-2"
}
]
},
"instancesSet": {
"items": [
{
"instanceId": "i-81e2f56c",
"imageId": "ami-b66ed3de",
"instanceState": {
"code": 0,
"name": "pending"
},
"amiLaunchIndex": 0,
"productCodes": {
},
"instanceType": "m3.medium",
"launchTime": 1415223328000,
"placement": {
"availabilityZone": "us-east-1a",
"tenancy": "default"
},
"monitoring": {
"state": "disabled"
},
"stateReason": {
"code": "pending",
"message": "pending"
},
"architecture": "x86_64",
"rootDeviceType": "ebs",
"rootDeviceName": "/dev/xvda",
"blockDeviceMapping": {
},
"virtualizationType": "hvm",
"hypervisor": "xen",
"clientToken": "XdKUT1415223327917",
"groupSet": {
"items": [
{
"groupId": "sg-98b6e0f2",
"groupName": "launch-wizard-2"
}
]
},
"networkInterfaceSet": {
},
"ebsOptimized": false
}
]
}
},
"requestID": "41c4b4f7-8bce-4773-bf0e-5ae3bb5cbce2",
"eventID": "cd75a605-2fee-4fda-b847-9c3d330ebaae",
"eventType": "AwsApiCall",
"recipientAccountId": "111122223333"
},
{
"eventVersion": "1.02",
"userIdentity": {
"type": "IAMUser",
"principalId": "EX_PRINCIPAL_ID",
"arn": "arn:aws:iam::111122223333:user/Alice",
"accountId": "111122223333",
"accessKeyId": "EXAMPLE_KEY_ID",
"userName": "Alice"
},
"eventTime": "2014-11-05T21:35:35Z",
"eventSource": "kms.amazonaws.com",
"eventName": "CreateGrant",
"awsRegion": "us-east-1",
"sourceIPAddress": "192.0.2.0",
"userAgent": "AWS Internal",
"requestParameters": {
"constraints": {
"encryptionContextSubset": {
"aws:ebs:id": "vol-f67bafb2"
}
},
"granteePrincipal": "111122223333:aws:ec2-infrastructure:i-81e2f56c",
"keyId": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
},
"responseElements": {
"grantId": "abcde1237f76e4ba7987489ac329fbfba6ad343d6f7075dbd1ef191f0120514a"
},
"requestID": "41c4b4f7-8bce-4773-bf0e-5ae3bb5cbce2",
"eventID": "c1ad79e3-0d3f-402a-b119-d5c31d7c6a6c",
"readOnly": false,
"resources": [
{
"ARN": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
"accountId": "111122223333"
}
],
"eventType": "AwsApiCall",
"recipientAccountId": "111122223333"
},
{
"eventVersion": "1.02",
"userIdentity": {
"type": "IAMUser",
"principalId": "EX_PRINCIPAL_ID",
"arn": "arn:aws:iam::111122223333:user/Alice",
"accountId": "111122223333",
"accessKeyId": "EXAMPLE_KEY_ID",
"userName": "Alice"
},
"eventTime": "2014-11-05T21:35:32Z",
"eventSource": "kms.amazonaws.com",
"eventName": "GenerateDataKeyWithoutPlaintext",
"awsRegion": "us-east-1",
"sourceIPAddress": "192.0.2.0",
"userAgent": "AWS Internal",
"requestParameters": {
"encryptionContext": {
"aws:ebs:id": "vol-f67bafb2"
},
"numberOfBytes": 64,
"keyId": "alias/aws/ebs"
},
"responseElements": null,
"requestID": "create-111122223333-758247346-1415223332",
"eventID": "ac3cab10-ce93-4953-9d62-0b6e5cba651d",
"readOnly": true,
"resources": [
{
"ARN": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
"accountId": "111122223333"
}
],
"eventType": "AwsApiCall",
"recipientAccountId": "111122223333"
},
{
"eventVersion": "1.02",
"userIdentity": {
"type": "AssumedRole",
"principalId": "111122223333:aws:ec2-infrastructure:i-81e2f56c",
"arn": "arn:aws:sts::111122223333:assumed-role/aws:ec2-infrastructure/i-81e2f56c",
"accountId": "111122223333",
"accessKeyId": "",
"sessionContext": {
"attributes": {
"mfaAuthenticated": "false",
"creationDate": "2014-11-05T21:35:38Z"
},
"sessionIssuer": {
"type": "Role",
"principalId": "111122223333:aws:ec2-infrastructure",
"arn": "arn:aws:iam::111122223333:role/aws:ec2-infrastructure",
"accountId": "111122223333",
"userName": "aws:ec2-infrastructure"
}
}
},
"eventTime": "2014-11-05T21:35:47Z",
"eventSource": "kms.amazonaws.com",
"eventName": "Decrypt",
"awsRegion": "us-east-1",
"sourceIPAddress": "192.0.2.0",
"requestParameters": {
"encryptionContext": {
"aws:ebs:id": "vol-f67bafb2"
}
},
"responseElements": null,
"requestID": "b4b27883-6533-11e4-b4d9-751f1761e9e5",
"eventID": "edb65380-0a3e-4123-bbc8-3d1b7cff49b0",
"readOnly": true,
"resources": [
{
"ARN": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
"accountId": "111122223333"
}
],
"eventType": "AwsApiCall",
"recipientAccountId": "111122223333"
}
]
}