Authentication and access control for Amazon KMS - Amazon Key Management Service
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

Authentication and access control for Amazon KMS

To use Amazon KMS, you must have credentials that Amazon can use to authenticate your requests. The credentials must include permissions to access Amazon resources, such as Amazon KMS keys. The following topics provide details about how you can use Amazon Identity and Access Management (IAM) and Amazon KMS permissions to help secure your resources by controlling who can access them.

Concepts in Amazon KMS access control

Authentication

You can access Amazon as any of the following types of identities:

  • Amazon Web Services account root user – When you sign up for Amazon, you provide an email address and password for your Amazon Web Services account. These are your root credentials and they provide complete access to all of your Amazon resources.

    Important

    For security reasons, we recommend that you use the root credentials only to create an administrator user, which is an IAM user with full permissions to your Amazon Web Services account. Then, you can use this administrator user to create other IAM users and roles with limited permissions. For more information, see Create Individual IAM Users (IAM Best Practices) and Creating An Admin User and Group in the IAM User Guide.

  • IAM user – An IAM user is an identity within your Amazon Web Services account that has specific permissions (for example, to use a KMS key). You can use an IAM user name and password to sign in to secure Amazon webpages like the Amazon Web Services Management Console, Amazon Discussion Forums, or the Amazon Web Services Support Center.

    In addition to a user name and password, you can also create access keys for each user to enable the user to access Amazon services programmatically, by using an Amazon SDK, the Amazon Command Line Interface, or Amazon Tools for PowerShell. The SDKs and command line tools use the access keys to cryptographically sign API requests. If you don't use the Amazon tools, you must sign API requests yourself. Amazon KMS supports Signature Version 4, an Amazon protocol for authenticating API requests. For more information about authenticating API requests, see Signature Version 4 Signing Process in the Amazon General Reference.

  • IAM role – An IAM role is another IAM identity you can create in your account that has specific permissions. It is similar to an IAM user, but it is not associated with a specific person. An IAM role enables you to obtain temporary access keys to access Amazon services and resources programmatically. IAM roles are useful in the following situations:

    • Federated user access – Instead of creating an IAM user, you can use preexisting user identities from Amazon Directory Service, your enterprise user directory, or a web identity provider. These are known as federated users. Federated users use IAM roles through an identity provider. For more information about federated users, see Federated Users and Roles in the IAM User Guide.

    • Cross-account access – You can use an IAM role in your Amazon Web Services account to allow another Amazon Web Services account permissions to access your account's resources. For an example, see Tutorial: Delegate Access Across Amazon Accounts Using IAM Roles in the IAM User Guide.

    • Amazon service access – You can use an IAM role in your account to allow an Amazon service permissions to access your account's resources. For example, you can create a role that allows Amazon Redshift to access an S3 bucket on your behalf and then load data stored in the S3 bucket into an Amazon Redshift cluster. For more information, see Creating a Role to Delegate Permissions to an Amazon Service in the IAM User Guide.

    • Applications running on EC2 instances – Instead of storing access keys on an EC2 instance for use by applications that run on the instance and make Amazon API requests, you can use an IAM role to provide temporary access keys for these applications. To assign an IAM role to an EC2 instance, you create an instance profile and then attach it when you launch the instance. An instance profile contains the role and enables applications running on the EC2 instance to get temporary access keys. For more information, see Using Roles for Applications on Amazon EC2 in the IAM User Guide.

Access control

You can have valid credentials to authenticate your requests, but you also need permissions to make Amazon KMS API requests to create, manage, or use Amazon KMS resources. For example, you must have permissions to create, manage, and use a KMS key for cryptographic operations.

Use key policies, IAM policies, and grants to control access to your Amazon KMS resources. You can use policy condition keys to grant access only when a request or resource meets the conditions you specify. You can allow access to principals you trust in other Amazon accounts.