Module 9
Module 9
Contents
Module 9: Securing User, Application, and Data Access 4
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 3
AWS Training and Certification Module 9: Securing User, Application, and Data Access
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 4
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Introduction
Securing User, Application, and Data Access
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 5
AWS Training and Certification Module 9: Securing User, Application, and Data Access
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 6
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Module overview
Presentation sections Knowledge checks
• Managing permissions • 10-question knowledge check
• Federating users • Sample exam question
• Managing access to multiple
accounts
• Encrypting data at rest
• AWS security services for securing
user, application, and data access
The objectives of this module are presented across multiple sections. The module wraps up with a 10-question
knowledge check delivered in the online course, and a sample exam question to discuss in class. The labs in this
module are described on the next slide.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 7
AWS Training and Certification Module 9: Securing User, Application, and Data Access
This module includes the guided labs listed. Additional information about each lab is included in the student
guide where the lab takes place, and detailed instructions are provided in the lab environment.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 8
AWS Training and Certification Module 9: Securing User, Application, and Data Access
This slide asks you to take the perspective of a cloud architect as you think about how to approach cloud
network design. Keep these considerations in mind as you progress through this module, remembering that the
cloud architect should work backwards from the business need to design the best architecture for a specific use
case. As you progress through the module, consider the café scenario presented in the course as an example
business need and think about how you would address these needs for the fictional café business.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 9
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Managing permissions
Securing User, Application, and Data Access
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 10
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Initial configuration
Each developer is given full access to Amazon Elastic
Compute Cloud (Amazon EC2) through policies that are
attached to individual users.
Additional access is needed
Each developer needs access to Amazon Simple Storage
Service (Amazon S3). To implement this change, an
administrator needs to make three modifications, one for
each AWS Identity and Access Management (IAM) user’s
policy.
The number of developers grows
This approach becomes hard to manage. Is there an easier
way to manage multiple permissions and users?
8
Image description: The diagram shows three users, John, Mary, and Pat, each with their own IAM policy
attachment. These policies give each user individually the permission to access Amazon EC2. End description.
Assigning permissions directly to users is difficult to manage. In this example, there are three users that have
policies attached to them to access Amazon Elastic Compute Cloud (Amazon EC2). To implement a change, an
administrator needs to make modifications to each individual user policy. Imagine you have 100 developers in
the group; this becomes difficult to manage.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 11
AWS Training and Certification Module 9: Securing User, Application, and Data Access
In the example on the slide, an AWS Identity and Access Management (IAM) group is created to group all users
that are developers. A single IAM policy is attached to the group to grant all the permissions that a developer
requires. When John, Mary, and Pat are added to the group, they automatically inherit the permissions for the
group. When a new permission needs to be granted to all developers, for example to access Amazon Simple
Storage Service (Amazon S3), only one change is required: either add the new permission to the existing policy,
or create a new policy with the new permission and attach the policy to the group.
An IAM group is a collection of IAM users. Groups are a convenience that makes it easier to manage
permissions for a collection of users, instead of managing permissions for each individual user.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 12
AWS Training and Certification Module 9: Securing User, Application, and Data Access
10
Image description: An AWS account has three IAM groups named admins, developers, and test. The admins
group has two members: Li and Paulo. The Developers group has Mateo, Shirley and Sofia. The test group has
Ana, Zhang, and Jane. End description.
Typically, you want to create groups that reflect job functions. For example, you can create one group for
administrators, another group for developers, and another group for the team that performs testing functions.
Then, you attach one or more policy files to each group and add users to the groups. Users have the access
rights that are assigned to the group or groups that they are in because of their group membership.
If a new developer is hired, you can add them to the existing developers group. They will get the same access
that the other developers already have.
If a person, such as Ana (shown in the example) takes on a new role in the organization, you can remove her
from the test group and add her to the developers group. Or, if Ana will perform both functions, you can leave
her in the test group and add her to the developers group.
If you discover that developers need access to some additional resource in the account, you can update or add a
policy to the developers group. All members of the group will gain that additional level of access. Groups make
it easier to maintain consistent access rights across teams.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 13
AWS Training and Certification Module 9: Securing User, Application, and Data Access
11
This example illustrates a case where a user has permission information derived from both a user policy and a
group policy. In this example, Zhang has a user policy that allows access to Amazon S3 and Amazon DynamoDB,
but it denies access to Amazon Kinesis. Zhang is also a member of an IAM group called Developer that allows
access to S3, Amazon Athena, DynamoDB, and Kinesis. What are the results of these two policies on Zhang's
access?
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 14
AWS Training and Certification Module 9: Securing User, Application, and Data Access
12
Zhang can access Athena even though the user policy doesn’t mention Athena. Zhang can’t access Kinesis
because of the explicit deny in the user policy. Remember that an explicit deny in an IAM policy overrides an
explicit allow, so the explicit deny overrides the allow Kinesis access in the group policy.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 15
AWS Training and Certification Module 9: Securing User, Application, and Data Access
13
As illustrated in the previous example, traditionally, permissions are defined based on job function. This is
known as role-based access control (RBAC).
The disadvantage to using the traditional RBAC model is that you have to maintain multiple policies. When new
resources are added, you must update multiple policies to allow access to those resources. Updating polices can
become time-consuming.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 16
AWS Training and Certification Module 9: Securing User, Application, and Data Access
This slide summarizes what attribute-based access control (ABAC) is and how it can benefit your permissions
management approach.
Using ABAC, writing permissions is relatively straightforward. The policy checks whether an attribute that’s
applied to the IAM user is also applied to the resource that they want to access. When you create new IAM
users and new account resources, you apply the correct tags to the users and to the resources.
Using ABAC, you can grant developers access to their project resources, but you do not need to specify
resources in the policy file. This is far more scalable than role-based access.
For more information, see What is ABAC for AWS? on the content resources page of your online course.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 17
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Tagging in AWS
• Tags are resource metadata Example tags applied to an EC2 instance
consisting of a key/value pair.
Key Value
• Tags can apply to resources across Name Web server
AWS accounts and IAM users or Project Unicorn
roles. Env Dev
• Customers can create user-defined
tags.
• Many different AWS API operations
return tag keys and values.
• Tags have multiple practical uses
like billing, filtered views, and
access control.
15
Before you consider the attribute-based approach to permissions controls, you should understand the tagging
feature in AWS.
AWS enables customers to assign metadata to their AWS resources and identities in the form of tags. Each tag is
a simple label that consists of a customer-defined key and an optional value. Tags can make it easier to manage,
search for, and filter resources.
Tags have many practical uses. For example, you can create technical tags to identify that a resource is a web
server, part of a specific project, part of a specific environment (test, development, or production), among
others. You can also create business tags to identify the department or cost center that should be billed for this
resource or the project that this resource is a part of. Finally, you can also set security tags, such as an identifier
for the specific data-confidentiality level that a resource supports.
You can create up to 50 tags per resource. For each resource, each tag key must be unique, and each tag key can
have only one value. Tag keys and values are case-sensitive.
You can also add tags to IAM users and IAM roles. Tags are an important part of the second access-control
method.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 18
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Configure permissions
based on attributes
16
In this example, the development organization is using attributes to identify the team (development or test) and
the project (maintenance or new development). They have four IAM roles: one for developers on the
maintenance project, one for developers on the new development project, one for testers on the maintenance
project, and one for testers on the new development project.
Each project has two EC2 instances. One is tagged for the dev environment, and the other is tagged for test.
There’s also an Amazon S3 bucket tagged for developers and an Amazon S3 bucket tagged for testers.
Using the attributes, they can set up a single policy that says which tags have access to which resources. This
gives them flexibility as they add new resources or roles, and it limits the number of individual permissions that
are needed. If a new EC2 instance is added, for example, they can just add the appropriate tag to the new
instance and the roles that should have access will have it without any other changes.
To apply ABAC to your organization, the first step is to create identities, such as IAM users or IAM roles. These
identities must have the attributes that will be used for access control purposes. For example, you can apply the
Env = Dev and Project = Maint tags to the role for maintenance developers.
Next, require attributes for new resources. You should create policies that enforce the rule at the time of
resource creation. For example, you could require that a Project attribute and a Team attribute must be applied
to any resource when it is created.
With attributes in place for roles and resources, configure access permissions based on the attributes. For
example, the policy would allow roles with the dev and maintenance tags to access the EC2 dev maintenance
instance and the developer Amazon S3 bucket. Roles with the dev and newdev tags would be granted access to
the EC2 dev newdev instance and the developer Amazon S3 bucket. The policy would deny access to roles
without the appropriate tags.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 19
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Test your configuration. For example, a user could try to add an additional EC2 instance without the
required tags. The attempt should fail. Try creating the instance again with the required tags. This
time, they should be able to create the resource successfully. After verifying that resources can’t be
created without the desired tags, have users with each role try to access the resources they should
and should not have access to.
For a detailed tutorial that demonstrates how to use ABAC in AWS, see the link in your courses
resources for this tutorial titled IAM tutorial: Define permissions to access AWS resources based on
tags.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 20
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Key takeaways: • Use IAM groups to grant the same access rights
to multiple users. Create groups that reflect job
Managing functions.
permissions • Use ABAC rather than RBAC to scale permissions
management.
• ABAC is an authorization strategy that defines
permissions based on attributes. It simplifies
access control management by combining
permissions into a single policy.
• Attributes are key value pairs. AWS enables
customers to assign attributes to their AWS
resources and identities in the form of tags.
17
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 21
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Federating users
Securing User, Application, and Data Access
18
This section covers federating users and conveying information needed to authorize access to resources.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 22
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Identity federation
A system of trust between two parties to authenticate users and convey
information that’s needed to authorize access to resources
Identity federation is a system of trust between two parties to authenticate users and convey information that’s
needed to authorize access to resources. Identity providers (IdPs) are responsible for user authentication.
Service providers (SPs), such as services or applications, are responsible for controlling access to resources.
Through administrative agreement and configuration, the SP trusts the IdP to authenticate users and grants
them access to the requested resources.
For more information, see the Identity Federation link that’s provided on the course resource page.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 23
AWS Training and Certification Module 9: Securing User, Application, and Data Access
• Amazon Cognito
20
You can use two AWS services to federate your workforce into AWS accounts and business applications: AWS
Identity and Access Management (IAM) or AWS IAM Identity Center (successor to AWS SSO).
You can enable federated access to AWS accounts using IAM. The flexibility of IAM allows you to enable a
separate Security Assertion Markup Language (SAML) 2.0 or an Open ID Connect (OIDC) IdP for each AWS
account and use federated user attributes for access control. With IAM, you can pass user attributes, such as
cost center, title, or locale, from your IdPs to AWS, and implement fine-grained access permissions based on
these attributes. IAM helps you define permissions once, and then grant, revoke, or modify AWS access by
simply changing the attributes in the IdP. You can apply the same federated access policy to multiple AWS
accounts by implementing reusable customer managed IAM policies.
AWS Identity Center makes it easy to centrally manage federated access to multiple AWS accounts and business
applications and provide users with single sign-on access to all their assigned accounts and applications from
one place. You can use AWS IAM Identity Center for identities in the AWS IAM Identity Center’s user directory,
your existing corporate directory, or external IdP.
AWS IAM Identity Center works with an IdP of your choice, such as Okta Universal Directory or Azure Active
Directory (AD) through the SAML 2.0 protocol. IAM Identity Center seamlessly leverages IAM permissions and
policies for federated users and roles to help you manage federated access centrally across all AWS accounts in
your AWS organization. With IAM Identity Center, you can assign permissions based on the group membership
in your IdP’s directory, and then control the access for your users by simply modifying users and groups in the
IdP.
AWS Security Token Service (AWS STS) is a web service that provides temporary AWS credentials. This service
enables an IAM user, federated user, or application to assume an IAM role.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 24
AWS Training and Certification Module 9: Securing User, Application, and Data Access
You can also add federation support to your customer-facing web and mobile applications using
Amazon Cognito. It helps you add user sign-up, sign-in, and access control to your mobile and web
apps quickly and easily. Amazon Cognito scales to millions of users and supports sign-in with social
identity providers, such as Apple, Facebook, Google, and Amazon, and enterprise identity providers
using SAML 2.0.
The next few slides look at how these services support identity federation in a bit more detail. For
additional information on these services and how they work together, see the links provided on the
course resource page.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 25
AWS Training and Certification Module 9: Securing User, Application, and Data Access
21
Human users (as compared to application or service users) who are members of your organization are also
known as workforce identities or workforce users. Workforce identity federation refers to those human users.
If users in your organization already have a way to be authenticated, such as by signing in to your corporate
network, you can federate those user identities into AWS using either IAM or AWS IAM Identity Center.
The diagram shows how a user outside of AWS can access protected AWS resources by using an external
directory to gain temporary AWS security credentials.
See the link provided on the course resources page for additional information on federating existing users.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 26
AWS Training and Certification Module 9: Securing User, Application, and Data Access
22
With IAM Identity Center, you can create or connect identities once in AWS and centrally manage access across
your AWS accounts. IAM Identity Center provides a unified administration experience to define, customize, and
assign fine-grained permissions based on common job functions.
Users in your IAM Identity Center environment can use their directory credentials to access their user portal.
Users can access all their assigned AWS accounts or cloud applications. You can flexibly configure access to run
parallel to or replace AWS account access management by using IAM. IAM Identity Center supports commonly
used cloud applications such as Microsoft 365 and Salesforce. The service provides application integration
instructions that eliminate the need for administrators to learn the configuration nuances of each cloud
application.
See the link on the resources guide for more information on AWS IAM Identity Center.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 27
AWS Training and Certification Module 9: Securing User, Application, and Data Access
AWS STS
23
The next slides looks at how AWS STS provides temporary credentials as part of identity federation.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 28
AWS Training and Certification Module 9: Securing User, Application, and Data Access
• Users sign in using • The identity broker • The credentials last • AWS STS returns
an identity that is requests temporary from a few minutes the temporary
already known by credentials from to several hours and credentials to the
an IdP (for example AWS STS. are not recognized identity broker.
their [Link] after the credentials • The identity broker
ID or a corporate expire. passes them to the
login). application for the
user.
24
As noted on the prior slide, AWS STS provides temporary security credentials. When (or even before) the
temporary security credentials expire, the user can request new credentials as long as the user requesting them
still has permissions to do so.
To request temporary security credentials, use AWS STS operations in the AWS API. These include operations to
create and provide trusted users with temporary security credentials that can control access to your AWS
resources.
The slide shows the four general steps that occur during identity federation to access AWS services using
temporary credentials generated by AWS STS. An Identity Broker is an intermediary proxy service that connects
multiple SPs with multiple dPs. The identity broker facilitates the communication between an external IdP and
the SP, in this example AWS services.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 29
AWS Training and Certification Module 9: Securing User, Application, and Data Access
25
This slide illustrates the more detailed steps that occur when using an OIDC-based IdP with an identity broker
for identity federation. In this example, a corporate identity store is used to authenticate users who need to
access the AWS Management Console.
1. A user accesses an application that prompts them for a user ID and password, and then submits their
request.
2. The identity broker receives the authentication request. It then communicates with the corporate identity
store, which might be Microsoft Active Directory or a Lightweight Directory Access Protocol (LDAP) server.
3. If the authentication request is successful, the identity broker makes a request to AWS STS. The request is to
retrieve temporary AWS security credentials for the user application.
4. The user application receives the temporary AWS security credentials and redirects the user to the AWS
Management Console. The user did not need to sign directly in to AWS with a different set of credentials.
This process is an example of a single-sign on (SSO) implementation. The user application can also use these
same temporary AWS security credentials to access AWS services if the IAM policy document allows it.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 30
AWS Training and Certification Module 9: Securing User, Application, and Data Access
26
This example shows the use of SAML for exchanging authentication and authorization data between IdPs and
service providers. If your corporate directory is compatible with SAML 2.0, you can configure your corporate
directory to provide SSO access to the AWS Management Console for your users.
Here are the steps for this identity federation flow. They are similar to the previous slide, but they are specific to
the features of SAML.
1. A user in your organization navigates to an internal portal in your network. The portal also functions as the
IdP that handles the SAML trust between your organization and AWS.
2. The IdP authenticates the user’s identity against the identity store, which might be an LDAP server or
Microsoft Active Directory.
3. The portal receives the authentication response as a SAML assertion from the IdP.
4. The client posts the SAML assertion to the AWS sign-in endpoint for SAML. The endpoint communicates
with AWS STS, and it invokes the AssumeRoleWithSAML operation to request temporary security credentials
and construct a sign-in URL.
5. The client receives the temporary AWS security credentials. The client is redirected to the AWS
Management Console and is authenticated with the temporary AWS security credentials.
See the link on the resources guide for more information on SAML 2.0.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 31
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Amazon Cognito
A fully managed service that provides the
following services and features:
• Authentication, authorization, and user
management for web and mobile applications
• Federated identities for sign in with social
identity providers (Amazon, Facebook, Google)
or with SAML
Amazon Cognito • User pools that maintain a directory with user
profiles authentication tokens
• Identity pools that enable the creation of unique
identities and permissions assignment for users
27
The final identity federation option is using Amazon Cognito. Amazon Cognito is a fully managed service that
provides authentication, authorization, and user management for web and mobile applications. Users can sign
in directly with a username and password or through a third party, such as Facebook, Amazon, or Google.
The two main components of Amazon Cognito are user pools and identity pools.
A user pool is a user directory in Amazon Cognito. With a user pool, users can sign into a web or mobile
application through Amazon Cognito. They can also federate through a third-party IdP. All members of the user
pool have a directory profile that can be accessed through an SDK.
Identity pools enable the creation of unique identities and permissions assignment for users. With an identity
pool, users can obtain temporary AWS credentials to access AWS services or resources. Identity pools can
communicate with Amazon Cognito user pools’ social sign-in with Facebook, Google, and Login with Amazon
and OIDC providers. Identity pools use AWS STS behind the scenes.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 32
AWS Training and Certification Module 9: Securing User, Application, and Data Access
28
Remember, you can also add federation support to your customer-facing web and mobile applications using
Amazon Cognito. It helps you add user sign-up, sign-in, and access control to your mobile and web apps quickly.
1. After a successful user pool sign-in, your web or mobile app will receive user pool tokens from Amazon
Cognito.
2. You can use those tokens to control access to your server-side resources. You can also create user pool
groups to manage permissions and to represent different types of users.
After you configure a domain for your user pool, Amazon Cognito provisions a hosted web UI that allows you to
add sign-up and sign-in pages to your app. Using this OAuth 2.0 foundation, you can create your own resource
server to enable your users to access protected resources.
See the link on the course resources page for more information on accessing your server-side resources with a
user pool.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 33
AWS Training and Certification Module 9: Securing User, Application, and Data Access
29
In this diagram, the goal is to authenticate a user using Amazon Cognito and then grant that user access to
another AWS service.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 34
AWS Training and Certification Module 9: Securing User, Application, and Data Access
30
Image description: Diagram of Amazon Cognito user pools including connection to a user, identity provider,
app, and API/database. Arrows showing user connecting to app, user requests to sign into Amazon Cognito user
pool, user redirected to third party identity provider (optional), additional challenges, and challenge responses
between user and Amazon Cognito user pool, Amazon Cognito user pool provides token and sign in to app, and
app providing access token and retrieving data to API/database. End description
An Amazon Cognito user pool is a user directory. With a user pool, your users can sign into your web or mobile
app through Amazon Cognito or federate through a third-party IdP. Federated and local users have a user profile
in your user pool.
Local users are those who signed up or who you created directly in your user pool. You can manage and
customize these user profiles in the AWS Management Console, an AWS SDK, or the AWS Command Line
Interface (AWS CLI).
Amazon Cognito user pools accept tokens and assertions from third-party IdPs and collect the user attributes
into a JSON web token (JWT) that it issues to your app. You can standardize your app on one set of JWTs while
Amazon Cognito handles the interactions with IdPs, mapping their claims to a central token format.
An Amazon Cognito user pool can be a standalone IdP. Amazon Cognito draws from the OIDC standard to
generate JWTs for authentication and authorization. When you sign in local users, your user pool is authoritative
for those users. You have access to the following features when you authenticate local users.
See the link on the resources guide for more information on Amazon Cognito user pools.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 35
AWS Training and Certification Module 9: Securing User, Application, and Data Access
31
This slide highlights a few of the features of Amazon Cognito pools for supporting authentication and identity
federation.
See the link on the resources guide for more information on Amazon Cognito user pool features.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 36
AWS Training and Certification Module 9: Securing User, Application, and Data Access
32
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 37
AWS Training and Certification Module 9: Securing User, Application, and Data Access
33
You will now complete a lab. The next slide summarizes what you will do in the lab, and you will find the
detailed instructions in the lab environment.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 38
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Lab introduction: • In this lab, you use the Amazon Cognito service
to authenticate users of a web application.
Amazon Cognito
• The tasks that you perform include the
lab following:
• Creating an Amazon Cognito user pool to store
and manage the application users
• Configuring a user pool to provide a hosted UI
for the application
• Using the user pool to authenticate access to a
protected application function
• Open your lab environment to start the lab and
find additional details about the tasks that you
will perform.
34
Access the lab environment through your online course to get additional details and complete the lab.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 39
AWS Training and Certification Module 9: Securing User, Application, and Data Access
35
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 40
AWS Training and Certification Module 9: Securing User, Application, and Data Access
36
This section focuses on managing access to multiple accounts with AWS Organizations.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 41
AWS Training and Certification Module 9: Securing User, Application, and Data Access
37
When you use AWS to support the different teams and departments in an organization, you can choose
between two general architectural patterns to isolate and separate the resources that each team uses.
The first pattern is to define multiple virtual private clouds (VPCs) in a single AWS account. If you prefer
centralized information security management with minimum overhead, you can choose to use a single AWS
account.
The second pattern is to create multiple AWS accounts and define a VPC in each account. In practice, large and
small organizations tend to create multiple accounts for their organizations. For example, they might create
individual accounts for various business units. They can also create separate accounts for their development,
test, and production resources.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 42
AWS Training and Certification Module 9: Securing User, Application, and Data Access
38
When customers use separate AWS accounts (usually with consolidated billing) for development and production
resources, it enables them to cleanly separate different types of resources. It can also provide some security
benefits.
Alternatively, if your business maintains separate environments for production, development, and testing, you
can configure three AWS accounts and have one account for each environment. Also, if you have multiple
autonomous departments, you can also create separate AWS accounts for each autonomous part of the
organization.
When you use multiple accounts, a more efficient strategy is to create a single AWS account for common
project resources. Common resources might include DNS services, Microsoft Active Directory, and content
management systems (CMSs). You can also separate accounts for the autonomous projects or departments.
This strategy enables you to assign permissions and policies under each department or project account and
grant access to resources across accounts.
Although most organizations choose to use multiple AWS accounts, that choice comes with some challenges.
First, you must determine how to effectively manage security across all your accounts. If you replicate the IAM
policies that you defined across all accounts to ensure consistency, it could involve custom automation, manual
effort, or both.
Also, you might be constantly asked to create more accounts. It takes time to manually create these accounts. It
also might be difficult to track all the accounts and the purpose of each account.
It can also be a challenge to determine which cost center in the organization should be billed for which
resources in which accounts.
And finally, you might also want to achieve the centralized governance that is needed to ensure consistency.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 43
AWS Training and Certification Module 9: Securing User, Application, and Data Access
AWS Organizations
39
AWS Organizations is an account management service that you can use to create an organization where you can
consolidate multiple accounts and centrally manage them. AWS Organizations provides centralized account
creation and management and consolidated billing capabilities. With these features, you can manage your
security, compliance, and budgetary needs more efficiently.
Organizations also provides the ability to hierarchically group your accounts in organizational units (OUs) and
attach different access policies to each. This provides the ability to create and customize fine-grained policies,
which you can target to a single OU or attach to multiple OUs. You can nest OUs within other OUs up to a depth
of five levels, which helps you to structure your hierarchy as you prefer.
Another key feature of Organizations is the use of service control policies (SCPs) to specify the maximum
permissions for member accounts in your organization. This helps you ensure that your accounts stay within
your organization's access control guidelines.
Organizations builds upon AWS Identity and Access Management (IAM) by expanding the granular control that
IAM provides to the account level. It does this by giving you control over what users and roles in an account or a
group of accounts can do. This additional layer of control ensures that users can access only what both
Organizations and IAM policies allow. If either service blocks an operation, the user will not be able to access
that operation.
See the link provided on the course resources page for more information on AWS Organizations.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 44
AWS Training and Certification Module 9: Securing User, Application, and Data Access
1. Create a hierarchy of
organizational units
(OUs).
40
Here is an example AWS organization. It’s defined inside a regular AWS account that’s referred to on the slide as
the primary account because the AWS organization is defined in it.
Step 1: Create a hierarchy of OUs. When you create an organization in the primary account, the organization
automatically creates a parent container that is called root. Under each root in the organization, you can then
define OUs.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 45
AWS Training and Certification Module 9: Securing User, Application, and Data Access
2. Assign accounts to
OUs as member
accounts.
41
Step 2: Assign accounts to OUs as member accounts. Each of the member accounts are assigned the following:
• Member account, AWS account #1 is assigned to internal IT OU
• Member account, AWS account #2 is assigned to engineering OU
• Member account, AWS account #3 is assigned to development OU
• Member account, AWS account #4 is assigned to production OU
• Member account, AWS account #5 is assigned to production OU
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 46
AWS Training and Certification Module 9: Securing User, Application, and Data Access
42
Step 3: To configure access controls across accounts, you then define SCPs. In this example, there is SCP a, b,
and c.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 47
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Organizations SCPs
• Offer central control over the maximum available permissions for all accounts in your
organization.
• Enable control of which services are accessible to IAM users in member accounts.
• Define permissions that affect an entire account.
• Define guardrails, or sets limits, on the actions that the account's administrator can
delegate to the IAM users and roles in the affected accounts. IAM policies that are
defined in individual accounts still apply.
• SCPs cannot be overridden by the local administrator.
Best practice
It’s easier to define policies across multiple accounts in an SCP than to
replicate these permissions settings into IAM policy documents in each
account.
43
Organizations SCPs: SCPs enable you to control which services are accessible to IAM users in member accounts.
Say that you have specific policies that you want to apply across multiple accounts. It’s easier to define these
policies in an SCP than to replicate these permissions settings into IAM policy documents in each account.
Permissions defined in an SCP affect an entire account. They limit permissions for every request made by a
principal within the account. An IAM entity (user or role) can make a request that is affected by an SCP, a
permissions boundary, and an identity-based policy. In this case, the request is allowed only if all three policy
types allow it. The effective permissions are the intersection of all three policy types. An explicit deny in any of
these policies overrides the allow.
SCPs alone are not sufficient in granting permissions to the accounts in your organization. No permissions are
granted by an SCP. An SCP defines a guardrail, or sets limits, on the actions that the account's administrator can
delegate to the IAM users and roles in the affected accounts.
SCPs should be used with IAM policies that are defined in each individual account. You can think of the SCPs as
providing general boundaries around the services and general permissions that users should be allowed (based
on the guardrails, or limits set) or denied access to. Then, you can use IAM policies to set more granular access
controls that are specific to individual accounts.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 48
AWS Training and Certification Module 9: Securing User, Application, and Data Access
44
This slide lists a few common examples for using SCPs to control access and behaviors within an account.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 49
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Example SCP
Prevent member accounts from leaving the organization:
{
"Version": "2023-06-17",
"Statement": [
{
"Effect": "Deny",
"Action": [ "organizations:LeaveOrganization"],
"Resource": "*"
}
]
}
45
This SCP example prevents member accounts from leaving the organization. The effect of the policy statement
is to explicitly deny the organizations:LeaveOrganization action, which prevents member accounts from leaving.
See the link provided on the course resources page for more information on SCPs in AWS Organizations.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 50
AWS Training and Certification Module 9: Securing User, Application, and Data Access
46
After the SCPs are created, the final step is attaching each policy to the appropriate place in the hierarchy of
OUs and accounts.
The policy flows out away from the root and it affects all the OUs and accounts beneath it. If a policy is attached
to the root, it affects all OUs and accounts in the hierarchy. Therefore, if you apply an SCP to the root (like SCP
Policy A in the example), it will apply to all OUs and accounts in the organization. You can attach a SCP to the
root, to any OU, or to an individual account.
Remember that like IAM policies, SCPs will only grant access if it is both explicitly allowed and is not explicitly
denied by any other SCP or IAM policy that applies to the user. For example, say that SCP Policy A, which is
applied to the root of the organization, sets more restrictions on a particular service or set of resources than
SCP Policy C. Then, users in Account 5 are subject to the more restrictive permissions set by Policy A. Similarly, if
any IAM policies at the individual account level explicitly deny any actions for the user, these IAM policies
override any permissions in the SCPs that are granted to the account.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 51
AWS Training and Certification Module 9: Securing User, Application, and Data Access
47
Users or groups can have multiple policies attached to them that grant different permissions. In that case, the
permissions for the users are calculated based on the combination of policies. But the basic principle still
applies: If the user has not been granted an explicit permission for an action and a resource, the user does not
have those permissions.
Attach identity-based or resource-based policies to IAM users or to the resources in your organization's
accounts. Attach an SCP to an Organizations entity (root, OU, or account) to define a guardrail. The SCP sets
limits upon the actions that the IAM users and roles in the affected accounts can perform.
Organizations SCPs are applied to an entire AWS account. They limit permissions for every request made by a
principal within the account. An IAM entity (user or role) can make a request that is affected by an SCP or an
identity-based policy. In this case, the request is allowed only if both policy types allow it. The effective
permissions are the intersection of the policies. An explicit deny in any of these policies overrides the allow.
The permissions allowed (center) are only the ones that are allowed both in the IAM identity-based permissions
policy and the Organizations SCP. In this case, because the SCP does not deny access to Amazon Simple Storage
Service (Amazon S3), the allow s3* in the identity-based policy grants the permission to access Amazon S3.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 52
AWS Training and Certification Module 9: Securing User, Application, and Data Access
{ {
"Version": "2012-10-17", "Version": "2012-10-17",
"Statement": [ "Statement": {
{ "Effect": "Allow",
"Effect": "Allow", "Action":"iam:CreateUser",
"Action": [ "Resource": "*"
"s3:*", }
"cloudwatch:*", }
"ec2:*" IAM user
],
"Resource": "*"
} The permission boundary does not include access to IAM, so
]
the identity policy will fail to grant the iam:CreateUser
}
permission to this user.
48
AWS supports permissions boundaries for IAM entities (users or roles). A permissions boundary is an advanced
feature for using a managed policy to set the maximum permissions that an identity-based policy can grant to
an IAM entity. An entity's permissions boundary allows it to perform only the actions that are allowed by both
its identity-based policies and its permissions boundaries.
You can use an AWS managed policy or a customer managed policy to set the boundary for an IAM entity (user
or role). That policy limits the maximum permissions for the user or role.
When you use a policy to set the permissions boundary for a user, it limits the user's permissions but does not
provide permissions on its own. In this example, the policy sets the maximum permissions of an IAM user as all
operations in Amazon S3, Amazon CloudWatch, and Amazon Elastic Compute Cloud (Amazon EC2). This IAM
user can never perform operations in any other service, including IAM, even if they have a permissions policy
that allows it.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 53
AWS Training and Certification Module 9: Securing User, Application, and Data Access
49
As illustrated in the example on the previous slide, the permissions boundary for an IAM entity (user or role)
sets the maximum permissions that the entity can have. This can change the effective permissions for that user
or role. Identity-based policies are inline or managed policies that are attached to a user, group of users, or role.
Identity-based policies grant permission to the entity, and permissions boundaries limit those permissions. The
effective permissions are the intersection of both policy types.
An explicit deny in either of these policies overrides the allow. So, although the permissions boundary includes
Amazon S3, the IAM identity-based policy denies it, and that explicit deny prevents this user from accessing
Amazon S3. Because the permissions boundary allows ec2* and the identity-policy allows ec2:
DescribeInstances, this IAM user would be able to use EC2 describe instances.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 54
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Within an account, the permissions for an entity can be affected by identity-based policies, resource-based
policies, permissions boundaries, Organizations SCPs, or session policies.
If any one of these policy types explicitly denies access for an operation, then the request is denied. The
permissions granted to an entity by multiple permissions types are more complex. This example shows the
impact of using all three of the permissions types discussed in this section: an SCP on the organization, and both
a permissions boundary and an identity-based policy on an IAM user.
For more details about how AWS evaluates policies, see the policy evaluation logic link provided on the course
resource page.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 55
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Both permissions boundaries and organizational SCPs let you limit the scope of access that will be granted. Key
distinctions are that the permission boundary is associated to a user or role, while the SCP is applied across an
organization. Neither permissions boundaries or SCPs actually grant permissions on their own. In practice,
permissions boundaries are often used to explicitly allow a subset of services, preventing access to anything not
in that allow list. For example, when a role needs access to only a small subset of AWS services, you can put
those in a permission boundary. SCPs by contrast are often used to deny specific services. For example, you
have an organization that needs to use a variety of AWS services and resources, but you want to prevent them
from accessing a particular type of resource such as Amazon Relational Database Service (Amazon RDS).
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 56
AWS Training and Certification Module 9: Securing User, Application, and Data Access
AWS Control Tower offers a simple way to set up and govern a secure, multi-account AWS environment. It
establishes a landing zone that’s based on best practices blueprints, and it enables governance using guardrails
you can choose from a pre-packaged list. A guardrail, also called a control, is a high-level rule that provides
ongoing governance for your overall AWS environment. It's expressed in plain language.
The landing zone is a well-architected, multi-account baseline that follows AWS best practices. Guardrails
implement governance rules for security, compliance, and operations.
If you want to create or manage your multi-account AWS environment with best practices, use AWS Control
Tower. It offers prescriptive guidance to govern your AWS environment at scale. It gives you control over your
environment without sacrificing the speed and agility AWS provides for builders. You will benefit if you are
building a new AWS environment, starting out on your journey on AWS, starting a new cloud initiative, are
completely new to AWS, or if you have an existing multi-account AWS environment but prefer a solution with
built-in blueprints and guardrails.
For more information, see AWS Control Tower on the content resources page of your online course.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 57
AWS Training and Certification Module 9: Securing User, Application, and Data Access
53
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 58
AWS Training and Certification Module 9: Securing User, Application, and Data Access
54
This section focuses on encrypting data at rest using the AWS Key Management Service (AWS KMS).
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 59
AWS Training and Certification Module 9: Securing User, Application, and Data Access
55
Sensitive data can be protected at multiple layers, including while in transit and while at rest.
You protect data while it's traveling from network to network or being transferred. You also protect data when it
resides in a local storage device or cloud storage device.
The confidentiality, integrity, and availability (CIA) triad is a widely used model to implement data security in
enterprises. Confidentiality aims at keeping personal data safe and hidden from non-authorized people.
Integrity consists of ensuring that data isn’t modified or altered throughout the process in which it is used.
Finally, availability ensures that data stays available when needed for the right person.
Protecting data at rest contributes to the confidentiality and integrity of information. It ensures the security of
the data even if an unauthorized party gains access to it. Encrypting data at rest makes it much more difficult for
attackers to compromise data, even if they can compromise an endpoint. Also, you might need to protect your
data at rest due to business or compliance requirements.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 60
AWS Training and Certification Module 9: Securing User, Application, and Data Access
56
Encryption is the process of using a code, called a cipher, to turn readable data into unreadable data for another
party. The cipher contains both algorithms to encrypt and to decrypt the data. A key is a series of numbers and
letters that the algorithm uses to encrypt and decrypt data.
Encryption works by using an algorithm with a key to convert plaintext data into unreadable data (ciphertext)
that can only become readable again with the right key. For example, a simple phrase such as “Hello World!”
might look like “1c28df2b595b4e30b7b07500963dc7c” when encrypted.
Several different encryption algorithms exist, all using different types of keys. A strong encryption algorithm
relies on mathematical properties to produce ciphertext that can’t be decrypted by using any practically
available amount of computing power without also having the necessary key. Therefore, protecting and
managing the keys becomes a critical part of any encryption solution.
There are two types of encryption: symmetric encryption and asymmetric encryption. Both types can be used
for encrypting data in transit or data at rest.
Envelope encryption uses both symmetric and asymmetric encryption together. For example, the TLS (SSL)
protocol performs envelope encryption by combining the use of both symmetric and asymmetric encryption.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 61
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Symmetric encryption
• Uses same key to encrypt
and decrypt the data
• Typically faster and efficient
for large amounts of data
• Widely used and generally
accepted to be secure
57
Symmetric encryption uses the same key to encrypt and decrypt the data. The key is a shared secret between
the sender and the receiver.
As illustrated in the diagram, the key is used to encrypt the file before it is stored, and then it must be decrypted
using the same key before it can be retrieved and read.
This type of encryption is typically faster and is, therefore, efficient for large amounts of data. This type of
encryption is widely used and generally accepted to be secure. Because a single key is used for both encryption
and decryption, a best practice is to change the key frequently to prevent an unauthorized person from
obtaining it.
For example, the TLS protocol uses symmetric encryption for data exchange.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 62
AWS Training and Certification Module 9: Securing User, Application, and Data Access
58
See the link provided on the course resources page for more information about when symmetric encryption is
recommended.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 63
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Asymmetric encryption
• Uses a key pair: a public key
for encryption and a private
key for decryption
• Generally regarded to be
more secure than symmetric
encryption, but it is slower
59
Asymmetric encryption uses both a public key and a private key (a key pair) to encrypt and decrypt the data.
Every user in the conversation has a key pair. Asymmetric encryption is more complex and much slower than
symmetric encryption. However, it provides more capabilities in the way that keys are managed.
In the diagram that is shown on the slide, you can see that the file is encrypted with a public key. After it’s
encrypted, the only way to retrieve and read the file is to use the private key associated to this public key to
decrypt the message.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 64
AWS Training and Certification Module 9: Securing User, Application, and Data Access
60
Asymmetric encryption uses a pair of keys: a public key for encryption and a private key for decryption. You can
share the public key because it isn’t used for decryption, but access to the private key should be highly
restricted. Asymmetric encryption is generally regarded to be more secure than symmetric encryption, but it’s
slower because it uses longer key lengths and requires more complex encryption calculations.
Asymmetric encryption can also provide non-repudiation, which means that the sender of a message cannot
later deny sending it. This is because the message was encrypted with the sender's private key, which can only
be decrypted with their public key.
See the link provided on the course resources page for more information about creating and using asymmetric
AWS Key Management Service (AWS KMS) keys.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 65
AWS Training and Certification Module 9: Securing User, Application, and Data Access
61
Consider the analogy of locking your valuables in a safe. But what if someone finds your safe key? To add
additional protection, you can lock the safe key in your safety deposit box at the bank. You can continue to add
layers of security by locking away each key, reducing the risk that someone could get to the key they need to
unlock your safe.
Envelope encryption is the practice of encrypting the key that you used to encrypt your data. You can even
encrypt the data encryption key under another encryption key, and encrypt that encryption key under another
encryption key.
See the link provided on the course resources page for more information about envelope encryption.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 66
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Depending on your security requirements, you can use client-side encryption (CSE) or server-side encryption
(SSE) to encrypt your data. The approaches differ in when, where, and who encrypts and decrypts the data. The
approach doesn't necessarily define how the data is encrypted. In addition, the approaches are not exclusive—
you can often use CSE and SSE on the same data for an enhanced security profile. Each approach has
advantages.
With CSE, your applications encrypt data locally before submitting it to AWS and decrypt data after receiving it
from AWS. You create and manage your own encryption keys. Data is stored in an encrypted form, with keys and
algorithms known only to you.
With SSE, data is encrypted at its destination by the application or service that receives it. For example, if you
use SSE with Amazon Simple Storage Service (Amazon S3), the service encrypts your data at the object level as
it writes to disks in AWS data centers and decrypts the data for you when you access it. The encryption process
is transparent to the user.
AWS supports both CSE and SSE. Most AWS services that store or manage customer data offer an SSE option or
perform SSE on your data by default. These services transparently encrypt your data before writing it to disk and
transparently decrypt the data when you access it. Most AWS services that support SSE are integrated with AWS
KMS to protect the encryption keys that protect your data. You will learn more about AWS KMS later in this
module.
See the link provided on the course resources page for more information on protecting data using encryption.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 67
AWS Training and Certification Module 9: Securing User, Application, and Data Access
63
Client-side encryption takes place before data is submitted to AWS, and decryption occurs after data is retrieved
from AWS. In this example, the unencrypted data is encrypted in the corporate data center, and then Amazon S3
receives your encrypted data but does not play a role in encrypting or decrypting it.
To enable client-side encryption, you can use a key that’s stored in AWS KMS or a key that you store within your
application.
AWS supports client-side encryption libraries such as the AWS Encryption SDK, Amazon DynamoDB Encryption
Client, and Amazon S3 encryption clients.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 68
AWS Training and Certification Module 9: Securing User, Application, and Data Access
64
Server-side encryption is the encryption of data at its destination by the application or service that receives it.
In this example, your unencrypted source data comes from systems in your data center. You can upload that
data over an HTTPS connection to Amazon S3 which encrypts the data before storing it in the Amazon S3
bucket. The service endpoint will handle the encryption and key management processes for you.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 69
AWS Training and Certification Module 9: Securing User, Application, and Data Access
65
AWS KMS is a managed service that provides the ability to create and control the keys that are used to encrypt
your data. You can create data keys with unique aliases and descriptions for better management, automatically
rotate your keys on a scheduled basis, and disable or delete keys so that no one can use them. You can also
import your own keys instead of using AWS-generated keys.
The service uses FIPS 140-2 validated hardware security modules (HSMs) to protect keys. AWS KMS is integrated
with other AWS services to help you protect the data that you store with these services. Integrated AWS
services use envelope encryption to help protect your encryption keys.
With AWS KMS, you can centrally manage and securely store your keys. You can use the keys within your
applications and supported AWS Cloud services to protect your data, but the keys never leave AWS KMS. This
reduces the risk of having your data key compromised. You submit data to AWS KMS to be encrypted or
decrypted under keys that you control.
You can set usage policies on these keys to determine which users can use them. All requests to use these keys
are logged in AWS CloudTrail so that you can understand who used which key and when. CloudTrail logs all AWS
KMS operations, including read-only operations, operations that manage KMS keys, and cryptographic
operations.
See the links provided on the course resources page for more information on AWS KMS.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 70
AWS Training and Certification Module 9: Securing User, Application, and Data Access
66
AWS KMS keys are the primary resource in AWS KMS. You can use an AWS KMS key to encrypt, decrypt, and re-
encrypt data. It can also generate data keys that you can use outside of AWS KMS.
In AWS KMS, cryptographic operations are API operations that use KMS keys to protect data. Because KMS keys
remain within AWS KMS, you must call AWS KMS to use a KMS key in a cryptographic operation.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 71
AWS Training and Certification Module 9: Securing User, Application, and Data Access
You can use this operation to decrypt ciphertext that was encrypted under a symmetric
encryption KMS key or an asymmetric encryption KMS key. When the KMS key is asymmetric, you
must specify the KMS key and the encryption algorithm that was used to encrypt the ciphertext.
• GenerateDataKey: Returns a unique symmetric data key for use outside of AWS KMS. This
operation returns a plaintext copy of the data key and a copy that is encrypted under a symmetric
encryption KMS key that you specify.
• GenerateDataKeyPair: Returns a unique asymmetric data key pair for use outside of AWS KMS.
This operation returns a plaintext public key, a plaintext private key, and a copy of the private key
that is encrypted under the symmetric encryption KMS key that you specify.
See the link provided on the course resources page for more information on AWS KMS features.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 72
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Important
AWS services that are integrated with AWS KMS use only symmetric encryption
KMS keys to encrypt your data. These services do not support encryption with
asymmetric KMS keys.
67
Many AWS services use AWS KMS to support encryption of your data. When an AWS service is integrated with
AWS KMS, you can use the AWS KMS keys in your account to protect the data that the service receives, stores,
or manages for you. For the complete list of AWS services integrated with AWS KMS, see the link provided on
the content resources page.
Amazon S3 is an object storage service that stores data as objects within buckets. Buckets and the objects in
them are private and can be accessed only if you explicitly grant access permissions.
Amazon S3 integrates with AWS KMS to provide server-side encryption of Amazon S3 objects. Amazon S3 uses
KMS keys to encrypt your Amazon S3 objects. The encryption keys that protect your objects never leave AWS
KMS unencrypted. This integration also enables you to set permissions on the KMS key and audit the operations
that generate, encrypt, and decrypt the data keys that protect your secrets.
Amazon Elastic Block Store (Amazon EBS): When you attach an encrypted Amazon EBS volume to a supported
Amazon Elastic Compute Cloud (Amazon EC2) instance type, data stored at rest on the volume, disk I/O, and
snapshots created from the volume are all encrypted. The encryption occurs on the servers that host Amazon
EC2 instances.
This feature is supported on all Amazon EBS volume types. You access encrypted volumes the same way you
access other volumes. Encryption and decryption are handled transparently, and they require no additional
action from you, your EC2 instance, or your application. Snapshots of encrypted volumes are automatically
encrypted, and volumes that are created from encrypted snapshots are also automatically encrypted.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 73
AWS Training and Certification Module 9: Securing User, Application, and Data Access
68
In this scenario, AMS KMS is used to encrypt data at rest (SSE-KMS). The user creates a KMS key and uses it to
encrypt objects that are stored in Amazon S3.
This diagram explains how encryption happens when uploading a file to Amazon S3.
1. You request to upload a file and store it as an encrypted object in an S3 bucket.
2. Amazon S3 requests a data key from AWS KMS to use to encrypt the file.
3. AWS KMS generates a plaintext data key and encrypts the data key by using the customer managed key.
Data keys are used to encrypt data locally in the AWS service or your application.
4. AWS KMS sends both copies of the data key to Amazon S3.
5. Amazon S3 encrypts the object by using the plaintext data key, stores the object, and then deletes the
plaintext data key. The encrypted key is kept in the object metadata.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 74
AWS Training and Certification Module 9: Securing User, Application, and Data Access
69
Now, this diagram explains what happens in the same scenario (SSE-KMS) when the user requests to open an
encrypted object that is stored in Amazon S3.
1. You request to open the object.
2. Amazon S3 sends the encrypted data key to AWS KMS in a decrypt request.
3. AWS KMS decrypts the data key by using the customer managed key (which never leaves the AWS KMS
service).
4. AWS KMS sends the plaintext data key back to Amazon S3.
5. Finally, Amazon S3 decrypts the ciphertext of the data object, allows you to open the object, and deletes the
plaintext copy of the data key.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 75
AWS Training and Certification Module 9: Securing User, Application, and Data Access
70
Amazon EBS encryption is a straight-forward encryption solution for EBS resources that are associated with your
EC2 instances. With Amazon EBS encryption, you aren't required to build, maintain, and secure your own key
management infrastructure.
Amazon EBS encryption uses KMS keys when creating encrypted volumes and snapshots. Each volume is
encrypted using AES-256-XTS. This requires two 256-bit keys, which you can think of as one 512-bit key. The
data key is encrypted under a KMS key in your account. For Amazon EBS to encrypt a volume for you, it must
have access to a customer managed key in the account. You do this by providing a grant for Amazon EBS to the
customer managed key to create data keys and to encrypt and decrypt these data keys.
The following are the basic steps to encrypt and decrypt EBS volume data:
1. Amazon EBS obtains an encrypted data key under a customer managed key through AWS KMS and stores
the encrypted key with the encrypted data.
2. The servers that host EC2 instances retrieve the encrypted data key from storage.
3. A call is made to AWS KMS over TLS to decrypt the encrypted data key. AWS KMS identifies the KMS key,
makes an internal request to an HSM in the fleet to decrypt the data key, and returns the key to the
customer over the TLS session.
4. The decrypted data key is stored in memory and used to encrypt and decrypt all data going to and from the
attached EBS volume. Amazon EBS retains the encrypted data key for later use in case the data key in
memory is no longer available.
The Advanced Encryption Standard (AES) is an algorithm established by the US National Institute of Standards
and Technology (NIST) that uses symmetric encryption.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 76
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Key takeaways: • Encrypting data at rest makes it more difficult for attackers
to compromise data, even if they can compromise an
Encrypting data endpoint.
71
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 77
AWS Training and Certification Module 9: Securing User, Application, and Data Access
72
You will now complete a lab. The next slide summarizes what you will do in the lab, and you will find the
detailed instructions in the lab environment.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 78
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Lab introduction: • In this lab, you use the AWS Key Management
Service (AMS KMS) to encrypt data at rest.
AWS KMS lab
• The tasks that you perform include the
following:
• Creating an AWS KMS key
• Encrypting an object stored in Amazon Simple
Storage Service (Amazon S3)
• Encrypting an Amazon Elastic Block Store
(Amazon EBS) volume
• Auditing AWS KMS key usage using AWS
CloudTrail
• Open your lab environment to start the lab and
find additional details about the tasks that you
will perform.
73
Access the lab environment through your online course to get additional details and complete the lab.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 79
AWS Training and Certification Module 9: Securing User, Application, and Data Access
74
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 80
AWS Training and Certification Module 9: Securing User, Application, and Data Access
75
This section highlights additional examples of security services designed to improve your ability to follow
security best practices and secure all layers of your applications.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 81
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Find the complete list and links to service pages at: [Link]
76
AWS has a set of services specifically designed to help you address security across your cloud infrastructure.
This slide shows the categories of services and lists examples, some of which you learned about in this course.
See Security, Identity, and Compliance on AWS in your course resources for a more detailed description of each
category and for links that take you deeper into each category and individual service.
Earlier sections of this module looked at many of the identity and access management services that support
protecting access, and the previous section talked about services that support protecting data at rest. The
following slides describe a few additional services as examples of the types of features that are available when
architecting your application's security.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 82
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Defend your borders Protect your data Detect and respond to threats
• AWS WAF and AWS • Amazon Macie • Amazon Inspector
Shield
• Amazon Detective
77
A key part of the AWS Well-Architected Security pillar is applying security at all layers and implementing a
defense in depth approach. Limiting access is one important layer that you learned about in this module.
Additional layers of security include keeping out unwanted traffic, adding additional data protection
mechanisms (for example, to protect sensitive and personally identifiable data), and automating your ability to
detect and respond to vulnerabilities and security events. AWS security services reduce the burden of writing
code to handle these levels of security.
The next few slides look at these services in a bit more detail.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 83
AWS Training and Certification Module 9: Securing User, Application, and Data Access
AWS WAF
Description Features Example use cases
• A web application firewall • Use managed or custom • Block requests that are
that lets you monitor the rules. missing the HTTP User-
HTTP and HTTPS requests • Allow or block requests Agent header.
that are forwarded to your based on things like IP • Detect and manage
protected web application address, country of origin, or malicious account creation
resources header values. attempts on the
• Use AWS Shield (included at application's sign-up page.
no additional cost) to help
minimize the impact of
distributed denial of service
(DDoS) attacks.
78
AWS WAF is a web application firewall that lets you monitor the HTTP and HTTPS requests that are forwarded to
your protected web application resources.
AWS Shield provides protection against distributed denial of service (DDoS) attacks for AWS resources, at the
network and transport layers (layer 3 and 4), and the application layer (layer 7).
See the link provided on the course recourses page for more information on AWS WAF, AWS Shield, and AWS
Firewall Manager.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 84
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Amazon Macie
Description Features Example use case
• A data security service that • Perform automated • Use Macie to identify
discovers sensitive data sensitive data discovery. sensitive data being
stored in Amazon Simple • Create and run sensitive migrated into Amazon S3.
Storage Service (Amazon S3) data discovery jobs. Notify an administrator to
by using machine learning review the data and decide
• Use built-in or custom data
and pattern matching, whether to allow process to
identifiers.
provides visibility into data continue putting the objects
security risks, and enables • Review, analyze, and into Amazon S3.
automated protection manage findings.
against those risks
79
Amazon Macie is a security service that uses machine learning to automatically discover, classify, and protect
sensitive data in AWS. Macie recognizes personally identifiable information (PII) such as passport numbers,
medical ID numbers, and tax ID numbers. Macie also recognizes financial information, encryption keys, and
credentials. Macie also allows you to add custom-defined data types using regular expressions to enable Macie
to discover proprietary or unique sensitive data for your business.
Currently, Macie protects data stored in Amazon Simple Storage Service (Amazon S3) only and is available in
most AWS Regions. Macie has dashboards and alerts that give visibility into data access by analyzing Amazon S3
resource-based policies and access control lists (ACLs) during sensitive data recovery. The service continuously
monitors data and generates detailed alerts when it detects risk of unauthorized access or inadvertent data
leaks.
With Macie, you have full control of the service through the Macie API set, and you can centrally manage Macie
for multiple accounts. Macie integrates with AWS Organizations, which means that you can manage as many as
5,000 Macie accounts for a single AWS organization. You can also continue to use native Macie features for
managing multiple accounts, which enables you to manage as many as 1,000 member accounts with a single
Macie administrator account.
See the link provided on the course recourses page for more information on Amazon Macie.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 85
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Amazon Inspector
Description Features Example use case
• A vulnerability management • Centrally manage your • Scan EC2 Amazon Machine
service that continuously environment through a Images (AMIs) and generate
scans your AWS workloads single account by using AWS Amazon Inspector finding
for software vulnerabilities Organizations. reports to help ensure that
and unintended network • Assess vulnerabilities your AMIs are scanned for
exposure accurately with the Amazon known vulnerabilities and
• Discovers and scans running Inspector Risk score. updated prior to
Amazon Elastic Compute • Identify high-impact deployment.
Cloud (Amazon EC2) findings with the Amazon
instances, container images Inspector dashboard.
in Amazon Elastic Container
• Publish findings to Amazon
Registry (Amazon ECR), and
EventBridge to support
AWS Lambda functions
integration with other
services.
80
Amazon Inspector is a vulnerability management service that continuously scans your AWS workloads for
vulnerabilities. Amazon Inspector automatically discovers and scans Amazon Elastic Compute Cloud (Amazon
EC2) instances and container images that reside in Amazon Elastic Container Registry (Amazon ECR) for software
vulnerabilities and unintended network exposure.
When Amazon Inspector discovers a software vulnerability or network issue, the service creates a finding. A
finding describes the vulnerability, identifies the affected resource, rates the severity of the vulnerability, and
provides remediation guidance.
See the link provided on the course recourses page for more information on Amazon Inspector.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 86
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Amazon Detective
Description Features Example use case
• Helps analyze, investigate, • View data organized into a • Triage a potential issue by
and quickly identify the root pre-built graph model with finding all activity related to
cause of security findings or security-related a specific IAM entity.
suspicious activities relationships. The model
• Automatically collects log summarizes contextual and
data from AWS resources behavioral insights.
and uses machine learning, • Quickly validate, compare,
statistical analysis, and and correlate the data to
graph theory to generate reach conclusions.
visualizations that support • Automatically ingest and
faster and more efficient process relevant data from
security investigations all enabled accounts.
81
Detective helps you analyze, investigate, and quickly identify the root cause of security findings or suspicious
activities. Detective automatically collects log data from your AWS resources. It then uses machine learning,
statistical analysis, and graph theory to generate visualizations that help you to conduct faster and more
efficient security investigations. The Detective prebuilt data aggregations, summaries, and context help you to
quickly analyze and determine the nature and extent of possible security issues.
With Detective, you can access up to a year of historical event data. This data is available through a set of
visualizations that show changes in the type and volume of activity over a selected time window. Detective links
these changes to GuardDuty findings.
See the link provided on the course recourses page for more information on Detective.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 87
AWS Training and Certification Module 9: Securing User, Application, and Data Access
82
AWS Security Hub is a great place to start when discussing AWS services for security, identity, and compliance.
Security Hub is a service that helps you monitor your cloud security posture through the use of automated,
continuous security best practice checks against your AWS resources. Security Hub aggregates security alerts
from various AWS services and third-party partner products and presents them in a standardized format,
making it easier for you to act on the alerts. You can also use Security Hub to create automated response,
remediation, and enrichment workflows by taking advantage of Security Hub integration with EventBridge.
Security Hub provides a security score for each enabled standard and a total score for all accounts associated
with your administrator account. This information can help you monitor your overall security posture.
See the link provided on the course resources page for more information on Security Hub.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 88
AWS Training and Certification Module 9: Securing User, Application, and Data Access
83
AWS Trusted Advisor is not specific to security, but it provides security recommendations as part of its data.
AWS Trusted Advisor is a service that provides recommendations that help you follow AWS best practices.
These best practices were learned from serving hundreds of thousands of AWS customers. Trusted Advisor
evaluates your account by using checks based on five categories of AWS best practices. The checks identify ways
to optimize your AWS infrastructure, improve security and performance, reduce costs, and monitor service
quotas.
Assume you're the administrator of your organization's AWS account. You're looking for ways to optimize your
account resources and improve your overall security posture, but the time it would take to do so manually
would be prohibitive. Trusted Advisor can automate this process for you, providing you with recommendations
for actions you can take to improve these areas. You can then follow the recommendations to optimize your
resources and security posture.
Trusted Advisor is available in all AWS Support plans. AWS Basic Support and AWS Developer Support customers
can access core security checks and all checks for service quotas. AWS Business Support and AWS Enterprise
Support customers can access all checks, including cost optimization, security, fault tolerance, performance, and
service quotas.
See the link provided on the course recourses page for more information on Trusted Advisor.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 89
AWS Training and Certification Module 9: Securing User, Application, and Data Access
84
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 90
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Module wrap-up
Securing User, Application, and Data Access
85
This section summarizes what you have learned and brings the module to a close.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 91
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Module summary
This module prepared you to do the following:
• Use AWS Identity and Access Management (IAM) users, groups, and roles to
manage permissions.
• Implement user federation within an architecture to increase security.
• Describe how to manage multiple AWS accounts.
• Recognize how AWS Organizations service control policies (SCPs) increase
security within an architecture.
• Encrypt data at rest by using AWS Key Management Service (AWS KMS).
• Identify appropriate AWS security services based on a given use case.
86
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 92
AWS Training and Certification Module 9: Securing User, Application, and Data Access
87
Use your online course to access the knowledge check for this module.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 93
AWS Training and Certification Module 9: Securing User, Application, and Data Access
• Enforce the following security rules on users in the Tester role (testers) in both accounts.
• Testers can only access the Amazon EC2 and Amazon RDS services.
88
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 94
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Choice Response
Create a service control policy (SCP) to deny all actions on all AWS services except for the Amazon EC2 and Amazon RDS
A
services, and attach it to the Tester role in both accounts.
Create an AWS Identity and Access Management (IAM) policy with the required EC2 and RDS permissions, and attach it
B
to the organizational unit.
Create a service control policy (SCP) to deny all actions on all AWS services except for the Amazon EC2 and Amazon RDS
C
services, and attach it to the organizational unit.
Create an AWS Identity and Access Management (IAM) policy in both accounts with the required EC2 and RDS
D
permissions, and attach it to the Tester role.
Create a service control policy (SCP) in both accounts with the required EC2 and RDS permissions, and attach it to the
E
Tester role.
89
Use the key words that you identified on the previous slide, and review each of the possible responses to
determine which one best addresses the question.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 95
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Choice Response
Create a service control policy (SCP) to deny all actions on all AWS services except for the Amazon EC2 and Amazon RDS
C
services, and attach it to the organizational unit.
Create an AWS Identity and Access Management (IAM) policy in both accounts with the required EC2 and RDS
D
permissions, and attach it to the Tester role.
90
Choice E is incorrect. SCPs cannot be created in a member account and cannot be attached to a role.
Choice C is correct. The SCP limits the list of services available to testers to Amazon EC2 and Amazon RDS.
Choice D is correct. The IAM policy grants the specific permissions for each of the two services.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 96
AWS Training and Certification Module 9: Securing User, Application, and Data Access
Thank you
91
That concludes this module. The Content Resources page of your course includes links to additional resources
that are related to this module.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 97