---
title: "Discussion on \"How to Block Over-Privileged IAM Roles in AWS Using Policy-as-Code\" | Hashnode"
description: "Discussion on \"How to Block Over-Privileged IAM Roles in AWS Using Policy-as-Code\". Chances are, your AWS account has an over-privileged IAM role right now, and you may not know which one.\nWhen you build infrastructure, you write Terraform that declares your resources and assigns IAM"
url: "https://hashnode.com/posts/how-to-block-over-privileged-iam-roles-in-aws-using-policy-as-code/6ac8cb601aa52d06d71bb168"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to Block Over-Privileged IAM Roles in AWS Using Policy-as-Code](https://victorokoroafor.hashnode.dev/how-to-block-over-privileged-iam-roles-in-aws-using-policy-as-code?utm_source=hashnode&utm_medium=feed)

Chances are, your AWS account has an over-privileged IAM role right now, and you may not know which one. When you build infrastructure, you write Terraform that declares your resources and assigns IAM

Oct 9 · 5 min read · victorokoroafor.hashnode.dev  
Updated Oct 19  
Read the article

-   [#aws](https://hashnode.com/tag/aws)
-   [#security](https://hashnode.com/tag/security)
-   [#terraform](https://hashnode.com/tag/terraform)
-   [#devops](https://hashnode.com/tag/devops)
-   [#policy-as-code](https://hashnode.com/tag/policy-as-code)
-   [#ci-cd](https://hashnode.com/tag/ci-cd)

## Written by

[Victor Okoroafor](https://hashnode.com/@okoroaforvic)

@okoroaforvic · Remote

  
[View profile](https://hashnode.com/@okoroaforvic)

Code that works isn't the same as code that's safe. I build the difference into the pipeline.

I build tools that catch AWS misconfigurations before they reach production: policy-as-code checks with Terraform, Open Policy Agent, and GitHub Actions, and ZeroLeak, an offline AWS auditor. I'm AWS Certified Solutions Architect – Associate and Cloud Practitioner, with a degree in cybersecurity. I write about the gap between code that works and code that's safe, including where my own tools fall short. Right now I'm building a series on Zero Trust governance for AWS serverless apps. The code is on GitHub. Based in Nigeria and open to Cloud Security and DevSecOps roles. Say hi on LinkedIn.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
