Shared Responsibility Model and AWS IAM Basics: Users, Groups, Roles, Policies and Least Privilege

AWS Technical Essentials 55 min min read Updated: Nov 17, 2026 Beginner
Shared Responsibility Model and AWS IAM Basics: Users, Groups, Roles, Policies and Least Privilege
Beginner Topic 1 of 3

Shared Responsibility Model

Security in AWS is a partnership. AWS protects the cloud itself. You protect what you put in it.

AWS is responsible for: security OF the cloudYou are responsible for: security IN the cloud
Buildings, power, cooling, physical securityYour data and who can access it
Hardware, servers, network cablesIAM users, passwords, MFA, permissions
Virtualization layer and global networkOperating system patches on EC2
Managed service software (for example the RDS engine platform)Security group and firewall settings, encryption choices, application code
  • The responsibility shifts with the service type: with EC2 you patch the guest OS, with Lambda or S3 AWS handles much more, but you still control access and data
  • Easy memory: AWS = hardware and facilities. You = data, access, configuration

Why IAM?

AWS Identity and Access Management (IAM) decides who can do what on which resources. It is free and global.

TermMeaningExample
AuthenticationProving who you arePassword plus MFA code
AuthorizationWhat you are allowed to doCan read S3, cannot delete EC2
PrincipalSomeone or something that makes a requestA user, a role, an application

IAM Building Blocks

ItemMeaningTip
Root userThe account owner. UnlimitedMFA on, no keys, rarely used
IAM userA person or app identity with a name and credentialsOne user per person. Never share
IAM groupA collection of users that share permissionsDevelopers, Admins, Auditors
IAM roleAn identity with permissions that is assumed temporarily by a user, service or another accountEC2 uses a role to call S3 with no keys
IAM policyA JSON document that lists permissionsAttach to users, groups or roles
Permission set (Identity Center)A set of policies given to workforce users across accountsPreferred way for people to sign in

Reading a Policy

json { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": ["s3:GetObject", "s3:ListBucket"], "Resource": ["arn:aws:s3:::my-photos", "arn:aws:s3:::my-photos/*"] } ] }
PartMeaning
EffectAllow or Deny
ActionWhich API calls (service:Action)
ResourceWhich things, written as an ARN (Amazon Resource Name)
Condition (optional)Extra rules such as source IP, MFA, time or tags
Golden rule Everything is denied by default. You must allow it. An explicit Deny always beats an Allow.

Types of Policies You Meet First

  • AWS managed policies: ready-made by AWS, like AmazonS3ReadOnlyAccess or AdministratorAccess
  • Customer managed policies: you write and reuse them
  • Inline policies: attached directly to one identity (use rarely)
  • Resource-based policies: attached to a resource such as an S3 bucket

Least Privilege

Least privilege means giving only the permissions needed for the job, nothing more. Start small and add when needed.

Too muchBetter
AdministratorAccess for every developerDevelopers can use EC2 and S3 in the dev account only
s3:* on *s3:GetObject on one bucket
One shared loginOne user per person with MFA

Roles: Temporary Credentials, No Keys

A role has no password or permanent keys. Whoever assumes it receives temporary credentials that expire. This is safer than storing access keys.

bash # 1. Trust policy: who may assume the role (EC2 service here) cat > trust.json <<'EOF' {"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"Service":"ec2.amazonaws.com"},"Action":"sts:AssumeRole"}]} EOF # 2. Create the role and give it S3 read-only permission aws iam create-role --role-name WebServerRole --assume-role-policy-document file://trust.json aws iam attach-role-policy --role-name WebServerRole --policy-arn arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess # 3. Wrap it in an instance profile so EC2 can use it aws iam create-instance-profile --instance-profile-name WebServerProfile aws iam add-role-to-instance-profile --instance-profile-name WebServerProfile --role-name WebServerRole
  • Use roles for EC2, Lambda, ECS and for cross-account access
  • Never put access keys inside code or a server image

Users, Groups and Policies by CLI

bash aws iam create-group --group-name Developers aws iam attach-group-policy --group-name Developers --policy-arn arn:aws:iam::aws:policy/PowerUserAccess aws iam create-user --user-name asha aws iam add-user-to-group --user-name asha --group-name Developers aws iam list-users --query 'Users[].UserName' aws iam get-account-summary --query 'SummaryMap.[Users,Groups,Roles,Policies]'

Passwords, MFA and Access Keys

ItemBest practice
Password policyMinimum length, mix of characters, expiration, prevent reuse
MFAEnable for root and every human user. Authenticator app, passkey/FIDO2 or hardware key
Access keysOnly for programs outside AWS. Rotate often, delete unused ones, never commit to Git
Credential reportDownloadable CSV of all users with password age, MFA and key status
Access AdvisorShows which services a user really used so you can remove extra permissions
Access AnalyzerFinds resources shared with outsiders

Common Beginner Mistakes

  • Using the root user for daily work
  • Giving admin to everyone
  • Hard-coding access keys in code or public repositories
  • Forgetting MFA
  • Not removing permissions of people who leave

Practice

  1. Create a group Readers with ReadOnlyAccess and a user in it, then sign in as that user and try to create an EC2 instance (it should fail)
  2. Write a policy that only allows reading one S3 bucket
  3. Create a role for EC2 with S3 read access
  4. Download the credential report and find users without MFA

Conclusion

AWS secures the cloud, you secure what is in it. Use IAM with users, groups, roles and JSON policies, follow least privilege, protect logins with MFA, and prefer roles with temporary credentials over long-lived keys.

Quick Summary: shared responsibility; IAM terms; policy; policy types; least privilege; roles; CLI; MFA and keys; mistakes.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators