Tuesday, May 13, 2025

Security Boulevard Logo

Security Boulevard

The Home of the Security Bloggers Network

Community Chats Webinars Library
  • Home
    • Cybersecurity News
    • Features
    • Industry Spotlight
    • News Releases
  • Security Creators Network
    • Latest Posts
    • Syndicate Your Blog
    • Write for Security Boulevard
  • Webinars
    • Upcoming Webinars
    • Calendar View
    • On-Demand Webinars
  • Events
    • Upcoming Events
    • On-Demand Events
  • Sponsored Content
  • Chat
    • Security Boulevard Chat
    • Marketing InSecurity Podcast
    • Techstrong.tv Podcast
    • TechstrongTV - Twitch
  • Library
  • Related Sites
    • Techstrong Group
    • Cloud Native Now
    • DevOps.com
    • Security Boulevard
    • Techstrong Research
    • Techstrong TV
    • Techstrong.tv Podcast
    • Techstrong.tv - Twitch
    • Devops Chat
    • DevOps Dozen
    • DevOps TV
  • Media Kit
  • About
  • Sponsor

  • Analytics
  • AppSec
  • CISO
  • Cloud
  • DevOps
  • GRC
  • Identity
  • Incident Response
  • IoT / ICS
  • Threats / Breaches
  • More
    • Blockchain / Digital Currencies
    • Careers
    • Cyberlaw
    • Mobile
    • Social Engineering
  • Humor
Cloud Security DevOps Security Bloggers Network 

Home » Cybersecurity » Cloud Security » IAM Root: AWS IAM Simulator Tutorial

SBN

IAM Root: AWS IAM Simulator Tutorial

by Ochaun Marshall on August 28, 2019

If you needed yet another reason to be paranoid about your personal information being exposed, the recent Capital One breach should be sufficient nightmare fuel for you. This is even more supporting evidence that your SSN isn’t secret anymore. Sensitive information of over 100 million people was exposed during this attack.  I won’t go over some of the technical details of what happened during the breach. There are a couple of articles that already do that here and here. We even have an in-depth webinar covering it. From what we know so far, the two big problems that led to the breach were a misconfigured firewall and a EC2 instance that had full access too much access to S3. The real question on people’s minds is “How do I prevent this from happening?” 

In a previous post, I’ve argued that rigorously locking down IAM roles and policies is an important way to secure AWS resources. In this post, I’ll be doing a deeper dive into the AWS Policy Simulator. We’ll be using the online console for this tutorial. If you’re interested in scripting around this, then you could use it in the AWS CLI tool.

Overview

In the console, the IAM Sim has two modes,  one for Existing Policies and the other for New Policy. The image above shows the menu in Existing Policies mode. The only difference between them is that panel 1 is replaced with a button that opens a simple text editor to write the json for a given policy. For this tutorial, I’m going to assume that you’re comfortable with json. If not you can always use the AWS Policy Generator to write it for you. The censored box at the top represents the user (or assumed role) that you are currently using the simulator as. The top menu also has a help menu icon (📘) that just redirects you to the documentation for the simulator. 

Techstrong Gang Youtube
AWS Hub
  1. User, Groups, and Roles Panel (or Policy Sandbox) – In Existing Policies mode you can use the panel to test running commands as any existing user, role, a member of an existing group.  In New Policy mode this is replaced with a simple json editor. 
  2. Service Panel – This is where you select the services that you want to test for. You can test a handful of actions by checking for specific actions on a service, or you can do “Select All” to test all actions on a given service
  3. Global Settings – We won’t be touching this one, but if you’re already an IAM wizard and you have some policies that require MFA, or policy variables that use the username, then you can provide those details here.
  4. Action Settings and Results – This menu allows for you to test actions on resources. The default is “*” for a given resource, but you can click the arrow icon (⏵) for any action and specify an arn of any resource. For example, if you want to test if your policy prevents a user for accessing an object in S3, you would use an arn like arn:aws:s3:::bucket_name/key_name. For more examples of arns of other services are in the documentation.

