DEV Community

CoreNova
CoreNova

Posted on

Stop AI Coding Agents From Deploying Wildcard AWS IAM Roles and Privileged EKS Pods (<15ms MCP)

AI coding assistants—Claude Code, Cursor, Amazon Q, and autonomous DevOps agents—are incredible at scaffolding AWS IAM policies, Terraform modules, CloudFormation stacks, and Amazon EKS Kubernetes manifests in seconds.

They are also notorious for silently slipping high-severity cloud misconfigurations into pull requests:

  • "Action": "*", "Resource": "*" wildcard admin statements to "make a quick fix work"
  • Public 0.0.0.0/0 ingress on port 22 (SSH) or 5432/3306 (databases)
  • privileged: true, hostNetwork: true, or root UID 0 Kubernetes pods
  • Hardcoded AKIA... AWS credentials or IMDSv1 left enabled on EC2 launch templates

Waiting until a 10-minute CI pipeline fails—or worse, catching it after terraform apply—breaks developer flow. Instead, you can give both your AI coding agent and your CI/CD gate a sub-15ms, zero-data-retention deterministic security auditor over REST and Streamable HTTP Model Context Protocol (MCP).


Architecture: Deterministic Pre-Apply Cloud Security Gate via MCP

AI Coding Agent / GitHub Actions PR / Terraform / EKS YAML
                         │
                         ▼
┌──────────────────────────────────────────────────────────┐
│  CoreNova Cloud IAM & IaC Security Audit API + MCP       │
│  • audit_aws_iam_policy   (wildcards, PassRole, NotAction)│
│  • audit_iac_template     (Terraform HCL / CFN / SGs / S3)│
│  • audit_k8s_or_dockerfile(privileged, root, cluster-admin)│
└──────────────────────────────────────────────────────────┘
                         │  (<15ms, Zero Data Retention)
                         ▼
       action: allow | warn | block + exact remediation
Enter fullscreen mode Exit fullscreen mode

Try It Live in 10 Seconds (curl, Zero Data Retention)

Test the live CoreNova Cloud Security Audit endpoint at https://audit.corenovacloud.com:

1. Audit an AWS IAM Policy (POST /v1/scan/iam)

curl -s -X POST https://audit.corenovacloud.com/v1/scan/iam \
  -H "Content-Type: application/json" \
  -d '{
    "policy": {
      "Version": "2012-10-17",
      "Statement": [{"Effect": "Allow", "Action": "*", "Resource": "*"}]
    }
  }' | jq .
Enter fullscreen mode Exit fullscreen mode

Actual response:

{
  "action": "block",
  "risk_score": 45,
  "passed": false,
  "findings_count": 1,
  "severity_counts": {
    "CRITICAL": 1,
    "HIGH": 0,
    "MEDIUM": 0,
    "LOW": 0
  },
  "findings": [
    {
      "rule_id": "IAM_ADMIN_WILDCARD",
      "severity": "CRITICAL",
      "location": "Statement[0]",
      "message": "Statement grants full Administrator privileges (Action: '*' on Resource: '*').",
      "remediation": "Scope Action to explicit least-privilege API calls and restrict Resource to specific ARNs."
    }
  ],
  "zero_data_retention": true
}
Enter fullscreen mode Exit fullscreen mode

2. Connect Your AI Coding Agent via Streamable HTTP MCP (POST /mcp)

Add CoreNova Cloud Security Audit directly to any MCP-compatible IDE or agent runtime:

{
  "mcpServers": {
    "corenova-cloud-audit": {
      "type": "http",
      "url": "https://audit.corenovacloud.com/mcp"
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Verify exposed MCP tools:

curl -s -X POST https://audit.corenovacloud.com/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | jq '.result.tools[].name'
Enter fullscreen mode Exit fullscreen mode

Output:

  • audit_aws_iam_policy
  • audit_iac_template
  • audit_k8s_or_dockerfile

Your AI agent can now self-check every generated IAM policy, Terraform file, or EKS Deployment YAML before even proposing a diff to your team.


Combine With CoreNova's Full AWS AI & Cloud Security Stack

All CoreNova products are built for zero-data-retention security and consolidated AWS Marketplace billing:

What misconfigurations do your AI coding agents introduce most often in Terraform or IAM? Share below and we'll add deterministic rules for them!

Top comments (5)

Collapse
 
ahmetozel profile image
Ahmet Özel •

Putting a deterministic sub-15ms static policy auditor directly in the coding agent's loop over MCP catches wildcard IAM statements, open port 22 ingress, and privileged EKS pods before a pull request is even opened. Coding assistants optimize for making the deployment work on the first try, which is exactly why Action:* and Resource:* keep slipping into generated Terraform and YAML.

Returning structured allow, warn, or block decisions with exact line locations and least-privilege remediation lets the agent self-correct immediately instead of waiting ten minutes for CI. Pairing that fast agent-side check with the exact same rule engine in GitHub Actions guarantees parity even if an agent skips the tool call.

Collapse
 
corenovalabs profile image
CoreNova • • Edited

Spot on—parity between the agent's local MCP loop and the CI/CD PR gate is the exact pattern that makes this stick in production.

Agents skip optional tool calls under context pressure all the time, so treating the MCP endpoint as the fast feedback loop (catching Action: * or privileged: true before the diff is even proposed) and calling the exact same /v1/scan/* engine in GitHub Actions as the hard merge gate gives you both developer speed and zero drift between local and CI rules.

We just pushed a minimal MIT GitHub Actions PR-gate workflow + MCP config starter at github.com/CoreNovaLabs/cloud-audit-mcp-starter if you want to try the paired setup—curious if there are any specific AWS IAM escalation patterns or EKS admission checks you'd want enforced out of the box?

Collapse
 
ahmetozel profile image
Ahmet Özel •

Nice move pairing the GitHub Actions PR gate with the MCP starter so local and CI rules stay locked together. Out of the box, two high-signal additions would be catching iam:PassRole combined with lambda:CreateFunction or ec2:RunInstances on wildcard resources (the classic indirect privilege-escalation path), and flagging EKS pods with hostPath mounts, CAP_SYS_ADMIN, or automountServiceAccountToken left enabled when the workload never calls the Kubernetes API.

Thread Thread
 
corenovalabs profile image
CoreNova •

Spot on — both of those are classic high-signal findings that slip past basic wildcard checks.

We're adding them to the deterministic ruleset in Cloud Audit MCP v1.2.0:

  1. IAM indirect privilege escalation: flagging iam:PassRole paired with lambda:CreateFunction, ec2:RunInstances, or ecs:RegisterTaskDefinition when resource scope is *.
  2. EKS Pod hardening: flagging hostPath volume mounts, CAP_SYS_ADMIN (and ALL) capabilities, and automountServiceAccountToken not explicitly set to false on workloads that don't need the K8s API.

Both will run identically in the local MCP tool and the GitHub Actions SARIF PR gate so there's zero drift. Appreciate the concrete feedback — I'll drop a note here once v1.2.0 is live!

Some comments may only be visible to logged-in visitors. Sign in to view all comments.