eslint-plugin-lambda-security 1.2.0 โ†’ 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,23 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Ofri Peretz
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+
package/README.md CHANGED
@@ -16,7 +16,8 @@
16
16
 
17
17
  ## Description
18
18
 
19
- This plugin secures your AWS Lambda functions by enforcing best practices related to IAM permissions, timeout configurations, and environment variable management. It proactively detects vulnerabilities such as over-permissive policies and insecure logging practices, helping you adhere to the Principle of Least Privilege. Implementing these checks ensures that your serverless architecture remains resilient and compliant with strict security standards.
19
+ This plugin provides Security best practices for AWS Lambda functions (IAM, timeouts, environment).
20
+ By using this plugin, you can proactively identify and mitigate security risks across your entire codebase.
20
21
 
21
22
  ## Philosophy
22
23
 
@@ -24,19 +25,18 @@ This plugin secures your AWS Lambda functions by enforcing best practices relate
24
25
 
25
26
  ## Getting Started
26
27
 
27
- - To check out the [guide](https://eslint.interlace.tools/docs/lambda-security), visit [eslint.interlace.tools](https://eslint.interlace.tools). ๐Ÿ“š
28
- - ่ฆๆŸฅ็œ‹ไธญๆ–‡ [ๆŒ‡ๅ—](https://eslint.interlace.tools/docs/lambda-security), ่ฏท่ฎฟ้—ฎ [eslint.interlace.tools](https://eslint.interlace.tools). ๐Ÿ“š
29
- - [๊ฐ€์ด๋“œ](https://eslint.interlace.tools/docs/lambda-security) ๋ฌธ์„œ๋Š” [eslint.interlace.tools](https://eslint.interlace.tools)์—์„œ ํ™•์ธํ•˜์‹ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๐Ÿ“š
30
- - [ใ‚ฌใ‚คใƒ‰](https://eslint.interlace.tools/docs/lambda-security)ใฏ [eslint.interlace.tools](https://eslint.interlace.tools)ใงใ”็ขบ่ชใใ ใ•ใ„ใ€‚ ๐Ÿ“š
31
- - Para ver la [guรญa](https://eslint.interlace.tools/docs/lambda-security), visita [eslint.interlace.tools](https://eslint.interlace.tools). ๐Ÿ“š
32
- - ู„ู„ุงุทู„ุงุน ุนู„ู‰ [ุงู„ุฏู„ูŠู„](https://eslint.interlace.tools/docs/lambda-security)ุŒ ู‚ู… ุจุฒูŠุงุฑุฉ [eslint.interlace.tools](https://eslint.interlace.tools). ๐Ÿ“š
28
+ - To check out the [guide](https://eslint.interlace.tools/docs/security/plugin-lambda-security), visit [eslint.interlace.tools](https://eslint.interlace.tools). ๐Ÿ“š
29
+ - ่ฆๆŸฅ็œ‹ไธญๆ–‡ [ๆŒ‡ๅ—](https://eslint.interlace.tools/docs/security/plugin-lambda-security), ่ฏท่ฎฟ้—ฎ [eslint.interlace.tools](https://eslint.interlace.tools). ๐Ÿ“š
30
+ - [๊ฐ€์ด๋“œ](https://eslint.interlace.tools/docs/security/plugin-lambda-security) ๋ฌธ์„œ๋Š” [eslint.interlace.tools](https://eslint.interlace.tools)์—์„œ ํ™•์ธํ•˜์‹ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๐Ÿ“š
31
+ - [ใ‚ฌใ‚คใƒ‰](https://eslint.interlace.tools/docs/security/plugin-lambda-security)ใฏ [eslint.interlace.tools](https://eslint.interlace.tools)ใงใ”็ขบ่ชใใ ใ•ใ„ใ€‚ ๐Ÿ“š
32
+ - Para ver la [guรญa](https://eslint.interlace.tools/docs/security/plugin-lambda-security), visita [eslint.interlace.tools](https://eslint.interlace.tools). ๐Ÿ“š
33
+ - ู„ู„ุงุทู„ุงุน ุนู„ู‰ [ุงู„ุฏู„ูŠู„](https://eslint.interlace.tools/docs/security/plugin-lambda-security)ุŒ ู‚ู… ุจุฒูŠุงุฑุฉ [eslint.interlace.tools](https://eslint.interlace.tools). ๐Ÿ“š
33
34
 
34
35
  ```bash
35
36
  npm install eslint-plugin-lambda-security --save-dev
36
37
  ```
37
38
 
38
39
  ## ๐Ÿ’ก What you get
39
-
40
40
  - **Serverless-focused coverage:** 5 rules targeting Lambda-specific vulnerabilities (credentials, CORS, secrets, logging).
41
41
  - **LLM-optimized & MCP-ready:** Structured 2-line messages with CWE + OWASP + CVSS + concrete fixes so humans _and_ AI auto-fixers stay aligned.
42
42
  - **Standards aligned:** OWASP Serverless Top 10, CWE tagging, CVSS scoring in every finding for compliance mapping.
@@ -62,14 +62,12 @@ src/handlers/api.ts
62
62
  - ๐Ÿ“š **Documentation link** - learn more
63
63
 
64
64
  ## โš™๏ธ Configuration Presets
65
-
66
65
  | Preset | Description |
67
66
  | :------------ | :--------------------------------------------------------------------- |
68
67
  | `recommended` | Balanced security for Lambda projects (critical as error, others warn) |
69
68
  | `strict` | Maximum security enforcement (all rules as errors) |
70
69
 
71
70
  ## ๐Ÿ“š Supported Libraries
72
-
73
71
  | Library | npm | Downloads | Detection |
74
72
  | :----------------------- | :---------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------- |
75
73
  | `aws-lambda` | [![npm](https://img.shields.io/npm/v/aws-lambda.svg?style=flat-square)](https://www.npmjs.com/package/aws-lambda) | [![downloads](https://img.shields.io/npm/dt/aws-lambda.svg?style=flat-square)](https://www.npmjs.com/package/aws-lambda) | IAM, Logging, Timeouts |
@@ -79,7 +77,6 @@ src/handlers/api.ts
79
77
  ---
80
78
 
81
79
  ## โš™๏ธ Configuration Options
82
-
83
80
  All rules accept these common options:
84
81
 
85
82
  ```javascript
@@ -98,112 +95,57 @@ All rules accept these common options:
98
95
 
99
96
  ---
100
97
 
101
- ## ๐Ÿข Enterprise Integration Example
102
-
103
- ```javascript
104
- // eslint.config.js
105
- import lambdaSecurity from 'eslint-plugin-lambda-security';
106
-
107
- export default [
108
- // Baseline for all Lambda functions
109
- lambdaSecurity.configs.recommended,
110
-
111
- // Strict mode for payment/auth handlers
112
- {
113
- files: ['functions/payments/**', 'functions/auth/**'],
114
- ...lambdaSecurity.configs.strict,
115
- },
116
- ];
117
- ```
118
-
119
- ---
120
-
121
98
  ## Rules
122
99
 
123
100
  **Legend**
124
101
 
125
- | Icon | Description |
126
- | :--: | :----------------------------------------------------------------- |
127
- | ๐Ÿ’ผ | **Recommended**: Included in the recommended preset. |
128
- | โš ๏ธ | **Warns**: Set towarn in recommended preset. |
129
- | ๐Ÿ”ง | **Auto-fixable**: Automatically fixable by the `--fix` CLI option. |
130
- | ๐Ÿ’ก | **Suggestions**: Providing code suggestions in IDE. |
131
- | ๐Ÿšซ | **Deprecated**: This rule is deprecated. |
132
-
133
- | Rule | CWE | OWASP | CVSS | Description | ๐Ÿ’ผ | โš ๏ธ | ๐Ÿ”ง | ๐Ÿ’ก | ๐Ÿšซ |
134
- | :--------------------------------------------------------------------------------------------------------------------------- | :-----: | :----: | :--: | :------------------------------------------------------------------ | :-: | :-: | :-: | :-: | :-: |
135
- | [no-hardcoded-credentials-sdk](https://eslint.interlace.tools/docs/lambda-security/rules/no-hardcoded-credentials-sdk) | CWE-798 | SAS-02 | 9.8 | [no-hardcoded-credentials-sdk](#no-hardcoded-credentials-sdk) | ๐Ÿ’ผ | | | | |
136
- | [no-permissive-cors-response](https://eslint.interlace.tools/docs/lambda-security/rules/no-permissive-cors-response) | CWE-942 | SAS-04 | 9.1 | [no-permissive-cors-response](#no-permissive-cors-response) | ๐Ÿ’ผ | | ๐Ÿ”ง | | |
137
- | [no-permissive-cors-middy](https://eslint.interlace.tools/docs/lambda-security/rules/no-permissive-cors-middy) | CWE-942 | SAS-04 | 9.1 | [no-permissive-cors-middy](#no-permissive-cors-middy) | ๐Ÿ’ผ | | | | |
138
- | [no-secrets-in-env](https://eslint.interlace.tools/docs/lambda-security/rules/no-secrets-in-env) | CWE-522 | SAS-03 | 9.8 | [no-secrets-in-env](#no-secrets-in-env) | ๐Ÿ’ผ | | | | |
139
- | [no-env-logging](https://eslint.interlace.tools/docs/lambda-security/rules/no-env-logging) | CWE-532 | SAS-03 | 7.5 | [no-env-logging](#no-env-logging) | ๐Ÿ’ผ | โš ๏ธ | | | |
140
- | [no-error-swallowing](https://eslint.interlace.tools/docs/lambda-security/rules/no-error-swallowing) | CWE-391 | SAS-06 | 7.5 | [no-error-swallowing](#no-error-swallowing) | ๐Ÿ’ผ | โš ๏ธ | | | |
141
- | [require-timeout-handling](https://eslint.interlace.tools/docs/lambda-security/rules/require-timeout-handling) | CWE-703 | SAS-07 | 7.5 | [require-timeout-handling](#require-timeout-handling) | ๐Ÿ’ผ | โš ๏ธ | | | |
142
- | [no-unbounded-batch-processing](https://eslint.interlace.tools/docs/lambda-security/rules/no-unbounded-batch-processing) | CWE-400 | SAS-07 | 7.5 | [no-unbounded-batch-processing](#no-unbounded-batch-processing) | ๐Ÿ’ผ | โš ๏ธ | | | |
143
- | [no-unvalidated-event-body](https://eslint.interlace.tools/docs/lambda-security/rules/no-unvalidated-event-body) | CWE-20 | SAS-01 | 7.5 | [no-unvalidated-event-body](#no-unvalidated-event-body) | ๐Ÿ’ผ | โš ๏ธ | | | |
144
- | [no-missing-authorization-check](https://eslint.interlace.tools/docs/lambda-security/rules/no-missing-authorization-check) | CWE-862 | SAS-05 | 7.5 | [no-missing-authorization-check](#no-missing-authorization-check) | ๐Ÿ’ผ | โš ๏ธ | | | |
145
- | [no-exposed-error-details](https://eslint.interlace.tools/docs/lambda-security/rules/no-exposed-error-details) | CWE-209 | SAS-09 | 7.5 | [no-exposed-error-details](#no-exposed-error-details) | ๐Ÿ’ผ | โš ๏ธ | | | |
146
- | [no-user-controlled-requests](https://eslint.interlace.tools/docs/lambda-security/rules/no-user-controlled-requests) | CWE-918 | SAS-08 | 9.8 | [no-user-controlled-requests](#no-user-controlled-requests) | ๐Ÿ’ผ | | | | |
147
- | [no-overly-permissive-iam-policy](https://eslint.interlace.tools/docs/lambda-security/rules/no-overly-permissive-iam-policy) | CWE-732 | SAS-05 | 9.8 | [no-overly-permissive-iam-policy](#no-overly-permissive-iam-policy) | ๐Ÿ’ผ | | | | |
148
-
149
- ---
150
-
151
- ## AI-Optimized Messages
152
-
153
- This plugin is optimized for ESLint's [Model Context Protocol (MCP)](https://eslint.org/docs/latest/use/mcp), enabling AI assistants like **Cursor**, **GitHub Copilot**, and **Claude** to:
154
-
155
- - Understand the exact vulnerability type via CWE references
156
- - Apply the correct fix using structured guidance
157
- - Provide educational context to developers
158
-
159
- ```bash
160
- src/handlers/api.ts
161
- 18:5 error ๐Ÿ”’ CWE-798 OWASP:SAS-2 CVSS:9.8 | Hardcoded AWS credentials detected | CRITICAL [SOC2,PCI-DSS]
162
- Fix: Use credential provider chain or Lambda execution role | https://owasp.org/...
163
- ```
164
-
165
- ```json
166
- // .cursor/mcp.json
167
- {
168
- "mcpServers": {
169
- "eslint": {
170
- "command": "npx",
171
- "args": ["@eslint/mcp@latest"]
172
- }
173
- }
174
- }
175
- ```
176
-
177
- By providing this structured context (CWE, OWASP, Fix), we enable AI tools to **reason** about the security flaw rather than hallucinating. This allows Copilot/Cursor to suggest the _exact_ correct fix immediately.
178
-
179
- ---
180
-
181
- ## ๐Ÿ”’ Privacy
182
-
183
- This plugin runs **100% locally**. No data ever leaves your machine.
102
+ | Icon | Description |
103
+ | :---: | :--- |
104
+ | ๐Ÿ’ผ | **Recommended**: Included in the recommended preset. |
105
+ | โš ๏ธ | **Warns**: Set towarn in recommended preset. |
106
+ | ๐Ÿ”ง | **Auto-fixable**: Automatically fixable by the `--fix` CLI option. |
107
+ | ๐Ÿ’ก | **Suggestions**: Providing code suggestions in IDE. |
108
+ | ๐Ÿšซ | **Deprecated**: This rule is deprecated. |
109
+
110
+ | Rule | CWE | OWASP | CVSS | Description | ๐Ÿ’ผ | โš ๏ธ | ๐Ÿ”ง | ๐Ÿ’ก | ๐Ÿšซ |
111
+ | :--- | :---: | :---: | :---: | :--- | :---: | :---: | :---: | :---: | :---: |
112
+ | [no-env-logging](https://eslint.interlace.tools/docs/security/plugin-lambda-security/rules/no-env-logging) | CWE-532 | | 7.5 | ESLint rule documentation for no-env-logging | ๐Ÿ’ผ | โš ๏ธ | | | |
113
+ | [no-error-swallowing](https://eslint.interlace.tools/docs/security/plugin-lambda-security/rules/no-error-swallowing) | CWE-391 | | 7.5 | ESLint rule documentation for no-error-swallowing | ๐Ÿ’ผ | โš ๏ธ | | | |
114
+ | [no-exposed-debug-endpoints](https://eslint.interlace.tools/docs/security/plugin-lambda-security/rules/no-exposed-debug-endpoints) | | | | ESLint rule documentation for no-exposed-debug-endpoints | | | | | |
115
+ | [no-exposed-error-details](https://eslint.interlace.tools/docs/security/plugin-lambda-security/rules/no-exposed-error-details) | CWE-209 | | 7.5 | ESLint rule documentation for no-exposed-error-details | ๐Ÿ’ผ | โš ๏ธ | | | |
116
+ | [no-hardcoded-credentials-sdk](https://eslint.interlace.tools/docs/security/plugin-lambda-security/rules/no-hardcoded-credentials-sdk) | CWE-798 | | 9.8 | ESLint rule documentation for no-hardcoded-credentials-sdk | ๐Ÿ’ผ | | | | |
117
+ | [no-missing-authorization-check](https://eslint.interlace.tools/docs/security/plugin-lambda-security/rules/no-missing-authorization-check) | CWE-862 | | 7.5 | ESLint rule documentation for no-missing-authorization-check | ๐Ÿ’ผ | โš ๏ธ | | | |
118
+ | [no-overly-permissive-iam-policy](https://eslint.interlace.tools/docs/security/plugin-lambda-security/rules/no-overly-permissive-iam-policy) | CWE-732 | | 9.8 | ESLint rule documentation for no-overly-permissive-iam-policy | ๐Ÿ’ผ | | | | |
119
+ | [no-permissive-cors-middy](https://eslint.interlace.tools/docs/security/plugin-lambda-security/rules/no-permissive-cors-middy) | CWE-942 | | 9.1 | ESLint rule documentation for no-permissive-cors-middy | ๐Ÿ’ผ | | | | |
120
+ | [no-permissive-cors-response](https://eslint.interlace.tools/docs/security/plugin-lambda-security/rules/no-permissive-cors-response) | CWE-942 | | 9.1 | ESLint rule documentation for no-permissive-cors-response | ๐Ÿ’ผ | | ๐Ÿ”ง | | |
121
+ | [no-secrets-in-env](https://eslint.interlace.tools/docs/security/plugin-lambda-security/rules/no-secrets-in-env) | CWE-522 | | 9.8 | ESLint rule documentation for no-secrets-in-env | ๐Ÿ’ผ | | | | |
122
+ | [no-unbounded-batch-processing](https://eslint.interlace.tools/docs/security/plugin-lambda-security/rules/no-unbounded-batch-processing) | CWE-400 | | 7.5 | ESLint rule documentation for no-unbounded-batch-processing | ๐Ÿ’ผ | โš ๏ธ | | | |
123
+ | [no-unvalidated-event-body](https://eslint.interlace.tools/docs/security/plugin-lambda-security/rules/no-unvalidated-event-body) | CWE-20 | | 7.5 | ESLint rule documentation for no-unvalidated-event-body | ๐Ÿ’ผ | โš ๏ธ | | | |
124
+ | [no-user-controlled-requests](https://eslint.interlace.tools/docs/security/plugin-lambda-security/rules/no-user-controlled-requests) | CWE-918 | | 9.8 | ESLint rule documentation for no-user-controlled-requests | ๐Ÿ’ผ | | | | |
125
+ | [require-timeout-handling](https://eslint.interlace.tools/docs/security/plugin-lambda-security/rules/require-timeout-handling) | CWE-703 | | 7.5 | ESLint rule documentation for require-timeout-handling | ๐Ÿ’ผ | โš ๏ธ | | | |
184
126
 
185
127
  ## ๐Ÿ”— Related ESLint Plugins
186
128
 
187
129
  Part of the **Interlace ESLint Ecosystem** โ€” AI-native security plugins with LLM-optimized error messages:
188
130
 
189
- | Plugin | Downloads | Description |
190
- | :--------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------ |
191
- | [`eslint-plugin-secure-coding`](https://www.npmjs.com/package/eslint-plugin-secure-coding) | [![downloads](https://img.shields.io/npm/dt/eslint-plugin-secure-coding.svg?style=flat-square)](https://www.npmjs.com/package/eslint-plugin-secure-coding) | General security rules & OWASP guidelines. |
192
- | [`eslint-plugin-pg`](https://www.npmjs.com/package/eslint-plugin-pg) | [![downloads](https://img.shields.io/npm/dt/eslint-plugin-pg.svg?style=flat-square)](https://www.npmjs.com/package/eslint-plugin-pg) | PostgreSQL security & best practices. |
193
- | [`eslint-plugin-crypto`](https://www.npmjs.com/package/eslint-plugin-crypto) | [![downloads](https://img.shields.io/npm/dt/eslint-plugin-crypto.svg?style=flat-square)](https://www.npmjs.com/package/eslint-plugin-crypto) | NodeJS Cryptography security rules. |
194
- | [`eslint-plugin-jwt`](https://www.npmjs.com/package/eslint-plugin-jwt) | [![downloads](https://img.shields.io/npm/dt/eslint-plugin-jwt.svg?style=flat-square)](https://www.npmjs.com/package/eslint-plugin-jwt) | JWT security & best practices. |
195
- | [`eslint-plugin-browser-security`](https://www.npmjs.com/package/eslint-plugin-browser-security) | [![downloads](https://img.shields.io/npm/dt/eslint-plugin-browser-security.svg?style=flat-square)](https://www.npmjs.com/package/eslint-plugin-browser-security) | Browser-specific security & XSS prevention. |
196
- | [`eslint-plugin-express-security`](https://www.npmjs.com/package/eslint-plugin-express-security) | [![downloads](https://img.shields.io/npm/dt/eslint-plugin-express-security.svg?style=flat-square)](https://www.npmjs.com/package/eslint-plugin-express-security) | Express.js security hardening rules. |
197
- | [`eslint-plugin-lambda-security`](https://www.npmjs.com/package/eslint-plugin-lambda-security) | [![downloads](https://img.shields.io/npm/dt/eslint-plugin-lambda-security.svg?style=flat-square)](https://www.npmjs.com/package/eslint-plugin-lambda-security) | AWS Lambda security best practices. |
198
- | [`eslint-plugin-nestjs-security`](https://www.npmjs.com/package/eslint-plugin-nestjs-security) | [![downloads](https://img.shields.io/npm/dt/eslint-plugin-nestjs-security.svg?style=flat-square)](https://www.npmjs.com/package/eslint-plugin-nestjs-security) | NestJS security rules & patterns. |
199
- | [`eslint-plugin-mongodb-security`](https://www.npmjs.com/package/eslint-plugin-mongodb-security) | [![downloads](https://img.shields.io/npm/dt/eslint-plugin-mongodb-security.svg?style=flat-square)](https://www.npmjs.com/package/eslint-plugin-mongodb-security) | MongoDB security best practices. |
200
- | [`eslint-plugin-vercel-ai-security`](https://www.npmjs.com/package/eslint-plugin-vercel-ai-security) | [![downloads](https://img.shields.io/npm/dt/eslint-plugin-vercel-ai-security.svg?style=flat-square)](https://www.npmjs.com/package/eslint-plugin-vercel-ai-security) | Vercel AI SDK security hardening. |
201
- | [`eslint-plugin-import-next`](https://www.npmjs.com/package/eslint-plugin-import-next) | [![downloads](https://img.shields.io/npm/dt/eslint-plugin-import-next.svg?style=flat-square)](https://www.npmjs.com/package/eslint-plugin-import-next) | Next-gen import sorting & architecture. |
131
+ | Plugin | Downloads | Description |
132
+ | :--- | :---: | :--- |
133
+ | [`eslint-plugin-secure-coding`](https://www.npmjs.com/package/eslint-plugin-secure-coding) | [![downloads](https://img.shields.io/npm/dt/eslint-plugin-secure-coding.svg?style=flat-square)](https://www.npmjs.com/package/eslint-plugin-secure-coding) | General security rules & OWASP guidelines. |
134
+ | [`eslint-plugin-pg`](https://www.npmjs.com/package/eslint-plugin-pg) | [![downloads](https://img.shields.io/npm/dt/eslint-plugin-pg.svg?style=flat-square)](https://www.npmjs.com/package/eslint-plugin-pg) | PostgreSQL security & best practices. |
135
+ | [`eslint-plugin-crypto`](https://www.npmjs.com/package/eslint-plugin-crypto) | [![downloads](https://img.shields.io/npm/dt/eslint-plugin-crypto.svg?style=flat-square)](https://www.npmjs.com/package/eslint-plugin-crypto) | NodeJS Cryptography security rules. |
136
+ | [`eslint-plugin-jwt`](https://www.npmjs.com/package/eslint-plugin-jwt) | [![downloads](https://img.shields.io/npm/dt/eslint-plugin-jwt.svg?style=flat-square)](https://www.npmjs.com/package/eslint-plugin-jwt) | JWT security & best practices. |
137
+ | [`eslint-plugin-browser-security`](https://www.npmjs.com/package/eslint-plugin-browser-security) | [![downloads](https://img.shields.io/npm/dt/eslint-plugin-browser-security.svg?style=flat-square)](https://www.npmjs.com/package/eslint-plugin-browser-security) | Browser-specific security & XSS prevention. |
138
+ | [`eslint-plugin-express-security`](https://www.npmjs.com/package/eslint-plugin-express-security) | [![downloads](https://img.shields.io/npm/dt/eslint-plugin-express-security.svg?style=flat-square)](https://www.npmjs.com/package/eslint-plugin-express-security) | Express.js security hardening rules. |
139
+ | [`eslint-plugin-lambda-security`](https://www.npmjs.com/package/eslint-plugin-lambda-security) | [![downloads](https://img.shields.io/npm/dt/eslint-plugin-lambda-security.svg?style=flat-square)](https://www.npmjs.com/package/eslint-plugin-lambda-security) | AWS Lambda security best practices. |
140
+ | [`eslint-plugin-nestjs-security`](https://www.npmjs.com/package/eslint-plugin-nestjs-security) | [![downloads](https://img.shields.io/npm/dt/eslint-plugin-nestjs-security.svg?style=flat-square)](https://www.npmjs.com/package/eslint-plugin-nestjs-security) | NestJS security rules & patterns. |
141
+ | [`eslint-plugin-mongodb-security`](https://www.npmjs.com/package/eslint-plugin-mongodb-security) | [![downloads](https://img.shields.io/npm/dt/eslint-plugin-mongodb-security.svg?style=flat-square)](https://www.npmjs.com/package/eslint-plugin-mongodb-security) | MongoDB security best practices. |
142
+ | [`eslint-plugin-vercel-ai-security`](https://www.npmjs.com/package/eslint-plugin-vercel-ai-security) | [![downloads](https://img.shields.io/npm/dt/eslint-plugin-vercel-ai-security.svg?style=flat-square)](https://www.npmjs.com/package/eslint-plugin-vercel-ai-security) | Vercel AI SDK security hardening. |
143
+ | [`eslint-plugin-import-next`](https://www.npmjs.com/package/eslint-plugin-import-next) | [![downloads](https://img.shields.io/npm/dt/eslint-plugin-import-next.svg?style=flat-square)](https://www.npmjs.com/package/eslint-plugin-import-next) | Next-gen import sorting & architecture. |
202
144
 
203
145
  ## ๐Ÿ“„ License
204
146
 
205
147
  MIT ยฉ [Ofri Peretz](https://github.com/ofri-peretz)
206
148
 
207
149
  <p align="center">
208
- <a href="https://eslint.interlace.tools/docs/lambda-security"><img src="https://eslint.interlace.tools/images/og-lambda-security.png" alt="ESLint Interlace Plugin" width="300" /></a>
209
- </p>
150
+ <a href="https://eslint.interlace.tools/docs/security/plugin-lambda-security"><img src="https://eslint.interlace.tools/images/og-lambda-security.png" alt="ESLint Interlace Plugin" width="100%" /></a>
151
+ </p>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-lambda-security",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Security-focused ESLint plugin for AWS Lambda and Middy applications. Detects insecure API Gateway responses, missing security headers, CORS misconfigurations, input validation issues, and more.",
5
5
  "type": "commonjs",
6
6
  "main": "./src/index.js",
@@ -17,10 +17,10 @@
17
17
  },
18
18
  "author": "Ofri Peretz <ofriperetzdev@gmail.com>",
19
19
  "license": "MIT",
20
- "homepage": "https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-lambda-security/README.md",
20
+ "homepage": "https://github.com/ofri-peretz/eslint/tree/main/packages/eslint-plugin-lambda-security#readme",
21
21
  "repository": {
22
22
  "type": "git",
23
- "url": "git+https://github.com/ofri-peretz/eslint.git",
23
+ "url": "https://github.com/ofri-peretz/eslint",
24
24
  "directory": "packages/eslint-plugin-lambda-security"
25
25
  },
26
26
  "bugs": {
package/AGENTS.md DELETED
@@ -1,106 +0,0 @@
1
- # AGENTS.md
2
-
3
- > Context for AI coding agents working on eslint-plugin-lambda-security
4
-
5
- ## Setup Commands
6
-
7
- ```bash
8
- # Install dependencies (from monorepo root)
9
- pnpm install
10
-
11
- # Build this package
12
- nx build eslint-plugin-lambda-security
13
-
14
- # Run tests
15
- nx test eslint-plugin-lambda-security
16
-
17
- # Run tests with coverage
18
- nx test eslint-plugin-lambda-security --coverage
19
-
20
- # Lint this package
21
- nx lint eslint-plugin-lambda-security
22
- ```
23
-
24
- ## Code Style
25
-
26
- - TypeScript strict mode with `@interlace/eslint-devkit` types
27
- - Use `AST_NODE_TYPES` constants, never string literals for node types
28
- - Use `formatLLMMessage()` for all rule error messages
29
- - Include CWE, CVSS, OWASP Serverless Top 10 in every security message
30
- - Use `c8 ignore` comments with documented reasons for untestable code
31
- - Single-pass AST traversal patterns (O(n) complexity)
32
-
33
- ## Testing Instructions
34
-
35
- - Tests use `@typescript-eslint/rule-tester` with Vitest
36
- - Each rule has `index.ts` (implementation) and `*.test.ts` (tests) in same directory
37
- - Run specific rule test: `nx test eslint-plugin-lambda-security --testPathPattern="no-hardcoded-credentials"`
38
- - Coverage target: โ‰ฅ90% lines, โ‰ฅ95% functions
39
- - All tests must pass before committing
40
-
41
- ## Project Structure
42
-
43
- ```
44
- src/
45
- โ”œโ”€โ”€ index.ts # Plugin entry, exports rules and 2 configs
46
- โ”œโ”€โ”€ types/index.ts # Exported rule option types
47
- โ””โ”€โ”€ rules/ # 5 rule directories
48
- โ””โ”€โ”€ [rule-name]/
49
- โ”œโ”€โ”€ index.ts # Rule implementation
50
- โ””โ”€โ”€ *.test.ts # Rule tests
51
- docs/rules/ # Markdown documentation per rule
52
- ```
53
-
54
- ## Plugin Purpose
55
-
56
- Security-focused ESLint plugin with **5 rules** for AWS Lambda, Middy, and serverless applications. Covers hardcoded credentials, secrets exposure, environment logging, and CORS misconfigurations.
57
-
58
- ## Rule Categories
59
-
60
- | Category | Rules | CWEs |
61
- | --------------------- | --------------------------------------------------------------------- | -------- |
62
- | Credentials & Secrets | `no-hardcoded-credentials-sdk`, `no-secrets-in-env`, `no-env-logging` | 532, 798 |
63
- | CORS | `no-permissive-cors-response`, `no-permissive-cors-middy` | 942 |
64
-
65
- ## AWS SDK Clients Detected
66
-
67
- S3Client, DynamoDBClient, LambdaClient, STSClient, SecretsManagerClient, SQSClient, SNSClient, EC2Client, ECSClient, CloudWatchClient, CloudWatchLogsClient, APIGatewayClient, CognitoIdentityClient, CognitoIdentityProviderClient, EventBridgeClient, StepFunctionsClient, RDSClient, ElastiCacheClient
68
-
69
- ## AWS Access Key Patterns
70
-
71
- | Pattern | Type |
72
- | ------- | ------------------------ |
73
- | `AKIA*` | IAM user access key |
74
- | `ASIA*` | STS temporary access key |
75
- | `AIDA*` | IAM user ID |
76
-
77
- ## Common Fix Patterns
78
-
79
- ```typescript
80
- // Hardcoded credentials
81
- // BAD: new S3Client({ credentials: { accessKeyId: 'AKIA...', secretAccessKey: '...' } })
82
- // GOOD: new S3Client({ region: 'us-east-1' }) // Uses Lambda execution role
83
- // GOOD: new S3Client({ credentials: fromNodeProviderChain() })
84
-
85
- // Secrets in env
86
- // BAD: process.env.DB_PASSWORD = 'my-secret'
87
- // GOOD: const secret = await client.send(new GetSecretValueCommand({ SecretId: 'my-secret' }))
88
-
89
- // Logging env
90
- // BAD: console.log(process.env)
91
- // GOOD: console.log('Region:', process.env.AWS_REGION)
92
-
93
- // Lambda CORS
94
- // BAD: return { headers: { 'Access-Control-Allow-Origin': '*' }, ... }
95
- // GOOD: return { headers: { 'Access-Control-Allow-Origin': 'https://your-app.com' }, ... }
96
-
97
- // Middy CORS
98
- // BAD: middy(handler).use(httpCors())
99
- // GOOD: middy(handler).use(httpCors({ origins: ['https://your-app.com'] }))
100
- ```
101
-
102
- ## Security Considerations
103
-
104
- - All rules map to OWASP Serverless Top 10: SAS-2, SAS-3, SAS-4
105
- - CWE coverage: 532, 798, 942
106
- - Real AWS key pattern detection (not just string length checks)
package/CHANGELOG.md DELETED
@@ -1,42 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to `eslint-plugin-lambda-security` will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [1.0.0] - 2025-12-29
9
-
10
- ### Added
11
-
12
- #### Credential & Secrets Protection Rules (3)
13
-
14
- - `no-hardcoded-credentials-sdk` - Detect hardcoded AWS credentials in SDK v3 clients (CWE-798)
15
- - `no-secrets-in-env` - Detect secrets hardcoded in environment variables (CWE-798)
16
- - `no-env-logging` - Detect logging entire process.env object (CWE-532)
17
-
18
- #### CORS Security Rules (2)
19
-
20
- - `no-permissive-cors-response` - Detect wildcard CORS in Lambda response headers (CWE-942)
21
- - `no-permissive-cors-middy` - Detect permissive CORS in @middy/http-cors middleware (CWE-942)
22
-
23
- #### Presets (2)
24
-
25
- - `recommended` - Balanced security defaults
26
- - `strict` - All 5 rules as errors
27
-
28
- #### Features
29
-
30
- - LLM-optimized error messages with CWE references
31
- - OWASP Serverless Top 10 alignment (SAS-2, SAS-3, SAS-4)
32
- - AWS SDK v3 client detection (S3, DynamoDB, Lambda, STS, etc.)
33
- - Middy middleware detection (@middy/http-cors)
34
- - Real AWS access key pattern matching (AKIA*, ASIA*)
35
- - TypeScript support with exported option types
36
- - Comprehensive test coverage (78 tests, 97.40% line coverage)
37
- - Auto-fix for CORS violations
38
-
39
- ### Security
40
-
41
- - Covers 3 CWEs: 532, 798, 942
42
- - Maps to OWASP Serverless Top 10: SAS-2, SAS-3, SAS-4