Note: If you’re a tab junky like myself, you need to know that New Policy mode does NOT save the json for the new policy that you’re editing. If you (are forced to) refresh the page, you will lose the policy that you were working on and have to start over.

Example Simulations

For a quick example, I’m going to run a scenario based on an Insecure EC2 Role. Let’s pretend that we’re a flustered dev who doesn’t understand IAM permissions very well. This person is tasked with accessing S3 from within an EC2 instance to manage the file. Rather then take a few minutes to construct a role to access a specific bucket or a folder within a bucket, the dev finds a sketchy tutorial online and creates an EC2 role with the FullS3Policy attached like so.  

If we go into the simulator we can select this role under the dropdown menu of the User, Groups, and Roles Panel in Existing policies mode and run simulations based on it. Lets see what EC2 instances with this role can do in S3.

Well, not only does this EC2 instance have the ability to modify files stored in S3, it can also modify the policies on the buckets to control access, upload whatever file(s) to any bucket and download, list & delete ANY  file and bucket in S3. There is absolutely no reason to give anything this much access in S3. If an attacker gains access to this EC2 instance, they can cause all sorts of havoc on your cloud storage.

We can also run a simulation on a policy that is much more sane, like the one below. This policy only allows limited read write permissions on a specific bucket called my_bucket. This would be the minimum policy you would need to be able to download and upload files on one s3 bucket.

{  "Version": "2012-10-17",  "Statement": [    {      "Effect": "Allow",      "Action": [        "s3:GetObject",        "s3:PutObject",        "s3:ListBucket"      ],      "Resource": [        "arn:aws:s3:::my_bucket",        "arn:aws:s3:::my_bucket/*"      ]    }  ]}

