eslint-plugin-lambda-security 1.0.3 → 1.1.0
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 +48 -50
- package/package.json +1 -1
- package/src/index.d.ts +42 -57
- package/src/index.js +5 -0
- package/src/rules/no-env-logging/index.d.ts +17 -1
- package/src/rules/no-env-logging/index.js +5 -0
- package/src/rules/no-error-swallowing/index.d.ts +18 -1
- package/src/rules/no-error-swallowing/index.js +10 -1
- package/src/rules/no-exposed-error-details/index.d.ts +18 -1
- package/src/rules/no-exposed-error-details/index.js +5 -1
- package/src/rules/no-hardcoded-credentials-sdk/index.d.ts +18 -1
- package/src/rules/no-hardcoded-credentials-sdk/index.js +5 -0
- package/src/rules/no-missing-authorization-check/index.d.ts +18 -1
- package/src/rules/no-missing-authorization-check/index.js +5 -1
- package/src/rules/no-overly-permissive-iam-policy/index.d.ts +18 -1
- package/src/rules/no-overly-permissive-iam-policy/index.js +5 -1
- package/src/rules/no-permissive-cors-middy/index.d.ts +18 -1
- package/src/rules/no-permissive-cors-middy/index.js +5 -0
- package/src/rules/no-permissive-cors-response/index.d.ts +18 -1
- package/src/rules/no-permissive-cors-response/index.js +5 -0
- package/src/rules/no-secrets-in-env/index.d.ts +18 -1
- package/src/rules/no-secrets-in-env/index.js +5 -0
- package/src/rules/no-unbounded-batch-processing/index.d.ts +18 -1
- package/src/rules/no-unbounded-batch-processing/index.js +5 -1
- package/src/rules/no-unvalidated-event-body/index.d.ts +18 -1
- package/src/rules/no-unvalidated-event-body/index.js +5 -1
- package/src/rules/no-user-controlled-requests/index.d.ts +18 -1
- package/src/rules/no-user-controlled-requests/index.js +5 -1
- package/src/rules/require-timeout-handling/index.d.ts +18 -1
- package/src/rules/require-timeout-handling/index.js +5 -1
package/README.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# eslint-plugin-lambda-security
|
|
2
2
|
|
|
3
|
+
<div align="center">
|
|
4
|
+
<img src="https://eslint.interlace.tools/images/interlace-hero.png" alt="ESLint Interlace - eslint-plugin-lambda-security" width="100%" />
|
|
5
|
+
</div>
|
|
6
|
+
|
|
3
7
|
> 🔐 Security-focused ESLint plugin for AWS Lambda and serverless applications. Detects hardcoded credentials, permissive CORS, environment secrets, and logging issues with AI-optimized fix guidance.
|
|
4
8
|
|
|
5
9
|
[](https://www.npmjs.com/package/eslint-plugin-lambda-security)
|
|
@@ -43,19 +47,18 @@ src/handlers/api.ts
|
|
|
43
47
|
|
|
44
48
|
## 📊 OWASP Serverless Top 10 Coverage Matrix
|
|
45
49
|
|
|
46
|
-
| OWASP Category | Coverage |
|
|
47
|
-
|
|
|
48
|
-
| **SAS-1: Injection**
|
|
49
|
-
| **SAS-2: Broken Authentication**
|
|
50
|
-
| **SAS-3: Sensitive Data Exposure**
|
|
51
|
-
| **SAS-4: Security Misconfiguration**
|
|
52
|
-
| **SAS-5: Broken Access Control**
|
|
53
|
-
| **SAS-6: Insufficient Logging**
|
|
54
|
-
| **SAS-7: Denial of Service**
|
|
55
|
-
| **SAS-8: Server-Side Request Forgery** |
|
|
56
|
-
| **SAS-9: Functions Misconfiguration** |
|
|
57
|
-
| **SAS-10: Improper Crypto**
|
|
58
|
-
|
|
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** | | | | | | | | | |
|
|
59
62
|
---
|
|
60
63
|
|
|
61
64
|
## 🔐 13 Security Rules
|
|
@@ -64,37 +67,33 @@ src/handlers/api.ts
|
|
|
64
67
|
|
|
65
68
|
### Credential & Secrets Protection (3 rules)
|
|
66
69
|
|
|
67
|
-
| Rule
|
|
68
|
-
|
|
|
69
|
-
| [no-hardcoded-credentials-sdk](#no-hardcoded-credentials-sdk) | CWE-798 | SAS-2 | 9.8
|
|
70
|
-
| [no-secrets-in-env](#no-secrets-in-env)
|
|
71
|
-
| [no-env-logging](#no-env-logging)
|
|
72
|
-
|
|
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 | | ⚠️ | | | |
|
|
73
75
|
### CORS Security (2 rules)
|
|
74
76
|
|
|
75
|
-
| Rule
|
|
76
|
-
|
|
|
77
|
-
| [no-permissive-cors-response](#no-permissive-cors-response) | CWE-942 | SAS-4 | 9.1
|
|
78
|
-
| [no-permissive-cors-middy](#no-permissive-cors-middy)
|
|
79
|
-
|
|
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 | 💼 | | | | |
|
|
80
81
|
### Input Validation & Access Control (4 rules)
|
|
81
82
|
|
|
82
|
-
| Rule
|
|
83
|
-
|
|
|
84
|
-
| no-unvalidated-event-body
|
|
85
|
-
| no-missing-authorization-check
|
|
86
|
-
| no-overly-permissive-iam-policy | CWE-732 | SAS-5 | 6.5
|
|
87
|
-
| no-user-controlled-requests
|
|
88
|
-
|
|
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
89
|
### Security Operations (4 rules)
|
|
90
90
|
|
|
91
|
-
| Rule
|
|
92
|
-
|
|
|
93
|
-
| no-error-swallowing
|
|
94
|
-
| require-timeout-handling
|
|
95
|
-
| no-unbounded-batch-processing | CWE-770 | SAS-7 | 5.5
|
|
96
|
-
| no-exposed-error-details
|
|
97
|
-
|
|
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 | | ⚠️ | | 💡 | |
|
|
98
97
|
---
|
|
99
98
|
|
|
100
99
|
## 🔍 Rule Details
|
|
@@ -351,18 +350,17 @@ This plugin is optimized for ESLint's [Model Context Protocol (MCP)](https://esl
|
|
|
351
350
|
|
|
352
351
|
Part of the **Interlace ESLint Ecosystem** — AI-native security plugins with LLM-optimized error messages:
|
|
353
352
|
|
|
354
|
-
| Plugin | Downloads | Description |
|
|
355
|
-
|
|
|
356
|
-
| [`eslint-plugin-secure-coding`](https://www.npmjs.com/package/eslint-plugin-secure-coding)
|
|
357
|
-
| [`eslint-plugin-express-security`](https://www.npmjs.com/package/eslint-plugin-express-security)
|
|
358
|
-
| [`eslint-plugin-nestjs-security`](https://www.npmjs.com/package/eslint-plugin-nestjs-security)
|
|
359
|
-
| [`eslint-plugin-browser-security`](https://www.npmjs.com/package/eslint-plugin-browser-security)
|
|
360
|
-
| [`eslint-plugin-jwt`](https://www.npmjs.com/package/eslint-plugin-jwt)
|
|
361
|
-
| [`eslint-plugin-crypto`](https://www.npmjs.com/package/eslint-plugin-crypto)
|
|
362
|
-
| [`eslint-plugin-pg`](https://www.npmjs.com/package/eslint-plugin-pg)
|
|
363
|
-
| [`eslint-plugin-vercel-ai-security`](https://www.npmjs.com/package/eslint-plugin-vercel-ai-security) |
|
|
364
|
-
| [`eslint-plugin-import-next`](https://www.npmjs.com/package/eslint-plugin-import-next)
|
|
365
|
-
|
|
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) | | | | | | | | | |
|
|
366
364
|
---
|
|
367
365
|
|
|
368
366
|
## 🔒 Privacy
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-lambda-security",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
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",
|
package/src/index.d.ts
CHANGED
|
@@ -1,38 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* Detects insecure API Gateway responses, missing security headers,
|
|
6
|
-
* CORS misconfigurations, input validation issues, authorization gaps,
|
|
7
|
-
* SSRF vulnerabilities, and more.
|
|
8
|
-
*
|
|
9
|
-
* OWASP Serverless Top 10 Coverage:
|
|
10
|
-
* - SAS-1: Injection ✅ (no-unvalidated-event-body)
|
|
11
|
-
* - SAS-2: Broken Authentication ✅ (no-hardcoded-credentials-sdk)
|
|
12
|
-
* - SAS-3: Sensitive Data Exposure ✅ (no-env-logging, no-secrets-in-env)
|
|
13
|
-
* - SAS-4: Security Misconfiguration ✅ (no-permissive-cors-*)
|
|
14
|
-
* - SAS-5: Broken Access Control ✅ (no-missing-authorization-check, no-overly-permissive-iam-policy)
|
|
15
|
-
* - SAS-6: Insufficient Logging ✅ (no-error-swallowing)
|
|
16
|
-
* - SAS-7: Denial of Service ✅ (require-timeout-handling, no-unbounded-batch-processing)
|
|
17
|
-
* - SAS-8: Server-Side Request Forgery ✅ (no-user-controlled-requests)
|
|
18
|
-
* - SAS-9: Functions Misconfiguration ✅ (no-exposed-error-details)
|
|
19
|
-
* - SAS-10: Improper Crypto ➡️ (Use eslint-plugin-crypto)
|
|
2
|
+
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
+
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
+
* MIT license that can be found in the LICENSE file.
|
|
20
5
|
*/
|
|
21
6
|
declare const _default: {
|
|
22
7
|
rules: {
|
|
23
|
-
'no-hardcoded-credentials-sdk':
|
|
24
|
-
'no-permissive-cors-response':
|
|
25
|
-
'no-permissive-cors-middy':
|
|
26
|
-
'no-secrets-in-env':
|
|
27
|
-
'no-env-logging':
|
|
28
|
-
'no-unvalidated-event-body':
|
|
29
|
-
'no-missing-authorization-check':
|
|
30
|
-
'no-overly-permissive-iam-policy':
|
|
31
|
-
'no-error-swallowing':
|
|
32
|
-
'require-timeout-handling':
|
|
33
|
-
'no-unbounded-batch-processing':
|
|
34
|
-
'no-user-controlled-requests':
|
|
35
|
-
'no-exposed-error-details':
|
|
8
|
+
'no-hardcoded-credentials-sdk': import("@typescript-eslint/utils/ts-eslint").RuleModule<"hardcodedCredentials" | "useCredentialProvider", [import("./rules/no-hardcoded-credentials-sdk").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
9
|
+
'no-permissive-cors-response': import("@typescript-eslint/utils/ts-eslint").RuleModule<"permissiveCors" | "useSpecificOrigin", [import("./rules/no-permissive-cors-response").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
10
|
+
'no-permissive-cors-middy': import("@typescript-eslint/utils/ts-eslint").RuleModule<"permissiveCors" | "useSpecificOrigins", [import("./rules/no-permissive-cors-middy").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
11
|
+
'no-secrets-in-env': import("@typescript-eslint/utils/ts-eslint").RuleModule<"secretsInEnv" | "useSecretsManager", [import("./rules/no-secrets-in-env").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
12
|
+
'no-env-logging': import("@typescript-eslint/utils/ts-eslint").RuleModule<"envLogging" | "removeEnvLogging", [import("./rules/no-env-logging").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
13
|
+
'no-unvalidated-event-body': import("@typescript-eslint/utils/ts-eslint").RuleModule<"unvalidatedInput" | "useValidation", [import("./rules/no-unvalidated-event-body").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
14
|
+
'no-missing-authorization-check': import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingAuthCheck" | "addAuthCheck", [import("./rules/no-missing-authorization-check").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
15
|
+
'no-overly-permissive-iam-policy': import("@typescript-eslint/utils/ts-eslint").RuleModule<"permissivePolicy" | "useLeastPrivilege", [import("./rules/no-overly-permissive-iam-policy").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
16
|
+
'no-error-swallowing': import("@typescript-eslint/utils/ts-eslint").RuleModule<"emptyCatchBlock" | "addErrorLogging", [import("./rules/no-error-swallowing").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
17
|
+
'require-timeout-handling': import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingTimeoutHandling" | "addTimeoutCheck", [import("./rules/require-timeout-handling").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
18
|
+
'no-unbounded-batch-processing': import("@typescript-eslint/utils/ts-eslint").RuleModule<"unboundedBatch" | "addBatchLimit", [import("./rules/no-unbounded-batch-processing").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
19
|
+
'no-user-controlled-requests': import("@typescript-eslint/utils/ts-eslint").RuleModule<"ssrfVulnerability" | "useAllowlist", [import("./rules/no-user-controlled-requests").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
20
|
+
'no-exposed-error-details': import("@typescript-eslint/utils/ts-eslint").RuleModule<"exposedErrorDetails" | "sanitizeError", [import("./rules/no-exposed-error-details").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
36
21
|
};
|
|
37
22
|
configs: {
|
|
38
23
|
recommended: {
|
|
@@ -40,19 +25,19 @@ declare const _default: {
|
|
|
40
25
|
plugins: {
|
|
41
26
|
'lambda-security': {
|
|
42
27
|
rules: {
|
|
43
|
-
'no-hardcoded-credentials-sdk':
|
|
44
|
-
'no-permissive-cors-response':
|
|
45
|
-
'no-permissive-cors-middy':
|
|
46
|
-
'no-secrets-in-env':
|
|
47
|
-
'no-env-logging':
|
|
48
|
-
'no-unvalidated-event-body':
|
|
49
|
-
'no-missing-authorization-check':
|
|
50
|
-
'no-overly-permissive-iam-policy':
|
|
51
|
-
'no-error-swallowing':
|
|
52
|
-
'require-timeout-handling':
|
|
53
|
-
'no-unbounded-batch-processing':
|
|
54
|
-
'no-user-controlled-requests':
|
|
55
|
-
'no-exposed-error-details':
|
|
28
|
+
'no-hardcoded-credentials-sdk': import("@typescript-eslint/utils/ts-eslint").RuleModule<"hardcodedCredentials" | "useCredentialProvider", [import("./rules/no-hardcoded-credentials-sdk").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
29
|
+
'no-permissive-cors-response': import("@typescript-eslint/utils/ts-eslint").RuleModule<"permissiveCors" | "useSpecificOrigin", [import("./rules/no-permissive-cors-response").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
30
|
+
'no-permissive-cors-middy': import("@typescript-eslint/utils/ts-eslint").RuleModule<"permissiveCors" | "useSpecificOrigins", [import("./rules/no-permissive-cors-middy").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
31
|
+
'no-secrets-in-env': import("@typescript-eslint/utils/ts-eslint").RuleModule<"secretsInEnv" | "useSecretsManager", [import("./rules/no-secrets-in-env").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
32
|
+
'no-env-logging': import("@typescript-eslint/utils/ts-eslint").RuleModule<"envLogging" | "removeEnvLogging", [import("./rules/no-env-logging").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
33
|
+
'no-unvalidated-event-body': import("@typescript-eslint/utils/ts-eslint").RuleModule<"unvalidatedInput" | "useValidation", [import("./rules/no-unvalidated-event-body").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
34
|
+
'no-missing-authorization-check': import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingAuthCheck" | "addAuthCheck", [import("./rules/no-missing-authorization-check").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
35
|
+
'no-overly-permissive-iam-policy': import("@typescript-eslint/utils/ts-eslint").RuleModule<"permissivePolicy" | "useLeastPrivilege", [import("./rules/no-overly-permissive-iam-policy").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
36
|
+
'no-error-swallowing': import("@typescript-eslint/utils/ts-eslint").RuleModule<"emptyCatchBlock" | "addErrorLogging", [import("./rules/no-error-swallowing").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
37
|
+
'require-timeout-handling': import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingTimeoutHandling" | "addTimeoutCheck", [import("./rules/require-timeout-handling").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
38
|
+
'no-unbounded-batch-processing': import("@typescript-eslint/utils/ts-eslint").RuleModule<"unboundedBatch" | "addBatchLimit", [import("./rules/no-unbounded-batch-processing").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
39
|
+
'no-user-controlled-requests': import("@typescript-eslint/utils/ts-eslint").RuleModule<"ssrfVulnerability" | "useAllowlist", [import("./rules/no-user-controlled-requests").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
40
|
+
'no-exposed-error-details': import("@typescript-eslint/utils/ts-eslint").RuleModule<"exposedErrorDetails" | "sanitizeError", [import("./rules/no-exposed-error-details").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
56
41
|
};
|
|
57
42
|
};
|
|
58
43
|
};
|
|
@@ -77,19 +62,19 @@ declare const _default: {
|
|
|
77
62
|
plugins: {
|
|
78
63
|
'lambda-security': {
|
|
79
64
|
rules: {
|
|
80
|
-
'no-hardcoded-credentials-sdk':
|
|
81
|
-
'no-permissive-cors-response':
|
|
82
|
-
'no-permissive-cors-middy':
|
|
83
|
-
'no-secrets-in-env':
|
|
84
|
-
'no-env-logging':
|
|
85
|
-
'no-unvalidated-event-body':
|
|
86
|
-
'no-missing-authorization-check':
|
|
87
|
-
'no-overly-permissive-iam-policy':
|
|
88
|
-
'no-error-swallowing':
|
|
89
|
-
'require-timeout-handling':
|
|
90
|
-
'no-unbounded-batch-processing':
|
|
91
|
-
'no-user-controlled-requests':
|
|
92
|
-
'no-exposed-error-details':
|
|
65
|
+
'no-hardcoded-credentials-sdk': import("@typescript-eslint/utils/ts-eslint").RuleModule<"hardcodedCredentials" | "useCredentialProvider", [import("./rules/no-hardcoded-credentials-sdk").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
66
|
+
'no-permissive-cors-response': import("@typescript-eslint/utils/ts-eslint").RuleModule<"permissiveCors" | "useSpecificOrigin", [import("./rules/no-permissive-cors-response").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
67
|
+
'no-permissive-cors-middy': import("@typescript-eslint/utils/ts-eslint").RuleModule<"permissiveCors" | "useSpecificOrigins", [import("./rules/no-permissive-cors-middy").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
68
|
+
'no-secrets-in-env': import("@typescript-eslint/utils/ts-eslint").RuleModule<"secretsInEnv" | "useSecretsManager", [import("./rules/no-secrets-in-env").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
69
|
+
'no-env-logging': import("@typescript-eslint/utils/ts-eslint").RuleModule<"envLogging" | "removeEnvLogging", [import("./rules/no-env-logging").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
70
|
+
'no-unvalidated-event-body': import("@typescript-eslint/utils/ts-eslint").RuleModule<"unvalidatedInput" | "useValidation", [import("./rules/no-unvalidated-event-body").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
71
|
+
'no-missing-authorization-check': import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingAuthCheck" | "addAuthCheck", [import("./rules/no-missing-authorization-check").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
72
|
+
'no-overly-permissive-iam-policy': import("@typescript-eslint/utils/ts-eslint").RuleModule<"permissivePolicy" | "useLeastPrivilege", [import("./rules/no-overly-permissive-iam-policy").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
73
|
+
'no-error-swallowing': import("@typescript-eslint/utils/ts-eslint").RuleModule<"emptyCatchBlock" | "addErrorLogging", [import("./rules/no-error-swallowing").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
74
|
+
'require-timeout-handling': import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingTimeoutHandling" | "addTimeoutCheck", [import("./rules/require-timeout-handling").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
75
|
+
'no-unbounded-batch-processing': import("@typescript-eslint/utils/ts-eslint").RuleModule<"unboundedBatch" | "addBatchLimit", [import("./rules/no-unbounded-batch-processing").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
76
|
+
'no-user-controlled-requests': import("@typescript-eslint/utils/ts-eslint").RuleModule<"ssrfVulnerability" | "useAllowlist", [import("./rules/no-user-controlled-requests").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
77
|
+
'no-exposed-error-details': import("@typescript-eslint/utils/ts-eslint").RuleModule<"exposedErrorDetails" | "sanitizeError", [import("./rules/no-exposed-error-details").Options?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
93
78
|
};
|
|
94
79
|
};
|
|
95
80
|
};
|
package/src/index.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2025 Ofri Peretz
|
|
4
|
+
* Licensed under the MIT License. Use of this source code is governed by the
|
|
5
|
+
* MIT license that can be found in the LICENSE file.
|
|
6
|
+
*/
|
|
2
7
|
/**
|
|
3
8
|
* eslint-plugin-lambda-security
|
|
4
9
|
* Security-focused ESLint rules for AWS Lambda and Middy applications
|
|
@@ -1,5 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
+
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
+
* MIT license that can be found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* ESLint Rule: no-env-logging
|
|
8
|
+
* Detects logging of environment variables which may contain secrets
|
|
9
|
+
* CWE-532: Insertion of Sensitive Information into Log File
|
|
10
|
+
*
|
|
11
|
+
* @see https://cwe.mitre.org/data/definitions/532.html
|
|
12
|
+
*/
|
|
13
|
+
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
14
|
+
type MessageIds = 'envLogging' | 'removeEnvLogging';
|
|
1
15
|
export interface Options {
|
|
2
16
|
/** Allow in test files. Default: true */
|
|
3
17
|
allowInTests?: boolean;
|
|
4
18
|
}
|
|
5
|
-
|
|
19
|
+
type RuleOptions = [Options?];
|
|
20
|
+
export declare const noEnvLogging: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener>;
|
|
21
|
+
export {};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2025 Ofri Peretz
|
|
4
|
+
* Licensed under the MIT License. Use of this source code is governed by the
|
|
5
|
+
* MIT license that can be found in the LICENSE file.
|
|
6
|
+
*/
|
|
2
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
8
|
exports.noEnvLogging = void 0;
|
|
4
9
|
const eslint_devkit_1 = require("@interlace/eslint-devkit");
|
|
@@ -1,7 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
+
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
+
* MIT license that can be found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* ESLint Rule: no-error-swallowing
|
|
8
|
+
* Detects empty catch blocks and missing error logging
|
|
9
|
+
* CWE-390: Detection of Error Condition Without Action
|
|
10
|
+
*
|
|
11
|
+
* @see https://cwe.mitre.org/data/definitions/390.html
|
|
12
|
+
* @see https://owasp.org/www-project-serverless-top-10/
|
|
13
|
+
*/
|
|
14
|
+
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
15
|
+
type MessageIds = 'emptyCatchBlock' | 'addErrorLogging';
|
|
1
16
|
export interface Options {
|
|
2
17
|
/** Allow in test files. Default: true */
|
|
3
18
|
allowInTests?: boolean;
|
|
4
19
|
/** Allow comments as documentation of intentional swallowing. Default: true */
|
|
5
20
|
allowWithComment?: boolean;
|
|
6
21
|
}
|
|
7
|
-
|
|
22
|
+
type RuleOptions = [Options?];
|
|
23
|
+
export declare const noErrorSwallowing: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener>;
|
|
24
|
+
export {};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2025 Ofri Peretz
|
|
4
|
+
* Licensed under the MIT License. Use of this source code is governed by the
|
|
5
|
+
* MIT license that can be found in the LICENSE file.
|
|
6
|
+
*/
|
|
2
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
8
|
exports.noErrorSwallowing = void 0;
|
|
4
9
|
const eslint_devkit_1 = require("@interlace/eslint-devkit");
|
|
@@ -92,7 +97,11 @@ exports.noErrorSwallowing = (0, eslint_devkit_1.createRule)({
|
|
|
92
97
|
}
|
|
93
98
|
else if (Array.isArray(child)) {
|
|
94
99
|
for (const item of child) {
|
|
95
|
-
|
|
100
|
+
// Use Object.prototype.hasOwnProperty to avoid 'in' operator narrowing issues
|
|
101
|
+
if (item !== null &&
|
|
102
|
+
item !== undefined &&
|
|
103
|
+
typeof item === 'object' &&
|
|
104
|
+
Object.prototype.hasOwnProperty.call(item, 'type')) {
|
|
96
105
|
checkNode(item);
|
|
97
106
|
}
|
|
98
107
|
}
|
|
@@ -1,5 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
+
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
+
* MIT license that can be found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* ESLint Rule: no-exposed-error-details
|
|
8
|
+
* Detects Lambda handlers exposing internal error details
|
|
9
|
+
* CWE-209: Generation of Error Message Containing Sensitive Information
|
|
10
|
+
*
|
|
11
|
+
* @see https://cwe.mitre.org/data/definitions/209.html
|
|
12
|
+
* @see https://owasp.org/www-project-serverless-top-10/
|
|
13
|
+
*/
|
|
14
|
+
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
15
|
+
type MessageIds = 'exposedErrorDetails' | 'sanitizeError';
|
|
1
16
|
export interface Options {
|
|
2
17
|
/** Allow in test files. Default: true */
|
|
3
18
|
allowInTests?: boolean;
|
|
4
19
|
}
|
|
5
|
-
|
|
20
|
+
type RuleOptions = [Options?];
|
|
21
|
+
export declare const noExposedErrorDetails: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener>;
|
|
22
|
+
export {};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2025 Ofri Peretz
|
|
4
|
+
* Licensed under the MIT License. Use of this source code is governed by the
|
|
5
|
+
* MIT license that can be found in the LICENSE file.
|
|
6
|
+
*/
|
|
2
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
8
|
exports.noExposedErrorDetails = void 0;
|
|
4
9
|
const eslint_devkit_1 = require("@interlace/eslint-devkit");
|
|
@@ -28,7 +33,6 @@ exports.noExposedErrorDetails = (0, eslint_devkit_1.createRule)({
|
|
|
28
33
|
icon: eslint_devkit_1.MessageIcons.SECURITY,
|
|
29
34
|
issueName: 'Exposed Error Details',
|
|
30
35
|
cwe: 'CWE-209',
|
|
31
|
-
owasp: 'SAS-9',
|
|
32
36
|
cvss: 4.3,
|
|
33
37
|
description: 'Response exposes {{property}} which may leak internal paths, configs, or stack traces.',
|
|
34
38
|
severity: 'MEDIUM',
|
|
@@ -1,5 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
+
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
+
* MIT license that can be found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* ESLint Rule: no-hardcoded-credentials-sdk
|
|
8
|
+
* Detects hardcoded AWS credentials in SDK client configurations
|
|
9
|
+
* CWE-798: Use of Hard-coded Credentials
|
|
10
|
+
*
|
|
11
|
+
* @see https://cwe.mitre.org/data/definitions/798.html
|
|
12
|
+
* @see https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/loading-browser-credentials-browser.html
|
|
13
|
+
*/
|
|
14
|
+
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
15
|
+
type MessageIds = 'hardcodedCredentials' | 'useCredentialProvider';
|
|
1
16
|
export interface Options {
|
|
2
17
|
/** Allow in test files. Default: true */
|
|
3
18
|
allowInTests?: boolean;
|
|
4
19
|
}
|
|
5
|
-
|
|
20
|
+
type RuleOptions = [Options?];
|
|
21
|
+
export declare const noHardcodedCredentialsSdk: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener>;
|
|
22
|
+
export {};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2025 Ofri Peretz
|
|
4
|
+
* Licensed under the MIT License. Use of this source code is governed by the
|
|
5
|
+
* MIT license that can be found in the LICENSE file.
|
|
6
|
+
*/
|
|
2
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
8
|
exports.noHardcodedCredentialsSdk = void 0;
|
|
4
9
|
const eslint_devkit_1 = require("@interlace/eslint-devkit");
|
|
@@ -1,7 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
+
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
+
* MIT license that can be found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* ESLint Rule: no-missing-authorization-check
|
|
8
|
+
* Detects Lambda handlers without authorization checks
|
|
9
|
+
* CWE-862: Missing Authorization
|
|
10
|
+
*
|
|
11
|
+
* @see https://cwe.mitre.org/data/definitions/862.html
|
|
12
|
+
* @see https://owasp.org/www-project-serverless-top-10/
|
|
13
|
+
*/
|
|
14
|
+
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
15
|
+
type MessageIds = 'missingAuthCheck' | 'addAuthCheck';
|
|
1
16
|
export interface Options {
|
|
2
17
|
/** Allow in test files. Default: true */
|
|
3
18
|
allowInTests?: boolean;
|
|
4
19
|
/** Handler file patterns to check. Default: common Lambda patterns */
|
|
5
20
|
handlerPatterns?: string[];
|
|
6
21
|
}
|
|
7
|
-
|
|
22
|
+
type RuleOptions = [Options?];
|
|
23
|
+
export declare const noMissingAuthorizationCheck: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener>;
|
|
24
|
+
export {};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2025 Ofri Peretz
|
|
4
|
+
* Licensed under the MIT License. Use of this source code is governed by the
|
|
5
|
+
* MIT license that can be found in the LICENSE file.
|
|
6
|
+
*/
|
|
2
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
8
|
exports.noMissingAuthorizationCheck = void 0;
|
|
4
9
|
const eslint_devkit_1 = require("@interlace/eslint-devkit");
|
|
@@ -56,7 +61,6 @@ exports.noMissingAuthorizationCheck = (0, eslint_devkit_1.createRule)({
|
|
|
56
61
|
icon: eslint_devkit_1.MessageIcons.SECURITY,
|
|
57
62
|
issueName: 'Missing Authorization Check',
|
|
58
63
|
cwe: 'CWE-862',
|
|
59
|
-
owasp: 'SAS-5',
|
|
60
64
|
cvss: 7.5,
|
|
61
65
|
description: 'Lambda handler performs {{operation}} operation without authorization check. Users may access resources without proper permissions.',
|
|
62
66
|
severity: 'HIGH',
|
|
@@ -1,5 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
+
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
+
* MIT license that can be found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* ESLint Rule: no-overly-permissive-iam-policy
|
|
8
|
+
* Detects IAM policies with overly broad permissions
|
|
9
|
+
* CWE-732: Incorrect Permission Assignment for Critical Resource
|
|
10
|
+
*
|
|
11
|
+
* @see https://cwe.mitre.org/data/definitions/732.html
|
|
12
|
+
* @see https://owasp.org/www-project-serverless-top-10/
|
|
13
|
+
*/
|
|
14
|
+
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
15
|
+
type MessageIds = 'permissivePolicy' | 'useLeastPrivilege';
|
|
1
16
|
export interface Options {
|
|
2
17
|
/** Allow in test files. Default: true */
|
|
3
18
|
allowInTests?: boolean;
|
|
4
19
|
}
|
|
5
|
-
|
|
20
|
+
type RuleOptions = [Options?];
|
|
21
|
+
export declare const noOverlyPermissiveIamPolicy: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener>;
|
|
22
|
+
export {};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2025 Ofri Peretz
|
|
4
|
+
* Licensed under the MIT License. Use of this source code is governed by the
|
|
5
|
+
* MIT license that can be found in the LICENSE file.
|
|
6
|
+
*/
|
|
2
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
8
|
exports.noOverlyPermissiveIamPolicy = void 0;
|
|
4
9
|
const eslint_devkit_1 = require("@interlace/eslint-devkit");
|
|
@@ -19,7 +24,6 @@ exports.noOverlyPermissiveIamPolicy = (0, eslint_devkit_1.createRule)({
|
|
|
19
24
|
icon: eslint_devkit_1.MessageIcons.SECURITY,
|
|
20
25
|
issueName: 'Overly Permissive IAM Policy',
|
|
21
26
|
cwe: 'CWE-732',
|
|
22
|
-
owasp: 'SAS-5',
|
|
23
27
|
cvss: 6.5,
|
|
24
28
|
description: 'IAM policy has wildcard {{property}}: "{{value}}". Violates principle of least privilege.',
|
|
25
29
|
severity: 'HIGH',
|
|
@@ -1,5 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
+
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
+
* MIT license that can be found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* ESLint Rule: no-permissive-cors-middy
|
|
8
|
+
* Detects @middy/http-cors middleware with permissive origin configuration
|
|
9
|
+
* CWE-942: Permissive Cross-domain Policy with Untrusted Domains
|
|
10
|
+
*
|
|
11
|
+
* @see https://cwe.mitre.org/data/definitions/942.html
|
|
12
|
+
* @see https://middy.js.org/docs/middlewares/http-cors
|
|
13
|
+
*/
|
|
14
|
+
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
15
|
+
type MessageIds = 'permissiveCors' | 'useSpecificOrigins';
|
|
1
16
|
export interface Options {
|
|
2
17
|
/** Allow in test files. Default: true */
|
|
3
18
|
allowInTests?: boolean;
|
|
4
19
|
}
|
|
5
|
-
|
|
20
|
+
type RuleOptions = [Options?];
|
|
21
|
+
export declare const noPermissiveCorsMidly: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener>;
|
|
22
|
+
export {};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2025 Ofri Peretz
|
|
4
|
+
* Licensed under the MIT License. Use of this source code is governed by the
|
|
5
|
+
* MIT license that can be found in the LICENSE file.
|
|
6
|
+
*/
|
|
2
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
8
|
exports.noPermissiveCorsMidly = void 0;
|
|
4
9
|
const eslint_devkit_1 = require("@interlace/eslint-devkit");
|
|
@@ -1,7 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
+
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
+
* MIT license that can be found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* ESLint Rule: no-permissive-cors-response
|
|
8
|
+
* Detects `Access-Control-Allow-Origin: '*'` in Lambda response headers
|
|
9
|
+
* CWE-942: Permissive Cross-domain Policy with Untrusted Domains
|
|
10
|
+
*
|
|
11
|
+
* @see https://cwe.mitre.org/data/definitions/942.html
|
|
12
|
+
* @see https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-cors.html
|
|
13
|
+
*/
|
|
14
|
+
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
15
|
+
type MessageIds = 'permissiveCors' | 'useSpecificOrigin';
|
|
1
16
|
export interface Options {
|
|
2
17
|
/** Allow in test files. Default: true */
|
|
3
18
|
allowInTests?: boolean;
|
|
4
19
|
/** Allowed origins (patterns). Default: [] */
|
|
5
20
|
allowedOrigins?: string[];
|
|
6
21
|
}
|
|
7
|
-
|
|
22
|
+
type RuleOptions = [Options?];
|
|
23
|
+
export declare const noPermissiveCorsResponse: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener>;
|
|
24
|
+
export {};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2025 Ofri Peretz
|
|
4
|
+
* Licensed under the MIT License. Use of this source code is governed by the
|
|
5
|
+
* MIT license that can be found in the LICENSE file.
|
|
6
|
+
*/
|
|
2
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
8
|
exports.noPermissiveCorsResponse = void 0;
|
|
4
9
|
const eslint_devkit_1 = require("@interlace/eslint-devkit");
|
|
@@ -1,7 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
+
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
+
* MIT license that can be found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* ESLint Rule: no-secrets-in-env
|
|
8
|
+
* Detects secrets directly assigned to process.env or hardcoded in environment configurations
|
|
9
|
+
* CWE-798: Use of Hard-coded Credentials
|
|
10
|
+
*
|
|
11
|
+
* @see https://cwe.mitre.org/data/definitions/798.html
|
|
12
|
+
* @see https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html
|
|
13
|
+
*/
|
|
14
|
+
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
15
|
+
type MessageIds = 'secretsInEnv' | 'useSecretsManager';
|
|
1
16
|
export interface Options {
|
|
2
17
|
/** Allow in test files. Default: true */
|
|
3
18
|
allowInTests?: boolean;
|
|
4
19
|
/** Additional secret patterns to detect. Default: [] */
|
|
5
20
|
additionalPatterns?: string[];
|
|
6
21
|
}
|
|
7
|
-
|
|
22
|
+
type RuleOptions = [Options?];
|
|
23
|
+
export declare const noSecretsInEnv: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener>;
|
|
24
|
+
export {};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2025 Ofri Peretz
|
|
4
|
+
* Licensed under the MIT License. Use of this source code is governed by the
|
|
5
|
+
* MIT license that can be found in the LICENSE file.
|
|
6
|
+
*/
|
|
2
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
8
|
exports.noSecretsInEnv = void 0;
|
|
4
9
|
const eslint_devkit_1 = require("@interlace/eslint-devkit");
|
|
@@ -1,7 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
+
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
+
* MIT license that can be found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* ESLint Rule: no-unbounded-batch-processing
|
|
8
|
+
* Detects processing arrays/records without size limits
|
|
9
|
+
* CWE-770: Allocation of Resources Without Limits
|
|
10
|
+
*
|
|
11
|
+
* @see https://cwe.mitre.org/data/definitions/770.html
|
|
12
|
+
* @see https://owasp.org/www-project-serverless-top-10/
|
|
13
|
+
*/
|
|
14
|
+
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
15
|
+
type MessageIds = 'unboundedBatch' | 'addBatchLimit';
|
|
1
16
|
export interface Options {
|
|
2
17
|
/** Allow in test files. Default: true */
|
|
3
18
|
allowInTests?: boolean;
|
|
4
19
|
/** Maximum allowed batch size before warning. Default: 100 */
|
|
5
20
|
maxBatchSize?: number;
|
|
6
21
|
}
|
|
7
|
-
|
|
22
|
+
type RuleOptions = [Options?];
|
|
23
|
+
export declare const noUnboundedBatchProcessing: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener>;
|
|
24
|
+
export {};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2025 Ofri Peretz
|
|
4
|
+
* Licensed under the MIT License. Use of this source code is governed by the
|
|
5
|
+
* MIT license that can be found in the LICENSE file.
|
|
6
|
+
*/
|
|
2
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
8
|
exports.noUnboundedBatchProcessing = void 0;
|
|
4
9
|
const eslint_devkit_1 = require("@interlace/eslint-devkit");
|
|
@@ -24,7 +29,6 @@ exports.noUnboundedBatchProcessing = (0, eslint_devkit_1.createRule)({
|
|
|
24
29
|
icon: eslint_devkit_1.MessageIcons.WARNING,
|
|
25
30
|
issueName: 'Unbounded Batch Processing',
|
|
26
31
|
cwe: 'CWE-770',
|
|
27
|
-
owasp: 'SAS-7',
|
|
28
32
|
cvss: 5.5,
|
|
29
33
|
description: 'Processing {{source}} without size check. Large batches may cause timeout or memory exhaustion.',
|
|
30
34
|
severity: 'MEDIUM',
|
|
@@ -1,7 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
+
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
+
* MIT license that can be found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* ESLint Rule: no-unvalidated-event-body
|
|
8
|
+
* Detects Lambda handlers using event body/params without validation
|
|
9
|
+
* CWE-20: Improper Input Validation
|
|
10
|
+
*
|
|
11
|
+
* @see https://cwe.mitre.org/data/definitions/20.html
|
|
12
|
+
* @see https://owasp.org/www-project-serverless-top-10/
|
|
13
|
+
*/
|
|
14
|
+
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
15
|
+
type MessageIds = 'unvalidatedInput' | 'useValidation';
|
|
1
16
|
export interface Options {
|
|
2
17
|
/** Allow in test files. Default: true */
|
|
3
18
|
allowInTests?: boolean;
|
|
4
19
|
/** Additional event properties to check. Default: [] */
|
|
5
20
|
additionalProperties?: string[];
|
|
6
21
|
}
|
|
7
|
-
|
|
22
|
+
type RuleOptions = [Options?];
|
|
23
|
+
export declare const noUnvalidatedEventBody: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener>;
|
|
24
|
+
export {};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2025 Ofri Peretz
|
|
4
|
+
* Licensed under the MIT License. Use of this source code is governed by the
|
|
5
|
+
* MIT license that can be found in the LICENSE file.
|
|
6
|
+
*/
|
|
2
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
8
|
exports.noUnvalidatedEventBody = void 0;
|
|
4
9
|
const eslint_devkit_1 = require("@interlace/eslint-devkit");
|
|
@@ -41,7 +46,6 @@ exports.noUnvalidatedEventBody = (0, eslint_devkit_1.createRule)({
|
|
|
41
46
|
icon: eslint_devkit_1.MessageIcons.SECURITY,
|
|
42
47
|
issueName: 'Unvalidated Event Input',
|
|
43
48
|
cwe: 'CWE-20',
|
|
44
|
-
owasp: 'SAS-1',
|
|
45
49
|
cvss: 8.0,
|
|
46
50
|
description: 'Lambda handler uses {{property}} without validation. This can lead to injection attacks.',
|
|
47
51
|
severity: 'HIGH',
|
|
@@ -1,5 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
+
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
+
* MIT license that can be found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* ESLint Rule: no-user-controlled-requests
|
|
8
|
+
* Detects HTTP requests with user-controlled URLs (SSRF)
|
|
9
|
+
* CWE-918: Server-Side Request Forgery (SSRF)
|
|
10
|
+
*
|
|
11
|
+
* @see https://cwe.mitre.org/data/definitions/918.html
|
|
12
|
+
* @see https://owasp.org/www-community/attacks/Server_Side_Request_Forgery
|
|
13
|
+
*/
|
|
14
|
+
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
15
|
+
type MessageIds = 'ssrfVulnerability' | 'useAllowlist';
|
|
1
16
|
export interface Options {
|
|
2
17
|
/** Allow in test files. Default: true */
|
|
3
18
|
allowInTests?: boolean;
|
|
4
19
|
}
|
|
5
|
-
|
|
20
|
+
type RuleOptions = [Options?];
|
|
21
|
+
export declare const noUserControlledRequests: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener>;
|
|
22
|
+
export {};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2025 Ofri Peretz
|
|
4
|
+
* Licensed under the MIT License. Use of this source code is governed by the
|
|
5
|
+
* MIT license that can be found in the LICENSE file.
|
|
6
|
+
*/
|
|
2
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
8
|
exports.noUserControlledRequests = void 0;
|
|
4
9
|
const eslint_devkit_1 = require("@interlace/eslint-devkit");
|
|
@@ -49,7 +54,6 @@ exports.noUserControlledRequests = (0, eslint_devkit_1.createRule)({
|
|
|
49
54
|
icon: eslint_devkit_1.MessageIcons.SECURITY,
|
|
50
55
|
issueName: 'Server-Side Request Forgery (SSRF)',
|
|
51
56
|
cwe: 'CWE-918',
|
|
52
|
-
owasp: 'SAS-8',
|
|
53
57
|
cvss: 9.1,
|
|
54
58
|
description: 'HTTP request URL contains user-controlled input from {{source}}. Attackers can access internal services or exfiltrate data.',
|
|
55
59
|
severity: 'CRITICAL',
|
|
@@ -1,5 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
+
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
+
* MIT license that can be found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* ESLint Rule: require-timeout-handling
|
|
8
|
+
* Warns when Lambda handlers lack timeout handling
|
|
9
|
+
* CWE-400: Uncontrolled Resource Consumption
|
|
10
|
+
*
|
|
11
|
+
* @see https://cwe.mitre.org/data/definitions/400.html
|
|
12
|
+
* @see https://owasp.org/www-project-serverless-top-10/
|
|
13
|
+
*/
|
|
14
|
+
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
15
|
+
type MessageIds = 'missingTimeoutHandling' | 'addTimeoutCheck';
|
|
1
16
|
export interface Options {
|
|
2
17
|
/** Allow in test files. Default: true */
|
|
3
18
|
allowInTests?: boolean;
|
|
4
19
|
}
|
|
5
|
-
|
|
20
|
+
type RuleOptions = [Options?];
|
|
21
|
+
export declare const requireTimeoutHandling: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener>;
|
|
22
|
+
export {};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2025 Ofri Peretz
|
|
4
|
+
* Licensed under the MIT License. Use of this source code is governed by the
|
|
5
|
+
* MIT license that can be found in the LICENSE file.
|
|
6
|
+
*/
|
|
2
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
8
|
exports.requireTimeoutHandling = void 0;
|
|
4
9
|
const eslint_devkit_1 = require("@interlace/eslint-devkit");
|
|
@@ -37,7 +42,6 @@ exports.requireTimeoutHandling = (0, eslint_devkit_1.createRule)({
|
|
|
37
42
|
icon: eslint_devkit_1.MessageIcons.WARNING,
|
|
38
43
|
issueName: 'Missing Timeout Handling',
|
|
39
44
|
cwe: 'CWE-400',
|
|
40
|
-
owasp: 'SAS-7',
|
|
41
45
|
cvss: 6.0,
|
|
42
46
|
description: 'Lambda handler makes external calls without timeout handling. Function may timeout without cleanup.',
|
|
43
47
|
severity: 'MEDIUM',
|