[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AAB9G7X8TW1CVQTXJM81WS":3,"skill-same:01M7AAB9G7X8TW1CVQTXJM81WS":84},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":47,"commitSha":48,"skillDirectory":49,"forksCount":14,"repositoryHtmlUrl":50,"repositoryHomepageUrl":6,"ownerHtmlUrl":51,"ownerBlogUrl":6,"ownerDescription":52,"updatedAt":53,"install":54,"resources":67},"01M7AAB9G7X8TW1CVQTXJM81WS","performing-serverless-function-security-review",null,"Performing security reviews of serverless functions across AWS Lambda, Azure Functions, and GCP Cloud Functions to identify overly permissive execution roles, insecure environment variables, injection vulnerabilities, and missing runtime protections.","NeelakshSaxena\u002FVayu","NeelakshSaxena","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F87892838?v=4","01M7A3B9YFS6F6N9DD1787DT86","Neelaksh Saxena","01M7A3B9ZKBT09MNMPX2XN69BY",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-serverless-function-security-review\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-serverless-function-security-review\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: performing-serverless-function-security-review\ndescription: 'Performing security reviews of serverless functions across AWS Lambda,\n  Azure Functions, and GCP Cloud Functions to identify overly permissive execution\n  roles, insecure environment variables, injection vulnerabilities, and missing runtime\n  protections.\n\n  '\ndomain: cybersecurity\nsubdomain: cloud-security\ntags:\n- cloud-security\n- serverless\n- lambda\n- azure-functions\n- cloud-functions\n- security-review\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- PR.IR-01\n- ID.AM-08\n- GV.SC-06\n- DE.CM-01\nmitre_attack:\n- T1078.004\n- T1530\n- T1537\n- T1580\n- T1055\n---\n\n# Performing Serverless Function Security Review\n\n## When to Use\n\n- When auditing serverless applications before production deployment\n- When investigating potential data exposure through function environment variables or logs\n- When assessing the blast radius of a compromised serverless function execution role\n- When compliance reviews require documentation of serverless security controls\n- When building secure-by-default templates for serverless deployments\n\n**Do not use** for container or VM security assessments (use container scanning tools), for API security testing (use DAST tools on the API Gateway layer), or for real-time serverless threat detection (use AWS Lambda Extensions with security agents).\n\n## Prerequisites\n\n- AWS CLI, Azure CLI, and gcloud CLI configured with appropriate permissions\n- Access to read function configurations, policies, and execution roles\n- Prowler or Checkov for automated serverless security scanning\n- SAM CLI or Serverless Framework for local function analysis\n- CloudTrail, Azure Monitor, or Cloud Audit Logs enabled for function invocation monitoring\n\n## Workflow\n\n### Step 1: Enumerate All Serverless Functions and Configurations\n\nList all functions across cloud providers with their runtime, memory, timeout, and network settings.\n\n```bash\n# AWS Lambda: List all functions with key security attributes\naws lambda list-functions \\\n  --query 'Functions[*].[FunctionName,Runtime,MemorySize,Timeout,Role,VpcConfig.VpcId,Layers[*].Arn]' \\\n  --output table\n\n# Check for functions using deprecated runtimes\naws lambda list-functions \\\n  --query 'Functions[?Runtime==`python3.7` || Runtime==`nodejs14.x` || Runtime==`dotnetcore3.1`].[FunctionName,Runtime]' \\\n  --output table\n\n# Azure Functions: List all function apps\naz functionapp list \\\n  --query \"[].{Name:name, Runtime:siteConfig.linuxFxVersion, ResourceGroup:resourceGroup, HttpsOnly:httpsOnly}\" \\\n  -o table\n\n# GCP Cloud Functions: List all functions\ngcloud functions list \\\n  --format=\"table(name, runtime, status, httpsTrigger.url, serviceAccountEmail, vpcConnector)\"\n```\n\n### Step 2: Audit Execution Role Permissions\n\nReview IAM roles attached to functions for overly permissive policies.\n\n```bash\n# AWS: Check each Lambda function's execution role\nfor func in $(aws lambda list-functions --query 'Functions[*].FunctionName' --output text); do\n  role_arn=$(aws lambda get-function-configuration --function-name \"$func\" --query 'Role' --output text)\n  role_name=$(echo \"$role_arn\" | awk -F'\u002F' '{print $NF}')\n  echo \"=== $func -> $role_name ===\"\n\n  # List attached policies\n  aws iam list-attached-role-policies --role-name \"$role_name\" \\\n    --query 'AttachedPolicies[*].[PolicyName,PolicyArn]' --output table\n\n  # Check for wildcard actions\n  for policy_arn in $(aws iam list-attached-role-policies --role-name \"$role_name\" --query 'AttachedPolicies[*].PolicyArn' --output text); do\n    version=$(aws iam get-policy --policy-arn \"$policy_arn\" --query 'Policy.DefaultVersionId' --output text)\n    aws iam get-policy-version --policy-arn \"$policy_arn\" --version-id \"$version\" \\\n      --query 'PolicyVersion.Document' --output json | python3 -c \"\nimport json, sys\ndoc = json.load(sys.stdin)\nfor stmt in doc.get('Statement', []):\n    actions = stmt.get('Action', [])\n    if isinstance(actions, str): actions = [actions]\n    resources = stmt.get('Resource', [])\n    if isinstance(resources, str): resources = [resources]\n    if '*' in actions or any(a.endswith(':*') for a in actions):\n        print(f'  WARNING: {stmt[\\\"Effect\\\"]} {actions} on {resources}')\n\" 2>\u002Fdev\u002Fnull\n  done\ndone\n```\n\n### Step 3: Check Environment Variables for Secrets\n\nScan function environment variables for hardcoded credentials, API keys, and database connection strings.\n\n```bash\n# AWS Lambda: Extract environment variables\nfor func in $(aws lambda list-functions --query 'Functions[*].FunctionName' --output text); do\n  envvars=$(aws lambda get-function-configuration --function-name \"$func\" \\\n    --query 'Environment.Variables' --output json 2>\u002Fdev\u002Fnull)\n  if [ \"$envvars\" != \"null\" ] && [ -n \"$envvars\" ]; then\n    echo \"=== $func ===\"\n    echo \"$envvars\" | python3 -c \"\nimport json, sys, re\nvars = json.load(sys.stdin)\nsensitive_patterns = [\n    r'(?i)(password|secret|key|token|credential|api.?key)',\n    r'(?i)(aws.?access|aws.?secret)',\n    r'(?i)(database.?url|connection.?string|db.?pass)',\n    r'AKIA[0-9A-Z]{16}'\n]\nfor key, value in vars.items():\n    for pattern in sensitive_patterns:\n        if re.search(pattern, key) or re.search(pattern, str(value)):\n            masked = value[:4] + '****' + value[-4:] if len(value) > 8 else '****'\n            print(f'  SENSITIVE: {key} = {masked}')\n            break\n\"\n  fi\ndone\n\n# Azure Functions: Check app settings\nfor app in $(az functionapp list --query \"[].name\" -o tsv); do\n  rg=$(az functionapp show --name \"$app\" --query \"resourceGroup\" -o tsv)\n  echo \"=== $app ===\"\n  az functionapp config appsettings list \\\n    --name \"$app\" --resource-group \"$rg\" \\\n    --query \"[?contains(name,'KEY') || contains(name,'SECRET') || contains(name,'PASSWORD')].{Name:name}\" \\\n    -o table 2>\u002Fdev\u002Fnull\ndone\n```\n\n### Step 4: Review Function Triggers and Access Controls\n\nVerify that function triggers have appropriate authentication and authorization.\n\n```bash\n# AWS: Check for unauthenticated Lambda function URLs\naws lambda list-function-url-configs \\\n  --function-name FUNCTION_NAME \\\n  --query 'FunctionUrlConfigs[*].[FunctionUrl,AuthType,Cors]' --output table\n\n# Check for resource-based policies allowing public invocation\nfor func in $(aws lambda list-functions --query 'Functions[*].FunctionName' --output text); do\n  policy=$(aws lambda get-policy --function-name \"$func\" --query 'Policy' --output text 2>\u002Fdev\u002Fnull)\n  if [ -n \"$policy\" ]; then\n    echo \"$policy\" | python3 -c \"\nimport json, sys\ndoc = json.loads(sys.stdin.read())\nfor stmt in doc.get('Statement', []):\n    principal = stmt.get('Principal', {})\n    if principal == '*' or principal == {'AWS': '*'}:\n        print(f'WARNING: $func has public invoke policy: {stmt.get(\\\"Sid\\\", \\\"unnamed\\\")}')\" 2>\u002Fdev\u002Fnull\n  fi\ndone\n\n# GCP: Check for unauthenticated Cloud Functions\ngcloud functions list --format=json | python3 -c \"\nimport json, sys\nfunctions = json.load(sys.stdin)\nfor func in functions:\n    name = func.get('name', '').split('\u002F')[-1]\n    trigger = func.get('httpsTrigger', {})\n    if trigger and func.get('ingressSettings') == 'ALLOW_ALL':\n        print(f'WARNING: {name} allows all ingress traffic')\n\"\n```\n\n### Step 5: Analyze Function Code for Security Vulnerabilities\n\nReview function code for common serverless security issues.\n\n```bash\n# Download Lambda function code for review\naws lambda get-function --function-name FUNCTION_NAME \\\n  --query 'Code.Location' --output text | xargs curl -o function.zip\nunzip function.zip -d function-code\u002F\n\n# Scan with Bandit (Python) or ESLint security plugin (Node.js)\n# Python functions\npip install bandit\nbandit -r function-code\u002F -f json -o bandit-results.json\n\n# Node.js functions\nnpm install -g eslint @microsoft\u002Feslint-plugin-sdl\neslint --ext .js function-code\u002F\n\n# Check for common serverless vulnerabilities:\n# 1. SQL injection in database queries\n# 2. Command injection via os.system or subprocess\n# 3. Insecure deserialization\n# 4. Event data injection (untrusted event parameters)\n# 5. Excessive function permissions\ngrep -rn \"os.system\\|subprocess\\|eval(\\|exec(\" function-code\u002F || echo \"No obvious injection patterns\"\ngrep -rn \"pickle.loads\\|yaml.load\\b\" function-code\u002F || echo \"No deserialization risks\"\n```\n\n### Step 6: Run Automated Serverless Security Scanning\n\nExecute Checkov and Prowler for automated compliance checks on serverless resources.\n\n```bash\n# Checkov scan for serverless frameworks\ncheckov -d .\u002Fserverless-project\u002F \\\n  --framework serverless \\\n  --output json > checkov-serverless.json\n\n# Prowler Lambda-specific checks\nprowler aws \\\n  --checks lambda_function_no_secrets_in_variables \\\n           lambda_function_url_auth_type \\\n           lambda_function_using_supported_runtimes \\\n           lambda_function_not_publicly_accessible \\\n  -M json-ocsf \\\n  -o .\u002Fprowler-lambda\u002F\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| Execution Role | IAM role assumed by a serverless function during execution that defines what AWS\u002Fcloud resources the function can access |\n| Event Injection | Serverless-specific attack where untrusted data in the event trigger payload is used unsafely in function logic |\n| Function URL | Direct HTTP(S) endpoint for invoking Lambda functions without API Gateway, which may be configured without authentication |\n| Cold Start | Initial function execution that includes container provisioning, during which security agents and extensions must initialize |\n| Resource-Based Policy | Policy attached to the function itself that defines who can invoke it, separate from the execution role |\n| Secrets Manager Integration | Pattern of retrieving sensitive configuration from a secrets management service rather than storing in environment variables |\n\n## Tools & Systems\n\n- **AWS Lambda**: Primary serverless compute platform with execution roles, layers, and resource policies\n- **Checkov**: Static analysis tool for infrastructure-as-code with serverless-specific security policies\n- **Prowler**: Cloud security tool with Lambda-specific checks for permissions, public access, and runtime versions\n- **Bandit**: Python static analysis tool for detecting security issues in function source code\n- **OWASP Serverless Top 10**: Security risk framework specific to serverless architectures\n\n## Common Scenarios\n\n### Scenario: Lambda Function with Admin Role Leaking Secrets via Environment Variables\n\n**Context**: A security review discovers a Lambda function with `AdministratorAccess` execution role and database credentials stored in plaintext environment variables visible in CloudWatch logs.\n\n**Approach**:\n1. Enumerate the function's execution role and discover `AdministratorAccess` managed policy\n2. Check environment variables and find `DB_PASSWORD`, `API_KEY`, and `STRIPE_SECRET_KEY` in plaintext\n3. Review CloudWatch logs and find credentials printed in debug log statements\n4. Create a scoped IAM policy granting only the specific DynamoDB and S3 actions needed\n5. Migrate secrets to AWS Secrets Manager and update function to retrieve at runtime\n6. Remove debug logging that outputs sensitive data\n7. Rotate all exposed credentials and enable Lambda function encryption with KMS\n\n**Pitfalls**: Changing a function's execution role can break it if the new role is too restrictive. Test in a staging environment first. Environment variable changes trigger a new function version, so ensure aliases and triggers are updated. Secrets Manager calls add latency; cache secrets within the execution context to avoid per-invocation lookups.\n\n## Output Format\n\n```\nServerless Function Security Review\n=======================================\nAccount: 123456789012\nFunctions Reviewed: 34\nReview Date: 2026-02-23\n\nCRITICAL FINDINGS:\n[SRVL-001] Overly Permissive Execution Role\n  Function: payment-processor\n  Role: AdministratorAccess (full AWS access)\n  Required Permissions: DynamoDB:PutItem, S3:GetObject (2 actions)\n  Remediation: Create scoped policy with only required permissions\n\n[SRVL-002] Secrets in Environment Variables\n  Function: payment-processor\n  Variables: DB_PASSWORD, STRIPE_SECRET_KEY, API_KEY\n  Risk: Visible in console, API, and CloudWatch logs\n  Remediation: Migrate to Secrets Manager, remove from env vars\n\nSUMMARY:\n  Functions with admin roles:           3 \u002F 34\n  Functions with secrets in env vars:   8 \u002F 34\n  Functions with deprecated runtimes:   5 \u002F 34\n  Functions with public access:         2 \u002F 34\n  Functions without VPC:               28 \u002F 34\n  Functions with wildcard permissions: 12 \u002F 34\n```\n","# Performing Serverless Function Security Review\n\n## When to Use\n\n- When auditing serverless applications before production deployment\n- When investigating potential data exposure through function environment variables or logs\n- When assessing the blast radius of a compromised serverless function execution role\n- When compliance reviews require documentation of serverless security controls\n- When building secure-by-default templates for serverless deployments\n\n**Do not use** for container or VM security assessments (use container scanning tools), for API security testing (use DAST tools on the API Gateway layer), or for real-time serverless threat detection (use AWS Lambda Extensions with security agents).\n\n## Prerequisites\n\n- AWS CLI, Azure CLI, and gcloud CLI configured with appropriate permissions\n- Access to read function configurations, policies, and execution roles\n- Prowler or Checkov for automated serverless security scanning\n- SAM CLI or Serverless Framework for local function analysis\n- CloudTrail, Azure Monitor, or Cloud Audit Logs enabled for function invocation monitoring\n\n## Workflow\n\n### Step 1: Enumerate All Serverless Functions and Configurations\n\nList all functions across cloud providers with their runtime, memory, timeout, and network settings.\n\n```bash\n# AWS Lambda: List all functions with key security attributes\naws lambda list-functions \\\n  --query 'Functions[*].[FunctionName,Runtime,MemorySize,Timeout,Role,VpcConfig.VpcId,Layers[*].Arn]' \\\n  --output table\n\n# Check for functions using deprecated runtimes\naws lambda list-functions \\\n  --query 'Functions[?Runtime==`python3.7` || Runtime==`nodejs14.x` || Runtime==`dotnetcore3.1`].[FunctionName,Runtime]' \\\n  --output table\n\n# Azure Functions: List all function apps\naz functionapp list \\\n  --query \"[].{Name:name, Runtime:siteConfig.linuxFxVersion, ResourceGroup:resourceGroup, HttpsOnly:httpsOnly}\" \\\n  -o table\n\n# GCP Cloud Functions: List all functions\ngcloud functions list \\\n  --format=\"table(name, runtime, status, httpsTrigger.url, serviceAccountEmail, vpcConnector)\"\n```\n\n### Step 2: Audit Execution Role Permissions\n\nReview IAM roles attached to functions for overly permissive policies.\n\n```bash\n# AWS: Check each Lambda function's execution role\nfor func in $(aws lambda list-functions --query 'Functions[*].FunctionName' --output text); do\n  role_arn=$(aws lambda get-function-configuration --function-name \"$func\" --query 'Role' --output text)\n  role_name=$(echo \"$role_arn\" | awk -F'\u002F' '{print $NF}')\n  echo \"=== $func -> $role_name ===\"\n\n  # List attached policies\n  aws iam list-attached-role-policies --role-name \"$role_name\" \\\n    --query 'AttachedPolicies[*].[PolicyName,PolicyArn]' --output table\n\n  # Check for wildcard actions\n  for policy_arn in $(aws iam list-attached-role-policies --role-name \"$role_name\" --query 'AttachedPolicies[*].PolicyArn' --output text); do\n    version=$(aws iam get-policy --policy-arn \"$policy_arn\" --query 'Policy.DefaultVersionId' --output text)\n    aws iam get-policy-version --policy-arn \"$policy_arn\" --version-id \"$version\" \\\n      --query 'PolicyVersion.Document' --output json | python3 -c \"\nimport json, sys\ndoc = json.load(sys.stdin)\nfor stmt in doc.get('Statement', []):\n    actions = stmt.get('Action', [])\n    if isinstance(actions, str): actions = [actions]\n    resources = stmt.get('Resource', [])\n    if isinstance(resources, str): resources = [resources]\n    if '*' in actions or any(a.endswith(':*') for a in actions):\n        print(f'  WARNING: {stmt[\\\"Effect\\\"]} {actions} on {resources}')\n\" 2>\u002Fdev\u002Fnull\n  done\ndone\n```\n\n### Step 3: Check Environment Variables for Secrets\n\nScan function environment variables for hardcoded credentials, API keys, and database connection strings.\n\n```bash\n# AWS Lambda: Extract environment variables\nfor func in $(aws lambda list-functions --query 'Functions[*].FunctionName' --output text); do\n  envvars=$(aws lambda get-function-configuration --function-name \"$func\" \\\n    --query 'Environment.Variables' --output json 2>\u002Fdev\u002Fnull)\n  if [ \"$envvars\" != \"null\" ] && [ -n \"$envvars\" ]; then\n    echo \"=== $func ===\"\n    echo \"$envvars\" | python3 -c \"\nimport json, sys, re\nvars = json.load(sys.stdin)\nsensitive_patterns = [\n    r'(?i)(password|secret|key|token|credential|api.?key)',\n    r'(?i)(aws.?access|aws.?secret)',\n    r'(?i)(database.?url|connection.?string|db.?pass)',\n    r'AKIA[0-9A-Z]{16}'\n]\nfor key, value in vars.items():\n    for pattern in sensitive_patterns:\n        if re.search(pattern, key) or re.search(pattern, str(value)):\n            masked = value[:4] + '****' + value[-4:] if len(value) > 8 else '****'\n            print(f'  SENSITIVE: {key} = {masked}')\n            break\n\"\n  fi\ndone\n\n# Azure Functions: Check app settings\nfor app in $(az functionapp list --query \"[].name\" -o tsv); do\n  rg=$(az functionapp show --name \"$app\" --query \"resourceGroup\" -o tsv)\n  echo \"=== $app ===\"\n  az functionapp config appsettings list \\\n    --name \"$app\" --resource-group \"$rg\" \\\n    --query \"[?contains(name,'KEY') || contains(name,'SECRET') || contains(name,'PASSWORD')].{Name:name}\" \\\n    -o table 2>\u002Fdev\u002Fnull\ndone\n```\n\n### Step 4: Review Function Triggers and Access Controls\n\nVerify that function triggers have appropriate authentication and authorization.\n\n```bash\n# AWS: Check for unauthenticated Lambda function URLs\naws lambda list-function-url-configs \\\n  --function-name FUNCTION_NAME \\\n  --query 'FunctionUrlConfigs[*].[FunctionUrl,AuthType,Cors]' --output table\n\n# Check for resource-based policies allowing public invocation\nfor func in $(aws lambda list-functions --query 'Functions[*].FunctionName' --output text); do\n  policy=$(aws lambda get-policy --function-name \"$func\" --query 'Policy' --output text 2>\u002Fdev\u002Fnull)\n  if [ -n \"$policy\" ]; then\n    echo \"$policy\" | python3 -c \"\nimport json, sys\ndoc = json.loads(sys.stdin.read())\nfor stmt in doc.get('Statement', []):\n    principal = stmt.get('Principal', {})\n    if principal == '*' or principal == {'AWS': '*'}:\n        print(f'WARNING: $func has public invoke policy: {stmt.get(\\\"Sid\\\", \\\"unnamed\\\")}')\" 2>\u002Fdev\u002Fnull\n  fi\ndone\n\n# GCP: Check for unauthenticated Cloud Functions\ngcloud functions list --format=json | python3 -c \"\nimport json, sys\nfunctions = json.load(sys.stdin)\nfor func in functions:\n    name = func.get('name', '').split('\u002F')[-1]\n    trigger = func.get('httpsTrigger', {})\n    if trigger and func.get('ingressSettings') == 'ALLOW_ALL':\n        print(f'WARNING: {name} allows all ingress traffic')\n\"\n```\n\n### Step 5: Analyze Function Code for Security Vulnerabilities\n\nReview function code for common serverless security issues.\n\n```bash\n# Download Lambda function code for review\naws lambda get-function --function-name FUNCTION_NAME \\\n  --query 'Code.Location' --output text | xargs curl -o function.zip\nunzip function.zip -d function-code\u002F\n\n# Scan with Bandit (Python) or ESLint security plugin (Node.js)\n# Python functions\npip install bandit\nbandit -r function-code\u002F -f json -o bandit-results.json\n\n# Node.js functions\nnpm install -g eslint @microsoft\u002Feslint-plugin-sdl\neslint --ext .js function-code\u002F\n\n# Check for common serverless vulnerabilities:\n# 1. SQL injection in database queries\n# 2. Command injection via os.system or subprocess\n# 3. Insecure deserialization\n# 4. Event data injection (untrusted event parameters)\n# 5. Excessive function permissions\ngrep -rn \"os.system\\|subprocess\\|eval(\\|exec(\" function-code\u002F || echo \"No obvious injection patterns\"\ngrep -rn \"pickle.loads\\|yaml.load\\b\" function-code\u002F || echo \"No deserialization risks\"\n```\n\n### Step 6: Run Automated Serverless Security Scanning\n\nExecute Checkov and Prowler for automated compliance checks on serverless resources.\n\n```bash\n# Checkov scan for serverless frameworks\ncheckov -d .\u002Fserverless-project\u002F \\\n  --framework serverless \\\n  --output json > checkov-serverless.json\n\n# Prowler Lambda-specific checks\nprowler aws \\\n  --checks lambda_function_no_secrets_in_variables \\\n           lambda_function_url_auth_type \\\n           lambda_function_using_supported_runtimes \\\n           lambda_function_not_publicly_accessible \\\n  -M json-ocsf \\\n  -o .\u002Fprowler-lambda\u002F\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| Execution Role | IAM role assumed by a serverless function during execution that defines what AWS\u002Fcloud resources the function can access |\n| Event Injection | Serverless-specific attack where untrusted data in the event trigger payload is used unsafely in function logic |\n| Function URL | Direct HTTP(S) endpoint for invoking Lambda functions without API Gateway, which may be configured without authentication |\n| Cold Start | Initial function execution that includes container provisioning, during which security agents and extensions must initialize |\n| Resource-Based Policy | Policy attached to the function itself that defines who can invoke it, separate from the execution role |\n| Secrets Manager Integration | Pattern of retrieving sensitive configuration from a secrets management service rather than storing in environment variables |\n\n## Tools & Systems\n\n- **AWS Lambda**: Primary serverless compute platform with execution roles, layers, and resource policies\n- **Checkov**: Static analysis tool for infrastructure-as-code with serverless-specific security policies\n- **Prowler**: Cloud security tool with Lambda-specific checks for permissions, public access, and runtime versions\n- **Bandit**: Python static analysis tool for detecting security issues in function source code\n- **OWASP Serverless Top 10**: Security risk framework specific to serverless architectures\n\n## Common Scenarios\n\n### Scenario: Lambda Function with Admin Role Leaking Secrets via Environment Variables\n\n**Context**: A security review discovers a Lambda function with `AdministratorAccess` execution role and database credentials stored in plaintext environment variables visible in CloudWatch logs.\n\n**Approach**:\n1. Enumerate the function's execution role and discover `AdministratorAccess` managed policy\n2. Check environment variables and find `DB_PASSWORD`, `API_KEY`, and `STRIPE_SECRET_KEY` in plaintext\n3. Review CloudWatch logs and find credentials printed in debug log statements\n4. Create a scoped IAM policy granting only the specific DynamoDB and S3 actions needed\n5. Migrate secrets to AWS Secrets Manager and update function to retrieve at runtime\n6. Remove debug logging that outputs sensitive data\n7. Rotate all exposed credentials and enable Lambda function encryption with KMS\n\n**Pitfalls**: Changing a function's execution role can break it if the new role is too restrictive. Test in a staging environment first. Environment variable changes trigger a new function version, so ensure aliases and triggers are updated. Secrets Manager calls add latency; cache secrets within the execution context to avoid per-invocation lookups.\n\n## Output Format\n\n```\nServerless Function Security Review\n=======================================\nAccount: 123456789012\nFunctions Reviewed: 34\nReview Date: 2026-02-23\n\nCRITICAL FINDINGS:\n[SRVL-001] Overly Permissive Execution Role\n  Function: payment-processor\n  Role: AdministratorAccess (full AWS access)\n  Required Permissions: DynamoDB:PutItem, S3:GetObject (2 actions)\n  Remediation: Create scoped policy with only required permissions\n\n[SRVL-002] Secrets in Environment Variables\n  Function: payment-processor\n  Variables: DB_PASSWORD, STRIPE_SECRET_KEY, API_KEY\n  Risk: Visible in console, API, and CloudWatch logs\n  Remediation: Migrate to Secrets Manager, remove from env vars\n\nSUMMARY:\n  Functions with admin roles:           3 \u002F 34\n  Functions with secrets in env vars:   8 \u002F 34\n  Functions with deprecated runtimes:   5 \u002F 34\n  Functions with public access:         2 \u002F 34\n  Functions without VPC:               28 \u002F 34\n  Functions with wildcard permissions: 12 \u002F 34\n```\n",{"name":5,"tags":25,"author":32,"domain":33,"license":15,"version":34,"nist_csf":35,"subdomain":26,"description":40,"mitre_attack":41},[26,27,28,29,30,31],"cloud-security","serverless","lambda","azure-functions","cloud-functions","security-review","mahipal","cybersecurity","1.0",[36,37,38,39],"PR.IR-01","ID.AM-08","GV.SC-06","DE.CM-01","Performing security reviews of serverless functions across AWS Lambda, Azure Functions, and GCP Cloud Functions to identify overly permissive execution roles, insecure environment variables, injection vulnerabilities, and missing runtime protections.\n",[42,43,44,45,46],"T1078.004","T1530","T1537","T1580","T1055","main","7540bbccf0c1ded6156a467b02c95b61ad62413f",".agents\u002Fskills\u002Fperforming-serverless-function-security-review","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena","Currently exploring the intersection of tech","2026-09-11 03:02:31",{"source":8,"skillName":5,"commands":55,"prompt":65,"zipAvailable":66},[56,59,62],{"tool":57,"command":58},"npx","npx skills add NeelakshSaxena\u002FVayu --skill performing-serverless-function-security-review",{"tool":60,"command":61},"bunx","bunx skills add NeelakshSaxena\u002FVayu --skill performing-serverless-function-security-review",{"tool":63,"command":64},"pnpm","pnpm dlx skills add NeelakshSaxena\u002FVayu --skill performing-serverless-function-security-review","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-serverless-function-security-review\u002FSKILL.md",true,[68,72,78],{"path":69,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":16},"LICENSE","许可证",11255,{"path":73,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":77},"references\u002Fapi-reference.md","REFERENCE","参考文档",2793,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-serverless-function-security-review\u002Freferences\u002Fapi-reference.md",{"path":79,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":82,"sourceHtmlUrl":83},"scripts\u002Fagent.py","SCRIPT","脚本",5343,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-serverless-function-security-review\u002Fscripts\u002Fagent.py",[85,92,99,106,113,120],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":20},"01M7ACCCVNCFKMA9X6D15X6G98","runpodctl","Runpod CLI for managing GPU\u002FCPU workloads from the terminal — pods, serverless endpoints, templates, network volumes, Hub deploys, models, SSH, and file transfer (send\u002Freceive). Use for terminal\u002FCI\u002Fscripting, Hub browse\u002Fdeploy, SSH setup, `doctor`, or when the Runpod MCP tools are not connected. For structured tool calls in an MCP-enabled session, prefer runpod-mcp.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpodctl\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":20},"01M7ACC63SRHEA5KMCHSMZK2TC","runpod","Start here for any Runpod task — running GPU\u002FCPU pods, deploying serverless endpoints, templates, network volumes, building images, or understanding how Runpod works. Routes to the right skill (runpod-mcp, runpodctl, flash, companion-clis, runpod-usage, runpod-templates, runpod-migrate) and indexes two dozen live-verified end-to-end examples (golden paths) — use it when the lane is unclear, and for any multi-step or provisioning task even when it is not.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":20},"01M7ACC0Q1C89N9BZBV91CTQTF","runpod-usage","How Runpod works and how to work it — pods vs serverless, GPU\u002FVRAM selection, storage, building a container, networking, plus the agentic pod development loop (provision → ssh-exec → set up → poll readiness) and on-pod install hygiene (uv\u002Fapt). Use to answer \"how does X work\", \"which GPU\", \"how do I build a container\", or \"how do I stand up a workload on a pod\". Guidance, not a tool — execute with runpodctl, runpod-mcp, or flash.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-usage\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":20},"01M7ACBRPE345GF5GM5B8P8RRC","runpod-templates","Runpod's official prebuilt pod templates (ComfyUI, PyTorch, and others): what each image ships, which ports and paths it uses, how to pick one, how to pin a version, and what is missing on first boot. Use when a task says \"run \u003CX> on a pod\" and an official template already covers it, instead of building an image — and when a user needs help with or wants to fix something about a Runpod template they are already running (won't boot, can't reach the UI, missing models, wrong CUDA line, broken ComfyUI workflow metadata on imported workflows): start here and route onward. Deploy with runpodctl or runpod-mcp; end-to-end walkthroughs live in the runpod router's golden paths.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-templates\u002FSKILL.md",[],[],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":20},"01M7ACBJATHKVX1TWES2F44GY8","runpod-migrate","Migrate a codebase from the Runpod GraphQL API or REST v1 to REST v2 — inventory which parts use which API version, rewrite the call sites, flag breaking changes, and verify. Use when someone asks to move to v2, asks what v2 would change, or asks which Runpod API their code is on. For managing infrastructure rather than migrating code, use runpod-mcp or runpodctl.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-migrate\u002FSKILL.md",[],[],{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":20},"01M7ACBC7GHVH6T9YEAPCG2AP8","runpod-mcp","Manage Runpod infrastructure — pods, serverless endpoints, jobs, templates, network volumes, container-registry auth, GPU\u002FCPU catalog, and billing — via the Runpod MCP server's structured tool calls. Use when the Runpod MCP tools (create-pod, list-endpoints, …) are connected in this session, or to connect them (hosted OAuth or local npx). Prefer this over runpodctl for plain infra CRUD when MCP is available; use runpodctl for the terminal, file transfer, or SSH setup.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-mcp\u002FSKILL.md",[],[]]