securing-aws-lambda-execution-roles

Audit AWS Lambda execution roles and generate least-privilege IAM policies.

Updated Apr 23, 2026
One-click install
npx skills add https://github.com/YukiIto1999/ctf-sleuth --skill securing-aws-lambda-execution-roles
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: securing-aws-lambda-execution-roles
Source: https://github.com/YukiIto1999/ctf-sleuth/tree/main/.claude/skills/securing-aws-lambda-execution-roles
Command: npx skills add https://github.com/YukiIto1999/ctf-sleuth --skill securing-aws-lambda-execution-roles

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires boto3, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Lambda execution roles often accumulate over-privileged permissions, increasing the risk of credential leakage and unauthorized AWS API access. This Skill audits and refines those roles to enforce least-privilege configurations.

Core Features & Use Cases

  • Audit Lambda execution roles for overly permissive policies and wildcard actions.
  • Generate scoped, least-privilege policies using CloudTrail data, Access Analyzer, and policy generation workflows.
  • Apply permission boundaries and trust policy safeguards, then validate via Access Analyzer and SCPs.
  • Use across environments to strengthen security posture for serverless architectures.

Quick Start

Audit all Lambda execution roles in your account and generate scoped, least-privilege policies using the included workflow.

Frequently Asked Questions about securing-aws-lambda-execution-roles

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit AWS Lambda execution roles for overly permissive IAM policies?

You can audit Lambda execution roles by analyzing attached IAM policies for wildcard actions and over-privilege, then use Access Analyzer findings and CloudTrail usage data to identify unnecessary permissions across your serverless environments.

What's the best way to generate least-privilege IAM policies for Lambda functions?

Generating least-privilege IAM policies for Lambda involves analyzing CloudTrail API usage history and Access Analyzer outputs to produce scoped policies that replace wildcard actions with specific resource-level permissions.

How do I apply permission boundaries and trust policy safeguards to Lambda roles?

Applying permission boundaries to Lambda roles involves setting IAM guardrails that cap maximum permissions, while trust policy safeguards ensure only Lambda services can assume the role, validated through Access Analyzer and SCPs.

Why do my Lambda execution roles accumulate over-privileged permissions over time?

Lambda execution roles accumulate over-privileged permissions when wildcard actions are added during development and never scoped back, increasing the risk of credential leakage and unauthorized AWS API access.

Can I use Access Analyzer to validate scoped IAM policies for Lambda functions?

Yes, Access Analyzer validates generated scoped IAM policies by reviewing them against your account's resource topology, confirming that least-privilege configurations and permission boundaries reduce security risk before deployment.

Do I need boto3 to automate Lambda IAM role auditing and policy generation?

Yes, you need the boto3 Python library to interact with AWS APIs, enabling automated analysis of IAM policies, CloudTrail logs, and Access Analyzer findings to generate and deploy scoped least-privilege policies.