Getting Started with Security Simulation Instructions
Getting Started with Security Simulation Instructions
Simulation overview
In this simulation, you use some of the Amazon Identity and Access Management
(IAM) features that you just learned about.
You will get hands-on experience with creating IAM policies, groups, and users.
You will experience logging in as users with different permissions. You will learn
how groups can be used to manage permissions for users, based on their job role.
Objectives
After completing this simulation, you will know how to do the following:
Duration
This simulation requires approximately 40 minutes to complete. You can take as
long as you need.
Prerequisites
Before you begin this simulation, you should complete the Getting Started with
Security course content.
Simulation scenario
For this simulation, you create users and groups to enable permissions that
support the following business scenario.
Your company is growing its use of AWS services, and is using many Amazon
Elastic Compute Cloud (Amazon EC2) instances and Amazon Simple Storage
Service (Amazon S3) buckets. You hire three new employees and want to give
access to new staff, based on their job function, as indicated in the following table.
IAM offers a wide variety of AWS managed polices. These are created and
administered by AWS. However, you can create your own policies that meet your
specific needs.
The following custom JSON policy provided for you grants the user the access to
start, stop, and view nano-type and micro-type instances. If this is the only policy
that is attached to the user, the user will not have access to perform any other
actions.
{
"Version": "2012-10-17",
"Statement": [
{
"Condition": {
"ForAllValues:StringLikeIfExists": {
"ec2:InstanceType": [
"*.nano",
"*.micro"
]
},
"StringEqualsIfExists": {
"ec2:Owner": "amazon"
}
},
"Action": [
"ec2:Describe*",
"ec2:StartInstances",
"ec2:StopInstances"
],
"Resource": [
"*"
],
"Effect": "Allow"
}
]
}
6. Copy and paste the preceding code into the policy editor field. NOTE: Keyboard
shortcuts won’t work for this simulation. To simulate replacing the existing
code with the preceding code, follow these specific steps:
o Open the context (right-click) menu for the policy editor field.
o From the menu, choose Select all.
o Open the context (right-click) menu for the highlighted text.
o From the menu, choose Paste.
7. Choose the scroll bar to scroll down, then choose Next.
8. In the Policy name field, enter EC2-Admin-Policy .
o Note: To record your entry, press Enter on your keyboard or choose any
place outside of the entry field.
9. Choose the scroll bar to scroll down, then choose Create policy.
You have just created a custom managed policy that provides a user with the
ability to start, stop, and view instances. This policy will be used for the EC2-
Admin group.
It is recommended that you use AWS IAM Identity Center to provide console
access to a person. IAM Identity Center is used to connect your existing workforce
identity source and centrally manage access to AWS. For this simulation, there is
no existing identity source. Therefore, you create IAM users. Permissions will work
the same.
It is a best practice to make users create a new password when the user logs in for
the first time. But to avoid the steps of creating a new password when you log in
as each user, this configuration will be cleared. If you were to leave the check box
selected, the user would automatically be provided a policy that allows the user to
create a new password.
Now that the user is created, you are provided with an opportunity to review the
Console password and to email sign-in instructions to the user.
32. On the Console sign-in details panel, choose Show to review the Console
password.
33. Choose Return to users list.
You didn’t receive this warning for user-1, because you reviewed the password by
choosing Show. But you are confident that you know the password, so you
continue to the user lists.
In task 4, you will explore another way to add users to a group. Therefore, you will
not select a group to add user-3 to at this point.
Notice that the user has no permissions. This user will not be able to do anything
in the AWS Management Console at this point.
You have created the three users that are required for the Business scenario. You
have added user-1 and user-2 to their job-role related group. Both user-1 and
user-2 have a 1 in the Groups column. This indicates how many groups each user
is in. User-3 has a 0 in the Groups column, because you did not add the user to a
group. You will add user-3 to a group in the next task.
Notice that user-3 is now showing a 1 in the Groups column. This confirms that
the user is now in a group.
68. On the Users page, choose user-2 from the User name column.
The Permissions policy pane lists all of the policies that are attached to the user
in the Policy name section. Policies that are directly attached to a user and
policies that are inherited from the user belonging to a group will appear here.
From here, you can review the permission that this AWS managed policy grants to
the user.
Notice the Sign-in URL for IAM users in this account section at the top right of
the page. The sign-in URL looks similar to the following:
https://123456789012.signin.aws.amazon.com/console
This link can be used to sign in to the AWS account that you are currently using.
(The account number is blurred out for security reasons).
75. On the AWS Account pane, choose the copy icon for Sign-in URL for IAM
users in this account to copy the link.
Next, you will duplicate the Sign in as IAM user page so that you have three
duplicate tabs open. You will use the tabs to sign in as each of your three users.
78. Open the context (right-click) menu for your browser tab.
79. Choose Duplicate.
80. Open the context (right-click) menu for your second browser tab.
81. Choose Duplicate.
You now have three duplicate tabs open. You will now sign in as user-1, who has
been hired as your Amazon S3 storage support staff.
Note: To record each entry, press Enter on your keyboard or choose any place
outside of the entry field.
o
83. In the Recently visited section, choose S3.
84. Choose the sim-website bucket.
Because this user is part of the S3-Support group in IAM, they have permissions to
view a list of the Amazon S3 buckets and their contents. However, the user cannot
create buckets. The user is also restricted from deleting or uploading files. Next,
you test the restrictions by trying to upload a file.
The failed upload message confirms that the user’s permissions are working as
expected.
Note: To record each entry, press Enter on your keyboard or choose any place
outside of the entry field.
You can see two EC2 instances. However, you cannot make any changes to
Amazon EC2 resources because you have read-only permissions.
An error message appears that says, You are not authorized to perform this
operation. This demonstrates that the policy only allows you to view information
without making changes.
The EC2-Admin group has the EC2-Admin-Policy policy attached to it. This is the
custom policy that you created in task 1. Therefore, user-3 should be able to go to
the EC2 dashboard and view instances. However, unlike user-2, user-3 should be
able to stop and start instance.
EC2 instances are listed. As an Amazon EC2 Administrator, this user should have
permissions to Stop the EC2 instance.
This time, the action is successful because user-3 has permissions to stop EC2
instances. The Instance state changes to Stopping and begins to shut down.
104. To return to the AWS Management Console Home page, choose the AWS icon
in the top left corner. In the Recently visited section, choose S3.
105. In the left navigation pane, choose Buckets.
An error message appears that says, You don’t have permissions to list buckets.
This demonstrates that the policy does not grant any access for S3.
If you wanted to give your EC2 administrator access to view buckets and bucket
objects, you could add the user to the S3-Support group. Next, you will update the
user-3 permissions so that the user can view buckets, in addition to having
administrative access to EC2.
106. Return to your normal browser window, where you are logged into the IAM
console. To do this, do the following:
o Hover near the bottom of the browser to bring up the task bar, then
choose the Google Chrome icon.
107. Choose User groups.
108. In the list of user groups, choose S3-Support.
The group provides a list of users that are in the group already.
109. Choose Add users.
Notice that user-1 is not among the list of users on the Add users to S3-Support
page. That is because this page does not show users that are already in the group.
110. On the Other users in this account pane, select the user-3 check box.
111. Choose Add users.
112. Return to the incognito window, by closing the current window.
113. On the top left of your browser, choose Refresh.
The new access is available immediately. There is no requirement for the user to
log out and log back in for the changes to take effect. User-3 now has the same
access to S3 that user-1 has. However, user-1 cannot access EC2.
Wrap up
In this simulation, you created a custom managed IAM policy. You created user groups
that had permission policies based on job roles. You created users and assigned them
to the appropriate group. You learned how to review the policies that a user inherits
from a group or policies that are directly attached to the user. You discovered how to
add many users to a group to save time. You also logged in as each user and tested
the permission. Excellent work!
Simulation complete
Congratulations! You have completed the simulation.
For more information about AWS Training and Certification, see AWS Training and
Certification.
© 2024 Amazon Web Services, Inc. or its affiliates. All rights reserved. This work
may not be reproduced or redistributed, in whole or in part, without prior written
permission from Amazon Web Services, Inc. Commercial copying, lending, or
selling is prohibited.