Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    AWS IAM Least Privilege Mapper

    1

    Audit and refactor AWS IAM policies, Terraform, and CloudFormation to eliminate wildcards and enforce least privilege.

    $15

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    AWS IAM Least Privilege Mapper

    AWS IAM Least Privilege Mapper

    Example session with this skill installed

    Analyze this Terraform block and refactor it for least privilege: resource "aws_iam_policy" "example" { policy = jsonencode({ Statement = [{ Action = "s3:", Resource = "" }] }) }

    • Read your context and instructions
    • Compiled the aws iam least

    I have analyzed the provided Terraform IAM policy. The original policy contained a critical security risk: global wildcard permissions (Action: "s3:*" and Resource: "*"). I have refactored this into a scoped policy restricted to specific operations and a placeholder ARN.

    Refactored Scoped IAM Policy

    
    # Refactored Terraform IAM Policy
    # Domain: Cybersecurity & DevSecOps
    # Pattern: Zero-Trust Least Privilege
    
    resource "aws_iam_policy" "scoped_s3_access" {
      name        = "MicroserviceS3Access"
      path        = "/"
      description = "Least-privilege policy for specific S3 bucket operations"
    
      policy = jsonencode({
        Version = "2012-10-17"
        Statement = [
          {
            Sid    = "AllowBucketListing"
            Effect = "Allow"
            Action = [
              "s3:ListBucket"
            ]
            # Replace with your specific bucket ARN
            Resource = ["arn:aws:s3:::${var.bucket_name}"]
          },
          {
            Sid    = "AllowObjectOperations"
            Effect = "Allow"
            Action = [
              "s3:GetObject",
              "s3:PutObject",
              "s3:DeleteObject"
            ]
            # Replace with your specific bucket and path ARN
            Resource = ["arn:aws:s3:::${var.bucket_name}/*"]
          }
        ]
      })
    }
    

    Next steps

    1. Replace ${var.bucket_name} with your specific target S3 bucket ARN in the Terraform configuration.
    2. Apply the policy in a staging environment to verify that the microservice does not require additional actions like s3:GetBucketLocation.
    3. Review the references/technical-guide.md file for further architectural patterns on resource-based scoping.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Over-privileged IAM roles are a massive security liability waiting to be exploited. This skill audits your AWS IAM policies, Terraform HCL, and CloudFormation templates to strip away dangerous wildcards and enforce zero-trust security.

    What it does

    • Policy Parsing: Analyzes IAM JSON, Terraform aws_iam_policy blocks, and CloudFormation templates for security flaws.
    • Wildcard Detection: Pinpoints dangerous permissions like s3:*, dynamodb:*, and unauthorized iam:PassRole usage.
    • Action Mapping: Maps broad permissions to the specific API actions required for your microservices.
    • Least Privilege Synthesis: Generates scoped policies restricted by Resource ARNs and specific service actions.

    How it works

    1. Input Analysis: Provide an IAM policy JSON or a Terraform file containing IAM resources.
    2. Risk Identification: The agent flags broad actions and missing resource constraints.
    3. Requirement Mapping: Define the target service or operation to determine necessary API calls.
    4. Policy Generation: The agent outputs a refactored, hardened policy ready for deployment.

    Frameworks & tools

    Works with AWS IAM JSON, Terraform HCL, and AWS CloudFormation. It is optimized for static analysis within modern DevSecOps pipelines.

    Why this beats prompting it yourself

    Generic LLMs often hallucinate AWS action names or fail to include necessary Resource ARNs. This skill follows a deterministic workflow to ensure every generated policy is cryptographically scoped and adheres to AWS security best practices without requiring live AWS credentials.

    Use cases

    • Refactoring legacy "Admin" roles into service-specific scoped policies.
    • Auditing Terraform repositories for insecure IAM resource definitions.
    • Hardening CI/CD pipelines by restricting deployment role permissions.
    • Converting broad developer permissions into production-ready least privilege roles.

    Known limitations

    This tool performs static analysis only and does not make live AWS API calls to verify actual usage logs or CloudTrail data.

    Static analysis only. Does not integrate with live AWS CloudTrail logs. Limited to project workspace file access.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 4 days ago

    Requires

    File System Read/Write (strictly scoped to current project workspace `./`). Zero global installation or elevated privileges required.

    Permissions

    Read Files
    Network Access

    Target Use Cases: - Convert this wildcard AWS IAM policy to least privilege. - Audit Terraform IAM roles for security violations. - Eliminate s3: and passrole wildcards from cloudformation.

    Listed4 days ago

    What's inside

    Frequently Asked Questions

    The skill identifies dangerous wildcard permissions (like s3:*) and overly broad resource access within IAM JSON, Terraform, and CloudFormation, then refactors them into scoped policies that follow zero-trust principles.

    No, this skill uses static analysis to refactor your code and templates. It does not require live AWS credentials or access to your environment, making it safe for use in sensitive pre-production workflows.

    Yes, this tool is designed to parse both native IAM JSON policies and Infrastructure as Code (IaC) files, specifically targeting Terraform aws_iam_policy blocks and CloudFormation IAM resources.

    While generic AI models often hallucinate AWS action names, this skill uses a specialized workflow to ensure action names are accurate and restricted to specific Resource ARNs, reducing the risk of broken policies.

    The skill performs static code analysis based on best practices; it does not analyze live CloudTrail logs to see which permissions are currently being used in your active environment.

    Upon purchase, you receive the full AI agent skill definition, including the logic for policy parsing, risk detection, and refactoring, ready to be integrated into your AI agent or DevSecOps pipeline.

    New in Security