"Effect": "Deny", "NotAction": [ "codecommit:GitPull", "codecommit:GitPush", "kms:Encrypt", "kms:Decrypt", "kms:ReEncryptFrom", "kms:ReEncryptTo", "kms:GenerateDataKey", "kms:GenerateDataKeyWithoutPlaintext", "kms:DescribeKey" ], "Resource": "*", "Condition": { "BoolIfExists": { "aws:MultiFactorAuthPresent": "false" } } } { "Sid": "DenyKMSActionWithoutMFA", "Effect": "Deny", "Action": [ "kms:Encrypt", "kms:Decrypt", "kms:ReEncryptFrom", "kms:ReEncryptTo", "kms:GenerateDataKey", "kms:GenerateDataKeyWithoutPlaintext", "kms:DescribeKey" ], "NotResource": "arn:aws:kms:ap-northeast-1:${account-id}:key/${aws-codecommit-k ey-id}", "Condition": { "BoolIfExists": { "aws:MultiFactorAuthPresent": "false" } } } ①CodeCommitとKMS関連しないMFAアクセスを拒否 (CodeCommitとKMSは許可) ②CodeCommitに関連しないKMSアクセスを拒否