We can also check specific buckets and files. Under the action menu click the arrow (⏵) of any action with the resource type bucket and include the arn for that bucket. A valid arn from the example above is arn:aws:s3:::my_bucket. For actions with the resource type object, use an arn like this arn:aws:s3:::my_bucket/* which means any object on the bucket. 

There we have it. We’ve now tested a specific IAM role that fits the use case for the EC2 instance. EC2 instances with this role will only be able to download and upload files to a specific s3 bucket and will not be able to do those actions on other buckets, or even list them. 

Note: You may notice the informational icon (ℹ) next to the status of the simulation. This is because the simulator runs simulations purely based on the IAM policy by default. In order to run simulations while taking the resource policy into account. You need to attach the “s3:GetBucketPolicy” action to the policy that allows the simulator to access a bucket’s policy. 

  The simulator doesn’t only work with EC2 and S3. You can use it to configure IAM policies for any AWS service, including IAM itself. For example, if you don’t want certain users to have access to the simulator, you can always use a simple deny policy and attach it to the proper Roles, Groups or Users you want to block access for. Deny statements take precedence over any allow, so if a user or service is given full IAM access they still will be denied on the action(s) specified.

{  "Version": "2012-10-17",  "Statement": [    {      "Sid": "DenySimulatorAccess",      "Action": [        "iam:SimulateCustomPolicy",        "iam:SimulatePrincipalPolicy"      ],      "Effect": "Deny",      "Resource": "*"    }  ]}

Closing Thoughts

With the AWS Policy Simulator it is so much easier to fine tune access control for aws. You can quickly sketch out IAM policies or test existing ones without spending hours fighting with Access Denied errors. It also gives anyone who has access to it the opportunity to quickly understand the security implications of certain policies and create precise. 

We write a lot about posts on AWS feel free to check those out if you’re interested. We also do cloud security assessments. If you are interested or have general questions about cloud security, please contact us and include “Cloud Security” in the subject or body of the form.


Recent Articles By Author
  • Run as Admin: Executive Order on Cybersecurity
  • AppSec Cheat Code: Shift Left, Shift Right, Up, Down & Start
  • 3 Reasons to Pentest with Brave
More from Ochaun Marshall

*** This is a Security Bloggers Network syndicated blog from Professionally Evil Insights authored by Ochaun Marshall. Read the original post at: https://blog.secureideas.com/2019/08/iam-root-aws-iam-simulator-tutorial.html

August 28, 2019October 16, 2019 Ochaun Marshall Assessing Cloud Security, aws, AWS Account Assessment, AWS Environment, AWS Remediation, Best Practices, Breach, Capital One breach, Cloud Security Assessment, Compromise, Data Loss Prevention, IAM policy, IAM policy simulator tutorial, IAM Policy Tutorial, IAM Roles, Infrastructure, Prevent data leak, S3, Security misconfiguration
  • ← A Cyber Incident Response Plan for Your Web Applications
  • Sonatype Users Reveal the Benefits of Automated DevSecOps →

Techstrong TV

Click full-screen to enable volume control
Watch latest episodes and shows

Upcoming Webinars

Software Supply Chain Security: Navigating NIST, CRA, and FDA Regulations
Is DevEx the Same as DevSecOps?

Podcast

Listen to all of our podcasts

Press Releases

GoPlus's Latest Report Highlights How Blockchain Communities Are Leveraging Critical API Security Data To Mitigate Web3 Threats

GoPlus’s Latest Report Highlights How Blockchain Communities Are Leveraging Critical API Security Data To Mitigate Web3 Threats

C2A Security’s EVSec Risk Management and Automation Platform Gains Traction in Automotive Industry as Companies Seek to Efficiently Meet Regulatory Requirements

C2A Security’s EVSec Risk Management and Automation Platform Gains Traction in Automotive Industry as Companies Seek to Efficiently Meet Regulatory Requirements

Zama Raises $73M in Series A Lead by Multicoin Capital and Protocol Labs to Commercialize Fully Homomorphic Encryption

Zama Raises $73M in Series A Lead by Multicoin Capital and Protocol Labs to Commercialize Fully Homomorphic Encryption

RSM US Deploys Stellar Cyber Open XDR Platform to Secure Clients

RSM US Deploys Stellar Cyber Open XDR Platform to Secure Clients

ThreatHunter.ai Halts Hundreds of Attacks in the past 48 hours: Combating Ransomware and Nation-State Cyber Threats Head-On

ThreatHunter.ai Halts Hundreds of Attacks in the past 48 hours: Combating Ransomware and Nation-State Cyber Threats Head-On

Subscribe to our Newsletters

ThreatLocker

Most Read on the Boulevard

OpenText Report Shines Spotlight on Malware Infection Rates
Encrypt AI, Protect Your IP: DataKrypto Tackles the LLM Security Crisis While Redefining What Encryption Should Be
Security Gamechangers: CrowdStrike’s AI-Native SOC & Next Gen SIEM Take Center Stage at RSAC 2025
Cybersecurity’s Early Warning System: How Live Network Traffic Analysis Detects The ‘Shock Wave’ Before the Breach ‘Tsunami’ 
GenAI’s New Attack Surface: Why MCP Agents Demand a Rethink in Cybersecurity Strategy
Microsoft Listens to Security Concerns and Delays New OneDrive Sync
MY TAKE: Beyond agentic AI mediocrity — the real disruption is empowering the disenfranchised
RSA Conference 2025: How Agentic AI Is Redefining Trust, Identity, and Access at Scale
MCP: A Comprehensive Guide to Extending AI Capabilities
The Legacy Cyber Threat: Why We Must Prioritize Modernization

Industry Spotlight

SMBs Know They’re At Risk, but Most Aren’t Embracing AI
Cloud Security Cybersecurity Data Privacy Data Security Endpoint Featured Industry Spotlight Malware Mobile Security Network Security News Security Awareness Security Boulevard (Original) Social - Facebook Social - LinkedIn Social - X Spotlight Threat Intelligence 

SMBs Know They’re At Risk, but Most Aren’t Embracing AI

May 8, 2025 Jeffrey Burt | May 08 0
U.S. Wins One, Maybe Two, Extradition Petitions in Unrelated Cases
Cloud Security Cyberlaw Cybersecurity Data Security Featured Identity & Access Industry Spotlight Malware Network Security News Security Awareness Security Boulevard (Original) Social - Facebook Social - LinkedIn Social - X Spotlight 

U.S. Wins One, Maybe Two, Extradition Petitions in Unrelated Cases

May 5, 2025 Jeffrey Burt | May 05 0
California Man Will Plead Guilty to Last Year’s Disney Hack
Cloud Security Cybersecurity Data Privacy Data Security Featured Identity & Access Industry Spotlight Malware Mobile Security Network Security News Security Boulevard (Original) Social - Facebook Social - LinkedIn Social - X Spotlight Threat Intelligence Threats & Breaches 

California Man Will Plead Guilty to Last Year’s Disney Hack

May 5, 2025 Jeffrey Burt | May 05 0

Top Stories

Apple Device Users Can File Claims in $95 Million Siri Spying Settlement
Cloud Security Cyberlaw Cybersecurity Data Privacy Data Security Featured Governance, Risk & Compliance Mobile Security News Security Boulevard (Original) Social - Facebook Social - LinkedIn Social - X Spotlight 

Apple Device Users Can File Claims in $95 Million Siri Spying Settlement

May 13, 2025 Jeffrey Burt | 7 hours ago 0
CISO Survey Surfaces Shift in Application Security Responsibilities
Cybersecurity Featured News Security Awareness Security Boulevard (Original) Social - Facebook Social - LinkedIn Social - X Spotlight 

CISO Survey Surfaces Shift in Application Security Responsibilities

May 13, 2025 Michael Vizard | 10 hours ago 0
Futurum Group Research Sees Cybersecurity Spending Reaching $287.6B by 2029
Analytics & Intelligence Cybersecurity Featured News Security Boulevard (Original) Social - Facebook Social - LinkedIn Social - X Spotlight 

Futurum Group Research Sees Cybersecurity Spending Reaching $287.6B by 2029

May 13, 2025 Michael Vizard | 16 hours ago 0

Security Humor

Randall Munroe’s XKCD ‘Pascal's Law’

Randall Munroe’s XKCD ‘Pascal’s Law’

Download Free eBook

7 Must-Read eBooks for Security Professionals

Security Boulevard Logo White

DMCA

Join the Community

  • Add your blog to Security Creators Network
  • Write for Security Boulevard
  • Bloggers Meetup and Awards
  • Ask a Question
  • Email: [email protected]

Useful Links

  • About
  • Media Kit
  • Sponsor Info
  • Copyright
  • TOS
  • DMCA Compliance Statement
  • Privacy Policy

Related Sites

  • Techstrong Group
  • Cloud Native Now
  • DevOps.com
  • Digital CxO
  • Techstrong Research
  • Techstrong TV
  • Techstrong.tv Podcast
  • DevOps Chat
  • DevOps Dozen
  • DevOps TV
Powered by Techstrong Group
Copyright © 2025 Techstrong Group Inc. All rights reserved.
×

Security in AI

Step 1 of 7

14%
How would you best describe your organization's current stage of securing the use of generative AI in your applications?(Required)
Have you implemented, or are you planning to implement, zero trust security for the AI your organization uses or develops?(Required)
What are the three biggest challenges your organization faces when integrating generative AI into applications or workflows? (Select up to three)(Required)
How does your organization secure proprietary information used in AI training, tuning, or retrieval-augmented generation (RAG)? (Select all that apply)(Required)
Which of the following kinds of tools are you currently using to secure your organization’s use of generative AI? (select all that apply)(Required)
How valuable do you think it would it be to have a solution that classifies and quantifies risks associated with generative AI tools?(Required)
What are, or do you think would be, the most important reasons for implementing generative AI security measures? (Select up to three)(Required)

×