ESLint InterlaceESLint Interlace
Plugin: lambda-security

Overview

AWS Lambda and Middy security rules for serverless applications

Live from GitHub

This content is fetched directly from README.md on GitHub and cached for 1 hour.

AI-Optimized Security

Every rule includes CWE, OWASP, and CVSS metadata for AI assistants to provide precise, context-aware fixes.


ESLint Interlace Logo

Security best practices for AWS Lambda functions (IAM, timeouts, environment).

NPM VersionNPM DownloadsPackage LicenseCodecovSince Dec 2025

Description

This plugin provides Security best practices for AWS Lambda functions (IAM, timeouts, environment). By using this plugin, you can proactively identify and mitigate security risks across your entire codebase.

Philosophy

Interlace fosters strength through integration. Instead of stacking isolated rules, we interlace security directly into your workflow to create a resilient fabric of code. We believe tools should guide rather than gatekeep, providing educational feedback that strengthens the developer with every interaction.

Getting Started

npm install eslint-plugin-lambda-security --save-dev

๐Ÿ’ก What you get

  • Serverless-focused coverage: 5 rules targeting Lambda-specific vulnerabilities (credentials, CORS, secrets, logging).
  • LLM-optimized & MCP-ready: Structured 2-line messages with CWE + OWASP + CVSS + concrete fixes so humans and AI auto-fixers stay aligned.
  • Standards aligned: OWASP Serverless Top 10, CWE tagging, CVSS scoring in every finding for compliance mapping.
  • Tiered presets: recommended, strict for fast policy rollout.
  • Framework-aware: Detects Middy middleware, API Gateway response patterns, AWS SDK v3 clients.
  • Low false positive rate: Context-aware detection with production heuristics.

Every security rule produces a structured 2-line error message:

src/handlers/api.ts
  18:5   error  ๐Ÿ”’ CWE-798 OWASP:SAS-2 CVSS:9.8 | Hardcoded AWS credentials detected | CRITICAL [SOC2,PCI-DSS]
                    Fix: Use credential provider chain or Lambda execution role | https://owasp.org/...

Each message includes:

  • ๐Ÿ”’ CWE reference - vulnerability classification
  • ๐Ÿ“‹ OWASP category - Serverless Top 10 mapping
  • ๐Ÿ“Š CVSS score - severity rating (0.0-10.0)
  • ๐Ÿข Compliance tags - affected frameworks (SOC2, PCI-DSS, HIPAA)
  • โœ… Fix instruction - exact code to write
  • ๐Ÿ“š Documentation link - learn more

โš™๏ธ Configuration Presets

PresetDescription
recommendedBalanced security for Lambda projects (critical as error, others warn)
strictMaximum security enforcement (all rules as errors)

๐Ÿ“š Supported Libraries

LibrarynpmDownloadsDetection
aws-lambdaIAM, Logging, Timeouts
@aws-sdk/client-lambdaCredential Safety
middyMiddleware Security

โš™๏ธ Configuration Options

All rules accept these common options:

{
  rules: {
    'lambda-security/no-hardcoded-credentials-sdk': ['error', {
      allowInTests: true // Default: true - skip test files
    }],
    'lambda-security/no-secrets-in-env': ['error', {
      allowInTests: true,
      additionalPatterns: ['CUSTOM_SECRET_*'] // Additional patterns to detect
    }]
  }
}

Rules

Legend

IconDescription
๐Ÿ’ผRecommended: Included in the recommended preset.
โš ๏ธWarns: Set towarn in recommended preset.
๐Ÿ”งAuto-fixable: Automatically fixable by the --fix CLI option.
๐Ÿ’กSuggestions: Providing code suggestions in IDE.
๐ŸšซDeprecated: This rule is deprecated.
RuleCWEOWASPCVSSDescription๐Ÿ’ผโš ๏ธ๐Ÿ”ง๐Ÿ’ก๐Ÿšซ
no-env-loggingCWE-5327.5ESLint rule documentation for no-env-logging๐Ÿ’ผโš ๏ธ
no-error-swallowingCWE-3917.5ESLint rule documentation for no-error-swallowing๐Ÿ’ผโš ๏ธ
no-exposed-debug-endpointsESLint rule documentation for no-exposed-debug-endpoints
no-exposed-error-detailsCWE-2097.5ESLint rule documentation for no-exposed-error-details๐Ÿ’ผโš ๏ธ
no-hardcoded-credentials-sdkCWE-7989.8ESLint rule documentation for no-hardcoded-credentials-sdk๐Ÿ’ผ
no-missing-authorization-checkCWE-8627.5ESLint rule documentation for no-missing-authorization-check๐Ÿ’ผโš ๏ธ
no-overly-permissive-iam-policyCWE-7329.8ESLint rule documentation for no-overly-permissive-iam-policy๐Ÿ’ผ
no-permissive-cors-middyCWE-9429.1ESLint rule documentation for no-permissive-cors-middy๐Ÿ’ผ
no-permissive-cors-responseCWE-9429.1ESLint rule documentation for no-permissive-cors-response๐Ÿ’ผ๐Ÿ”ง
no-secrets-in-envCWE-5229.8ESLint rule documentation for no-secrets-in-env๐Ÿ’ผ
no-unbounded-batch-processingCWE-4007.5ESLint rule documentation for no-unbounded-batch-processing๐Ÿ’ผโš ๏ธ
no-unvalidated-event-bodyCWE-207.5ESLint rule documentation for no-unvalidated-event-body๐Ÿ’ผโš ๏ธ
no-user-controlled-requestsCWE-9189.8ESLint rule documentation for no-user-controlled-requests๐Ÿ’ผ
require-timeout-handlingCWE-7037.5ESLint rule documentation for require-timeout-handling๐Ÿ’ผโš ๏ธ

Part of the Interlace ESLint Ecosystem โ€” AI-native security plugins with LLM-optimized error messages:

PluginDownloadsDescription
eslint-plugin-secure-codingGeneral security rules & OWASP guidelines.
eslint-plugin-pgPostgreSQL security & best practices.
eslint-plugin-cryptoNodeJS Cryptography security rules.
eslint-plugin-jwtJWT security & best practices.
eslint-plugin-browser-securityBrowser-specific security & XSS prevention.
eslint-plugin-express-securityExpress.js security hardening rules.
eslint-plugin-lambda-securityAWS Lambda security best practices.
eslint-plugin-nestjs-securityNestJS security rules & patterns.
eslint-plugin-mongodb-securityMongoDB security best practices.
eslint-plugin-vercel-ai-securityVercel AI SDK security hardening.
eslint-plugin-import-nextNext-gen import sorting & architecture.

๐Ÿ“„ License

MIT ยฉ Ofri Peretz

ESLint Interlace Plugin

View README.md on GitHub โ†’

On this page

No Headings