[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71CPKTHKH9AXB4N2X0AEYJG":3,"skill-same:01M71CPKTHKH9AXB4N2X0AEYJG":88},{"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":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":61,"commitSha":62,"skillDirectory":63,"forksCount":14,"repositoryHtmlUrl":64,"repositoryHomepageUrl":6,"ownerHtmlUrl":65,"ownerBlogUrl":6,"ownerDescription":66,"updatedAt":67,"install":68,"resources":81},"01M71CPKTHKH9AXB4N2X0AEYJG","serverless-serverlessrev-detect",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.","DCx7C5\u002Fai-marketplace","DCx7C5","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F42419559?v=4","01M71C01G2AZV3NTNGWAWSHJPP","DC","01M71C01GQW6G50S2BYMS7PP3E",0,"MIT","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fserverless\u002Fserverlessrev\u002Fdetect\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"serverless serverlessrev detect","detect","serverless","Bash","reviews","Variables","gcp cloud functions","de","across","aws lambda","cm","review","cloud-functions","azure-functions","security-review","t1078","lambda","gcp","cloud-security","cybersecurity","2026-11-10 10:12:30",false,"---\nname: serverless-serverlessrev-detect\ndescription: 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.\ndomain: cybersecurity\nsubdomain: cloud-security\ntags:\n- cloud-security\n- serverless\n- lambda\n- azure-functions\n- cloud-functions\n- security-review\nnist_csf:\n- PR.IR-01\n- ID.AM-08\n- GV.SC-06\n- DE.CM-01\nmodel: sonnet\nmaxTurns: 20\ntools: [Read, Bash, Glob, Grep]\nmitre_attack:\n- T1059.009\n- T1078.004\n- T1610\ncapec: []\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":44,"capec":45,"model":46,"tools":47,"domain":38,"maxTurns":51,"nist_csf":52,"subdomain":37,"description":7,"mitre_attack":57},[37,21,35,32,31,33],[],"sonnet",[48,22,49,50],"Read","Glob","Grep",20,[53,54,55,56],"PR.IR-01","ID.AM-08","GV.SC-06","DE.CM-01",[58,59,60],"T1059.009","T1078.004","T1610","main","a91f1293287ffa9f4f1b8f486cd6e835a1568c84","skills\u002Fcloud\u002Fserverless\u002Fserverlessrev\u002Fdetect","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace","https:\u002F\u002Fgithub.com\u002FDCx7C5","#Python","2026-09-01 11:21:00",{"source":8,"skillName":5,"commands":69,"prompt":79,"zipAvailable":80},[70,73,76],{"tool":71,"command":72},"npx","npx skills add DCx7C5\u002Fai-marketplace --skill serverless-serverlessrev-detect",{"tool":74,"command":75},"bunx","bunx skills add DCx7C5\u002Fai-marketplace --skill serverless-serverlessrev-detect",{"tool":77,"command":78},"pnpm","pnpm dlx skills add DCx7C5\u002Fai-marketplace --skill serverless-serverlessrev-detect","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fserverless\u002Fserverlessrev\u002Fdetect\u002FSKILL.md",true,[82],{"path":83,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":86,"sourceHtmlUrl":87},"index.json","REFERENCE","参考文档",704,"https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fserverless\u002Fserverlessrev\u002Fdetect\u002Findex.json",[89,111,132,153,175,191],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":39},"01M71HAPZ01KQ30RKTB0FFSQ05","services-wmi-persistence-detect","Detect WMI event subscription persistence by enumerating ActiveScriptEventConsumer, CommandLineEventConsumer, and permanent subscriptions in the WMI repository.","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fwindows\u002Fservices\u002Fwmi\u002Fpersistence\u002Fdetect\u002FSKILL.md",[],[96,20,97,98,99,26,29,100,101,102,103,104,105,106,107,108,109,38,110],"services","services wmi persistence detect","wmi","persistence","process","activescript","event","subscriptions","commandline-consumer","repository","subscription","event-subscription","t1546.003","forensics","process-forensics",{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":39},"01M71HAK6JTTTS229T17WJMMCG","services-wmi-exec-exploit","Perform lateral movement across Windows networks using WMI-based remote execution techniques including Impacket wmiexec.py, CrackMapExec, and native WMI commands for stealthy post-exploitation during red team engagements.","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fwindows\u002Fservices\u002Fwmi\u002Fexec\u002Fexploit\u002FSKILL.md",[],[118,96,119,98,120,121,122,38,22,123,124,27,125,126,26,127,128,129,130,131],"exploit","services wmi exec exploit","exec","remote","traffic","analysis","team","crackmapexec","native","command","lateral movement","read","lateral-movement","Impacket",{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":138,"publishedAt":39},"01M71HAG6MHKNQV8KDZKMT4886","registry-artifact-extract","Extract and analyze Windows Registry hives to uncover user activity, installed software, autostart entries, and evidence of system compromise.","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fwindows\u002Fregistry\u002Fartifact\u002Fextract\u002FSKILL.md",[],[139,140,141,142,143,144,38,22,145,123,146,147,26,129,148,149,150,151,152,46],"artifact","registry","registry artifact extract","extract","evidence-collection","artifact-analysis","collection","analyze","uncover","software","activity","digital-forensics","windows-registry","regripper",{"skillNo":154,"name":155,"nameZh":6,"description":156,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":157,"categories":158,"keywords":159,"publishedAt":39},"01M71HACR4A8XTWTTSXK4124AA","processes-token-impersonate-detect","Detect Windows token impersonation and privilege abuse including SeImpersonatePrivilege exploitation via Potato attacks and token stealing techniques.","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fwindows\u002Fprocesses\u002Ftoken\u002Fimpersonate\u002Fdetect\u002FSKILL.md",[],[20,160,161,162,163,164,165,29,166,38,110,167,168,169,170,171,172,173,174,26],"processes token impersonate detect","token","processes","attacks","windows","escalation","techniques","privilege-escalation","seimpersonate","token-impersonation","printspoofer","exploitation","potato","impersonation","via",{"skillNo":176,"name":177,"nameZh":6,"description":178,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":179,"categories":180,"keywords":181,"publishedAt":39},"01M71HAABSB4Z6QFSXEG00R4RK","processes-thread-injection-detect","Detect Windows thread injection techniques including CreateRemoteThread, QueueUserAPC, NtCreateThreadEx, and thread hijacking via process memory analysis.","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fwindows\u002Fprocesses\u002Fthread\u002Finjection\u002Fdetect\u002FSKILL.md",[],[182,183,20,184,162,164,185,29,186,166,38,110,123,187,188,189,190,174,26,100],"thread","processes thread injection detect","injection","memory","process-injection","api","apc-injection","thread-injection","nt-api",{"skillNo":192,"name":193,"nameZh":6,"description":194,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":195,"categories":196,"keywords":197,"publishedAt":39},"01M71HA7H311V5G14WMX58HQSS","processes-hollow-technique-detect","Detect process hollowing (RunPE) by identifying processes with mismatched image paths between PEB and VAD tree, or unmapped PE headers in memory.","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fwindows\u002Fprocesses\u002Fhollow\u002Ftechnique\u002Fdetect\u002FSKILL.md",[],[198,20,162,199,185,29,200,201,38,110,202,203,204,205,206,207,26,100,208,209],"processes hollow technique detect","tree","memory-forensics","process-hollow","peb","runpe","image","pe-header","in memory","with","mismatched","headers"]