eslint-plugin-lambda-security 1.1.0 โ 1.1.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/README.md +99 -266
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,21 +1,39 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://eslint.interlace.tools" target="blank"><img src="https://eslint.interlace.tools/eslint-interlace-logo-light.svg" alt="ESLint Interlace Logo" width="120" /></a>
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
</
|
|
5
|
+
<p align="center">
|
|
6
|
+
Security best practices for AWS Lambda functions (IAM, timeouts, environment).
|
|
7
|
+
</p>
|
|
6
8
|
|
|
7
|
-
>
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://www.npmjs.com/package/eslint-plugin-lambda-security" target="_blank"><img src="https://img.shields.io/npm/v/eslint-plugin-lambda-security.svg" alt="NPM Version" /></a>
|
|
11
|
+
<a href="https://www.npmjs.com/package/eslint-plugin-lambda-security" target="_blank"><img src="https://img.shields.io/npm/dm/eslint-plugin-lambda-security.svg" alt="NPM Downloads" /></a>
|
|
12
|
+
<a href="https://opensource.org/licenses/MIT" target="_blank"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="Package License" /></a>
|
|
13
|
+
<a href="https://app.codecov.io/gh/ofri-peretz/eslint/components?components%5B0%5D=lambda-security" target="_blank"><img src="https://codecov.io/gh/ofri-peretz/eslint/graph/badge.svg?component=lambda-security" alt="Codecov" /></a>
|
|
14
|
+
<a href="https://github.com/ofri-peretz/eslint" target="_blank"><img src="https://img.shields.io/badge/Since-Dec_2025-blue?logo=rocket&logoColor=white" alt="Since Dec 2025" /></a>
|
|
15
|
+
</p>
|
|
8
16
|
|
|
9
|
-
|
|
10
|
-
[](https://www.npmjs.com/package/eslint-plugin-lambda-security)
|
|
11
|
-
[](https://opensource.org/licenses/MIT)
|
|
12
|
-
[](https://app.codecov.io/gh/ofri-peretz/eslint/components?components%5B0%5D=lambda_security)
|
|
13
|
-
[](https://github.com/ofri-peretz/eslint)
|
|
17
|
+
## Description
|
|
14
18
|
|
|
15
|
-
|
|
16
|
-
> With **5 security rules** mapped to OWASP Serverless Top 10, CWE and CVSS, it transforms your linter into a serverless security auditor that AI assistants can understand and fix.
|
|
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.
|
|
17
20
|
|
|
18
|
-
|
|
21
|
+
## Philosophy
|
|
22
|
+
|
|
23
|
+
**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.
|
|
24
|
+
|
|
25
|
+
## Getting Started
|
|
26
|
+
|
|
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). ๐
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install eslint-plugin-lambda-security --save-dev
|
|
36
|
+
```
|
|
19
37
|
|
|
20
38
|
## ๐ก What you get
|
|
21
39
|
|
|
@@ -43,244 +61,20 @@ src/handlers/api.ts
|
|
|
43
61
|
- โ
**Fix instruction** - exact code to write
|
|
44
62
|
- ๐ **Documentation link** - learn more
|
|
45
63
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
## ๐ OWASP Serverless Top 10 Coverage Matrix
|
|
49
|
-
|
|
50
|
-
| OWASP Category | Coverage | Rule | CWE | OWASP | CVSS | Description | ๐ผ | โ ๏ธ | ๐ง | ๐ก | ๐ซ |
|
|
51
|
-
| :--- | :---: | :---: | :---: | :--- | :---: | :---: | :---: | :---: | :---: |
|
|
52
|
-
| **SAS-1: Injection** | | | | | | | | | |
|
|
53
|
-
| **SAS-2: Broken Authentication** | | | | | | | | | |
|
|
54
|
-
| **SAS-3: Sensitive Data Exposure** | | | | | | | | | |
|
|
55
|
-
| **SAS-4: Security Misconfiguration** | | | | | | | | | |
|
|
56
|
-
| **SAS-5: Broken Access Control** | | | | | | | | | |
|
|
57
|
-
| **SAS-6: Insufficient Logging** | | | | | | | | | |
|
|
58
|
-
| **SAS-7: Denial of Service** | | | | | | | | | |
|
|
59
|
-
| **SAS-8: Server-Side Request Forgery** | | | | | | | | | |
|
|
60
|
-
| **SAS-9: Functions Misconfiguration** | | | | | | | | | |
|
|
61
|
-
| **SAS-10: Improper Crypto** | | | | | | | | | |
|
|
62
|
-
---
|
|
63
|
-
|
|
64
|
-
## ๐ 13 Security Rules
|
|
65
|
-
|
|
66
|
-
๐ผ = Set in `recommended` | โ ๏ธ = Warns in `recommended` | ๐ง = Auto-fixable | ๐ก = Suggestions
|
|
67
|
-
|
|
68
|
-
### Credential & Secrets Protection (3 rules)
|
|
69
|
-
|
|
70
|
-
| Rule | CWE | OWASP | CVSS | Description | ๐ผ | โ ๏ธ | ๐ง | ๐ก | ๐ซ |
|
|
71
|
-
| :--- | :---: | :---: | :---: | :--- | :---: | :---: | :---: | :---: | :---: |
|
|
72
|
-
| [no-hardcoded-credentials-sdk](#no-hardcoded-credentials-sdk) | CWE-798 | SAS-2 | 9.8 | Hardcoded AWS credentials in SDK v3 clients | ๐ผ | | | | |
|
|
73
|
-
| [no-secrets-in-env](#no-secrets-in-env) | CWE-798 | SAS-3 | 9.8 | Secrets hardcoded in environment variables | ๐ผ | | | | |
|
|
74
|
-
| [no-env-logging](#no-env-logging) | CWE-532 | SAS-3 | 7.5 | Logging entire `process.env` object | | โ ๏ธ | | | |
|
|
75
|
-
### CORS Security (2 rules)
|
|
76
|
-
|
|
77
|
-
| Rule | CWE | OWASP | CVSS | Description | ๐ผ | โ ๏ธ | ๐ง | ๐ก | ๐ซ |
|
|
78
|
-
| :--- | :---: | :---: | :---: | :--- | :---: | :---: | :---: | :---: | :---: |
|
|
79
|
-
| [no-permissive-cors-response](#no-permissive-cors-response) | CWE-942 | SAS-4 | 9.1 | Wildcard CORS in Lambda response headers | ๐ผ | | ๐ง | | |
|
|
80
|
-
| [no-permissive-cors-middy](#no-permissive-cors-middy) | CWE-942 | SAS-4 | 9.1 | Permissive CORS in @middy/http-cors middleware | ๐ผ | | | | |
|
|
81
|
-
### Input Validation & Access Control (4 rules)
|
|
82
|
-
|
|
83
|
-
| Rule | CWE | OWASP | CVSS | Description | ๐ผ | โ ๏ธ | ๐ง | ๐ก | ๐ซ |
|
|
84
|
-
| :--- | :---: | :---: | :---: | :--- | :---: | :---: | :---: | :---: | :---: |
|
|
85
|
-
| no-unvalidated-event-body | CWE-20 | SAS-1 | 8.0 | Lambda handlers using event body without validation | | โ ๏ธ | | ๐ก | |
|
|
86
|
-
| no-missing-authorization-check | CWE-862 | SAS-5 | 7.5 | Lambda handlers without authorization checks | | โ ๏ธ | | ๐ก | |
|
|
87
|
-
| no-overly-permissive-iam-policy | CWE-732 | SAS-5 | 6.5 | IAM policies with wildcard permissions | ๐ผ | | | ๐ก | |
|
|
88
|
-
| no-user-controlled-requests | CWE-918 | SAS-8 | 9.1 | HTTP requests with user-controlled URLs (SSRF) | ๐ผ | | | ๐ก | |
|
|
89
|
-
### Security Operations (4 rules)
|
|
90
|
-
|
|
91
|
-
| Rule | CWE | OWASP | CVSS | Description | ๐ผ | โ ๏ธ | ๐ง | ๐ก | ๐ซ |
|
|
92
|
-
| :--- | :---: | :---: | :---: | :--- | :---: | :---: | :---: | :---: | :---: |
|
|
93
|
-
| no-error-swallowing | CWE-390 | SAS-6 | 5.0 | Empty catch blocks and missing error logging | | โ ๏ธ | | ๐ก | |
|
|
94
|
-
| require-timeout-handling | CWE-400 | SAS-7 | 6.0 | External calls without timeout handling | | โ ๏ธ | | ๐ก | |
|
|
95
|
-
| no-unbounded-batch-processing | CWE-770 | SAS-7 | 5.5 | Processing batch records without size limits | | โ ๏ธ | | ๐ก | |
|
|
96
|
-
| no-exposed-error-details | CWE-209 | SAS-9 | 4.3 | Exposing internal error details in responses | | โ ๏ธ | | ๐ก | |
|
|
97
|
-
---
|
|
98
|
-
|
|
99
|
-
## ๐ Rule Details
|
|
64
|
+
## โ๏ธ Configuration Presets
|
|
100
65
|
|
|
101
|
-
|
|
66
|
+
| Preset | Description |
|
|
67
|
+
| :------------ | :--------------------------------------------------------------------- |
|
|
68
|
+
| `recommended` | Balanced security for Lambda projects (critical as error, others warn) |
|
|
69
|
+
| `strict` | Maximum security enforcement (all rules as errors) |
|
|
102
70
|
|
|
103
|
-
|
|
71
|
+
## ๐ Supported Libraries
|
|
104
72
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
credentials: {
|
|
111
|
-
accessKeyId: 'AKIAIOSFODNN7EXAMPLE',
|
|
112
|
-
secretAccessKey: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY',
|
|
113
|
-
},
|
|
114
|
-
});
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
**โ
Correct**
|
|
118
|
-
|
|
119
|
-
```javascript
|
|
120
|
-
// Use credential provider chain
|
|
121
|
-
import { fromNodeProviderChain } from '@aws-sdk/credential-providers';
|
|
122
|
-
|
|
123
|
-
const client = new S3Client({
|
|
124
|
-
credentials: fromNodeProviderChain(),
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
// Or let SDK use default chain (recommended for Lambda)
|
|
128
|
-
const client = new S3Client({ region: 'us-east-1' });
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
**Detection Patterns:**
|
|
132
|
-
|
|
133
|
-
- Real AWS access key patterns (AKIA*, ASIA*)
|
|
134
|
-
- Secret access keys with 20+ characters
|
|
135
|
-
- Session tokens with 15+ characters
|
|
136
|
-
- Template literal credential construction
|
|
137
|
-
|
|
138
|
-
---
|
|
139
|
-
|
|
140
|
-
### `no-permissive-cors-response`
|
|
141
|
-
|
|
142
|
-
Detects wildcard CORS (`Access-Control-Allow-Origin: '*'`) in Lambda response headers.
|
|
143
|
-
|
|
144
|
-
**โ Incorrect**
|
|
145
|
-
|
|
146
|
-
```javascript
|
|
147
|
-
return {
|
|
148
|
-
statusCode: 200,
|
|
149
|
-
headers: { 'Access-Control-Allow-Origin': '*' },
|
|
150
|
-
body: JSON.stringify(data),
|
|
151
|
-
};
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
**โ
Correct**
|
|
155
|
-
|
|
156
|
-
```javascript
|
|
157
|
-
return {
|
|
158
|
-
statusCode: 200,
|
|
159
|
-
headers: { 'Access-Control-Allow-Origin': 'https://your-app.com' },
|
|
160
|
-
body: JSON.stringify(data),
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
// Or use dynamic origin from request
|
|
164
|
-
return {
|
|
165
|
-
statusCode: 200,
|
|
166
|
-
headers: { 'Access-Control-Allow-Origin': event.headers.origin },
|
|
167
|
-
body: JSON.stringify(data),
|
|
168
|
-
};
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
---
|
|
172
|
-
|
|
173
|
-
### `no-permissive-cors-middy`
|
|
174
|
-
|
|
175
|
-
Detects permissive CORS configuration in Middy http-cors middleware.
|
|
176
|
-
|
|
177
|
-
**โ Incorrect**
|
|
178
|
-
|
|
179
|
-
```javascript
|
|
180
|
-
// Default is permissive!
|
|
181
|
-
middy(handler).use(httpCors());
|
|
182
|
-
|
|
183
|
-
// Explicit wildcard
|
|
184
|
-
middy(handler).use(httpCors({ origin: '*' }));
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
**โ
Correct**
|
|
188
|
-
|
|
189
|
-
```javascript
|
|
190
|
-
middy(handler).use(
|
|
191
|
-
httpCors({
|
|
192
|
-
origins: ['https://your-app.com', 'https://app.your-domain.com'],
|
|
193
|
-
}),
|
|
194
|
-
);
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
---
|
|
198
|
-
|
|
199
|
-
### `no-secrets-in-env`
|
|
200
|
-
|
|
201
|
-
Detects secrets hardcoded in environment variable assignments.
|
|
202
|
-
|
|
203
|
-
**โ Incorrect**
|
|
204
|
-
|
|
205
|
-
```javascript
|
|
206
|
-
process.env.DB_PASSWORD = 'my-secret-password-12345';
|
|
207
|
-
|
|
208
|
-
const envConfig = {
|
|
209
|
-
API_KEY: 'sk-1234567890abcdef1234567890abcdef',
|
|
210
|
-
};
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
**โ
Correct**
|
|
214
|
-
|
|
215
|
-
```javascript
|
|
216
|
-
// Read from process.env (populated by Lambda)
|
|
217
|
-
const password = process.env.DB_PASSWORD;
|
|
218
|
-
|
|
219
|
-
// Use AWS Secrets Manager
|
|
220
|
-
import {
|
|
221
|
-
SecretsManagerClient,
|
|
222
|
-
GetSecretValueCommand,
|
|
223
|
-
} from '@aws-sdk/client-secrets-manager';
|
|
224
|
-
|
|
225
|
-
const secret = await client.send(
|
|
226
|
-
new GetSecretValueCommand({ SecretId: 'my-secret' }),
|
|
227
|
-
);
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
---
|
|
231
|
-
|
|
232
|
-
### `no-env-logging`
|
|
233
|
-
|
|
234
|
-
Detects logging of the entire `process.env` object, which may expose secrets.
|
|
235
|
-
|
|
236
|
-
**โ Incorrect**
|
|
237
|
-
|
|
238
|
-
```javascript
|
|
239
|
-
console.log(process.env);
|
|
240
|
-
console.log(JSON.stringify(process.env));
|
|
241
|
-
logger.info(process.env);
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
**โ
Correct**
|
|
245
|
-
|
|
246
|
-
```javascript
|
|
247
|
-
// Log specific, non-sensitive values
|
|
248
|
-
console.log('Region:', process.env.AWS_REGION);
|
|
249
|
-
console.log('Environment:', process.env.NODE_ENV);
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
---
|
|
253
|
-
|
|
254
|
-
## ๐ Quick Start
|
|
255
|
-
|
|
256
|
-
### ESLint Flat Config (Recommended)
|
|
257
|
-
|
|
258
|
-
```javascript
|
|
259
|
-
// eslint.config.js
|
|
260
|
-
import lambdaSecurity from 'eslint-plugin-lambda-security';
|
|
261
|
-
|
|
262
|
-
export default [
|
|
263
|
-
lambdaSecurity.configs.recommended,
|
|
264
|
-
// ... other configs
|
|
265
|
-
];
|
|
266
|
-
```
|
|
267
|
-
|
|
268
|
-
### Strict Mode
|
|
269
|
-
|
|
270
|
-
```javascript
|
|
271
|
-
import lambdaSecurity from 'eslint-plugin-lambda-security';
|
|
272
|
-
|
|
273
|
-
export default [lambdaSecurity.configs.strict];
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
---
|
|
277
|
-
|
|
278
|
-
## ๐ Available Presets
|
|
279
|
-
|
|
280
|
-
| Preset | Description |
|
|
281
|
-
| ----------------- | ---------------------------------------------------------------------- |
|
|
282
|
-
| **`recommended`** | Balanced security for Lambda projects (critical as error, others warn) |
|
|
283
|
-
| **`strict`** | Maximum security enforcement (all rules as errors) |
|
|
73
|
+
| Library | npm | Downloads | Detection |
|
|
74
|
+
| :----------------------- | :---------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------- |
|
|
75
|
+
| `aws-lambda` | [](https://www.npmjs.com/package/aws-lambda) | [](https://www.npmjs.com/package/aws-lambda) | IAM, Logging, Timeouts |
|
|
76
|
+
| `@aws-sdk/client-lambda` | [](https://www.npmjs.com/package/@aws-sdk/client-lambda) | [](https://www.npmjs.com/package/@aws-sdk/client-lambda) | Credential Safety |
|
|
77
|
+
| `middy` | [](https://www.npmjs.com/package/@middy/core) | [](https://www.npmjs.com/package/@middy/core) | Middleware Security |
|
|
284
78
|
|
|
285
79
|
---
|
|
286
80
|
|
|
@@ -324,7 +118,37 @@ export default [
|
|
|
324
118
|
|
|
325
119
|
---
|
|
326
120
|
|
|
327
|
-
##
|
|
121
|
+
## Rules
|
|
122
|
+
|
|
123
|
+
**Legend**
|
|
124
|
+
|
|
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
|
|
328
152
|
|
|
329
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:
|
|
330
154
|
|
|
@@ -332,6 +156,12 @@ This plugin is optimized for ESLint's [Model Context Protocol (MCP)](https://esl
|
|
|
332
156
|
- Apply the correct fix using structured guidance
|
|
333
157
|
- Provide educational context to developers
|
|
334
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
|
+
|
|
335
165
|
```json
|
|
336
166
|
// .cursor/mcp.json
|
|
337
167
|
{
|
|
@@ -344,31 +174,34 @@ This plugin is optimized for ESLint's [Model Context Protocol (MCP)](https://esl
|
|
|
344
174
|
}
|
|
345
175
|
```
|
|
346
176
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
## ๐ Related ESLint Plugins
|
|
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.
|
|
350
178
|
|
|
351
|
-
Part of the **Interlace ESLint Ecosystem** โ AI-native security plugins with LLM-optimized error messages:
|
|
352
|
-
|
|
353
|
-
| Plugin | Downloads | Description | Rule | CWE | OWASP | CVSS | Description | ๐ผ | โ ๏ธ | ๐ง | ๐ก | ๐ซ |
|
|
354
|
-
| :--- | :---: | :---: | :---: | :--- | :---: | :---: | :---: | :---: | :---: |
|
|
355
|
-
| [`eslint-plugin-secure-coding`](https://www.npmjs.com/package/eslint-plugin-secure-coding) | | | | | | | | | |
|
|
356
|
-
| [`eslint-plugin-express-security`](https://www.npmjs.com/package/eslint-plugin-express-security) | | | | | | | | | |
|
|
357
|
-
| [`eslint-plugin-nestjs-security`](https://www.npmjs.com/package/eslint-plugin-nestjs-security) | | | | | | | | | |
|
|
358
|
-
| [`eslint-plugin-browser-security`](https://www.npmjs.com/package/eslint-plugin-browser-security) | | | | | | | | | |
|
|
359
|
-
| [`eslint-plugin-jwt`](https://www.npmjs.com/package/eslint-plugin-jwt) | | | | | | | | | |
|
|
360
|
-
| [`eslint-plugin-crypto`](https://www.npmjs.com/package/eslint-plugin-crypto) | | | | | | | | | |
|
|
361
|
-
| [`eslint-plugin-pg`](https://www.npmjs.com/package/eslint-plugin-pg) | | | | | | | | | |
|
|
362
|
-
| [`eslint-plugin-vercel-ai-security`](https://www.npmjs.com/package/eslint-plugin-vercel-ai-security) | | | | | | | | | |
|
|
363
|
-
| [`eslint-plugin-import-next`](https://www.npmjs.com/package/eslint-plugin-import-next) | | | | | | | | | |
|
|
364
179
|
---
|
|
365
180
|
|
|
366
181
|
## ๐ Privacy
|
|
367
182
|
|
|
368
183
|
This plugin runs **100% locally**. No data ever leaves your machine.
|
|
369
184
|
|
|
370
|
-
|
|
185
|
+
## ๐ Related ESLint Plugins
|
|
186
|
+
|
|
187
|
+
Part of the **Interlace ESLint Ecosystem** โ AI-native security plugins with LLM-optimized error messages:
|
|
188
|
+
|
|
189
|
+
| Plugin | Downloads | Description |
|
|
190
|
+
| :--------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------ |
|
|
191
|
+
| [`eslint-plugin-secure-coding`](https://www.npmjs.com/package/eslint-plugin-secure-coding) | [](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) | [](https://www.npmjs.com/package/eslint-plugin-pg) | PostgreSQL security & best practices. |
|
|
193
|
+
| [`eslint-plugin-crypto`](https://www.npmjs.com/package/eslint-plugin-crypto) | [](https://www.npmjs.com/package/eslint-plugin-crypto) | NodeJS Cryptography security rules. |
|
|
194
|
+
| [`eslint-plugin-jwt`](https://www.npmjs.com/package/eslint-plugin-jwt) | [](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) | [](https://www.npmjs.com/package/eslint-plugin-browser-security) | Browser-specific security & XSS prevention. |
|
|
196
|
+
| [`eslint-plugin-vercel-ai-security`](https://www.npmjs.com/package/eslint-plugin-vercel-ai-security) | [](https://www.npmjs.com/package/eslint-plugin-vercel-ai-security) | Vercel AI SDK security rules. |
|
|
197
|
+
| [`eslint-plugin-express-security`](https://www.npmjs.com/package/eslint-plugin-express-security) | [](https://www.npmjs.com/package/eslint-plugin-express-security) | Express.js security hardening rules. |
|
|
198
|
+
| [`eslint-plugin-nestjs-security`](https://www.npmjs.com/package/eslint-plugin-nestjs-security) | [](https://www.npmjs.com/package/eslint-plugin-nestjs-security) | NestJS security rules & patterns. |
|
|
199
|
+
| [`eslint-plugin-import-next`](https://www.npmjs.com/package/eslint-plugin-import-next) | [](https://www.npmjs.com/package/eslint-plugin-import-next) | Next-gen import sorting & architecture. |
|
|
371
200
|
|
|
372
201
|
## ๐ License
|
|
373
202
|
|
|
374
203
|
MIT ยฉ [Ofri Peretz](https://github.com/ofri-peretz)
|
|
204
|
+
|
|
205
|
+
<p align="center">
|
|
206
|
+
<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>
|
|
207
|
+
</p>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-lambda-security",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.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",
|