eslint-plugin-lambda-security 1.2.9 → 1.2.10

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.
Files changed (35) hide show
  1. package/package.json +5 -12
  2. package/src/index.d.ts +17 -30
  3. package/src/index.js +1 -24
  4. package/src/oxlint.d.ts +17 -20
  5. package/src/oxlint.js +0 -18
  6. package/src/rules/no-env-logging/index.js +0 -23
  7. package/src/rules/no-error-swallowing/index.js +1 -27
  8. package/src/rules/no-exposed-debug-endpoints/index.js +0 -13
  9. package/src/rules/no-exposed-error-details/index.js +0 -17
  10. package/src/rules/no-hardcoded-credentials-sdk/index.js +4 -43
  11. package/src/rules/no-missing-authorization-check/index.js +0 -31
  12. package/src/rules/no-overly-permissive-iam-policy/index.js +0 -17
  13. package/src/rules/no-permissive-cors-middy/index.js +0 -16
  14. package/src/rules/no-permissive-cors-response/index.js +19 -41
  15. package/src/rules/no-secrets-in-env/index.js +0 -18
  16. package/src/rules/no-unbounded-batch-processing/index.js +4 -20
  17. package/src/rules/no-unvalidated-event-body/index.js +19 -86
  18. package/src/rules/no-user-controlled-requests/index.js +2 -48
  19. package/src/rules/require-timeout-handling/index.js +0 -20
  20. package/AGENTS.md +0 -106
  21. package/CHANGELOG.md +0 -203
  22. package/src/rules/no-env-logging/index.d.ts +0 -23
  23. package/src/rules/no-error-swallowing/index.d.ts +0 -26
  24. package/src/rules/no-exposed-debug-endpoints/index.d.ts +0 -14
  25. package/src/rules/no-exposed-error-details/index.d.ts +0 -24
  26. package/src/rules/no-hardcoded-credentials-sdk/index.d.ts +0 -24
  27. package/src/rules/no-missing-authorization-check/index.d.ts +0 -26
  28. package/src/rules/no-overly-permissive-iam-policy/index.d.ts +0 -24
  29. package/src/rules/no-permissive-cors-middy/index.d.ts +0 -24
  30. package/src/rules/no-permissive-cors-response/index.d.ts +0 -26
  31. package/src/rules/no-secrets-in-env/index.d.ts +0 -26
  32. package/src/rules/no-unbounded-batch-processing/index.d.ts +0 -26
  33. package/src/rules/no-unvalidated-event-body/index.d.ts +0 -26
  34. package/src/rules/no-user-controlled-requests/index.d.ts +0 -24
  35. package/src/rules/require-timeout-handling/index.d.ts +0 -24
package/CHANGELOG.md DELETED
@@ -1,203 +0,0 @@
1
- ## [1.2.3] - 2026-02-08
2
-
3
- ## 1.2.9
4
-
5
- ### Patch Changes
6
-
7
- - [#294](https://github.com/ofri-peretz/eslint/pull/294) [`659f6dc`](https://github.com/ofri-peretz/eslint/commit/659f6dc0181b03b675f72b5949fcf123dd066358) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - Rewrite `description` and `keywords` on every published package for npm search discovery. npm ranks on name, description, and keywords, and the registry only picks up these fields at publish — so this is metadata-only and takes effect for each package on its next release.
8
-
9
- **Descriptions now lead with the search phrase.** Every one starts `ESLint plugin for <the thing you'd search>` instead of a brand-first or category-first framing, and names the concrete vulnerabilities the plugin actually detects. Three were corrected while doing so:
10
-
11
- - `eslint-plugin-import-next` claimed "100x faster no-cycle detection". No 100x measurement exists: `CLAIMS.md` records **3.1x end-to-end** (8x in pure rule execution) on a 5,483-file React codebase, and the highest number in any benchmark result is 54.9x on the synthetic corpus. The description now states the real-codebase figure.
12
- - `eslint-plugin-secure-coding` claimed SQL injection, XSS and CSRF coverage — none of which are its rules. It now names what it does detect: LDAP, XPath, XXE, GraphQL and template injection, unsafe deserialization, ReDoS, missing authentication, and PII in logs.
13
- - `eslint-plugin-secure-coding` ("89 rules") and `eslint-plugin-react-a11y` ("37 rules") hard-coded rule counts that had drifted from reality. Counts are generated into `interlace-numbers.json`; hand-typed copies are removed rather than corrected.
14
-
15
- **Keywords now match the vocabulary of the plugins that rank.** `eslint-plugin-security`, `eslint-plugin-jsx-a11y`, `eslint-plugin-n` and `eslint-plugin-import` all carry the `eslint` / `eslintplugin` / `eslint-plugin` trio — six of our packages were missing `eslintplugin`, and every one now carries all three plus `static-analysis`, `linting` and `code-quality`. Security plugins add `sast`, `appsec` and `vulnerability`; `node-security` and `secure-coding` also carry `nodesecurity`, the exact keyword `eslint-plugin-security` ranks on. Each plugin gained the CWE identifiers and attack names for what it detects (`cwe-78` command injection, `cwe-22` path traversal, `cwe-89` SQL injection, `cwe-79` XSS, `cwe-347` JWT algorithm confusion, `cwe-352` CSRF, `cwe-943` NoSQL injection), and `node-security` gained the crypto vocabulary it had been missing entirely despite absorbing the crypto rule set (`crypto`, `cryptography`, `weak-hash`, `md5`, `sha1`, `timing-attack`).
16
-
17
- No rule behavior, exports, or configuration changes.
18
-
19
- - Updated dependencies [[`e1cdf83`](https://github.com/ofri-peretz/eslint/commit/e1cdf83e3db761907f0ab06f7fc6c1f1da7513a5), [`659f6dc`](https://github.com/ofri-peretz/eslint/commit/659f6dc0181b03b675f72b5949fcf123dd066358)]:
20
- - @interlace/eslint-devkit@1.4.3
21
-
22
- ## 1.2.8
23
-
24
- ### Patch Changes
25
-
26
- - [#269](https://github.com/ofri-peretz/eslint/pull/269) [`7028fe2`](https://github.com/ofri-peretz/eslint/commit/7028fe2668a42266d831014184dcef70e73101ad) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - docs: dual-logo README header (Interlace mark + ESLint mark side by side) and closing Interlace footer — refreshes the README rendered on npmjs.com. No runtime changes.
27
-
28
- - Updated dependencies [[`7028fe2`](https://github.com/ofri-peretz/eslint/commit/7028fe2668a42266d831014184dcef70e73101ad)]:
29
- - @interlace/eslint-devkit@1.4.2
30
-
31
- ## 1.2.7
32
-
33
- ### Patch Changes
34
-
35
- - [#252](https://github.com/ofri-peretz/eslint/pull/252) [`d67e395`](https://github.com/ofri-peretz/eslint/commit/d67e3953c2748ad36e6aebe0f24b1d04e518b4d0) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - Fix Codecov badge showing "unknown" — switch from flag to component URL format
36
-
37
- ## 1.2.6
38
-
39
- ### Patch Changes
40
-
41
- - [#225](https://github.com/ofri-peretz/eslint/pull/225) [`34ff5a8`](https://github.com/ofri-peretz/eslint/commit/34ff5a8e6f5126c5d1c0a524759e0af2b5476b46) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - CI-only: pin all coverage thresholds at 100% (integration target, merges last).
42
-
43
- ## 1.2.5
44
-
45
- ### Patch Changes
46
-
47
- - [#220](https://github.com/ofri-peretz/eslint/pull/220) [`ad8416d`](https://github.com/ofri-peretz/eslint/commit/ad8416d4db196bf0b24942ddabbfaefb0cae7bab) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - Fix runtime crashes when linting realistic AWS Lambda handlers under ESLint 9.
48
-
49
- The published `1.2.3` tarball was a **stale build**: its rules still threw on the
50
- generated lambda-ai-corpus handlers, even though source had already been fixed.
51
- This republishes the corrected build and locks it with a regression test.
52
- - **`no-error-swallowing`** no longer throws `RangeError: Maximum call stack size
53
- exceeded`. The old build walked the catch-block AST by hand and recursed through
54
- the cyclic `node.parent` reference; source now uses `sourceCode.getText()` + a
55
- regex.
56
- - **`require-timeout-handling`**, **`no-missing-authorization-check`**, and
57
- **`no-unbounded-batch-processing`** no longer throw `Error: Unknown class name:
58
- exit`. They used a grouped `:exit` selector (`'A:exit, B:exit, C:exit'`); ESLint
59
- only strips the trailing `:exit`, so esquery received a bare `:exit`. Source now
60
- uses one listener key per node type.
61
- - `plugin.meta.version` is now read from `package.json` instead of a hardcoded
62
- string, so a build can no longer mislabel its own version (1.2.3 embedded
63
- `1.1.0`).
64
-
65
- - [#213](https://github.com/ofri-peretz/eslint/pull/213) [`391dbe6`](https://github.com/ofri-peretz/eslint/commit/391dbe6b39f78d549379218567cb959649f8c614) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - Align every security rule's `meta.docs.cvss` to the CVSS its finding actually
66
- emits. The emitted machine-readable message sources its `CVSS:x` from
67
- `CWE_MAPPING` via `formatLLMMessage` → `enrichFromCWE`, but the static
68
- `meta.docs.cvss` documentation field had drifted on 45 rules across these 7
69
- plugins — e.g. `no-hardcoded-credentials` documented `9.5` while emitting
70
- `CVSS:9.8` (the value the published article and SARIF/LLM consumers already
71
- read).
72
-
73
- This corrects the **documentation metadata only** — no emitted finding changes.
74
- Locked by `security-cvss-docs-consistency.lock.test.ts` (cross-plugin: every
75
- security rule's `meta.docs.cvss` must equal the CVSS it emits), the
76
- `no-hardcoded-credentials` rule lock (real ESLint `Linter` emission), and a
77
- devkit `enrichFromCWE` contract test pinning `CWE-798 → 9.8`.
78
-
79
- Follow-up (not in scope): 50 security rules document a CVSS that never appears
80
- in any emitted message (their messages carry no CWE), and several rules emit the
81
- generic CWE score where a rule-specific score may be warranted — both change
82
- emitted output and are separate decisions.
83
-
84
- ## 1.2.4
85
-
86
- ### Patch Changes
87
-
88
- - [#144](https://github.com/ofri-peretz/eslint/pull/144) [`8843ce7`](https://github.com/ofri-peretz/eslint/commit/8843ce7fbb465caad161b97032467b3a37a49319) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - fix: ILB-Wild FP reduction + doc examples + doc-test-alignment scanner fixes
89
-
90
- **`no-unlimited-resource-allocation` — FP reduction (430 Edge FPs)**
91
- - Skip loop-allocation reporting when the first argument is a numeric literal (e.g. `Buffer.alloc(1024)` inside a loop is statically bounded, not a risk)
92
- - Skip `Array.isArray`, `Array.from`, `Array.of` calls in the `alloc/Array` pattern check (these don't allocate unbounded memory)
93
-
94
- **`no-hardcoded-credentials` — FP reduction (~280 Edge FPs)**
95
- - Extended test-file skip to cover `.fixture.`, `.mock.`, `__mocks__/`, `/tests/`, `/fixtures/`, `/mocks/` paths
96
- - Skip string literals that are fallback values in `process.env.X || 'fallback'` expressions — the secret lives in the environment, the string is only a dev-mode default
97
-
98
- **Doc examples — 4 rules now have ❌ Incorrect examples**
99
- - `lambda-security/no-missing-authorization-check`
100
- - `lambda-security/no-overly-permissive-iam-policy`
101
- - `node-security/prefer-native-crypto` (renamed non-standard `### ❌ Third-Party (Flagged)` to `### ❌ Incorrect`)
102
- - `vercel-ai-security/require-tool-confirmation` (replaced placeholder with a real tested example)
103
-
104
- **`ilb-doc-test-alignment` scanner fixes**
105
- - Accept both `## ❌` and `### ❌` headings (docs use H3 under an H2 `## Examples` section; was only finding H2)
106
- - Slice from end-of-line rather than end-of-regex-match (prevents `## ❌ Incorrect Code` from leaving a partial heading in the parsed section)
107
-
108
- Result: `ilb:doc-test-alignment` → 206 ok, 0 doc has no ❌ examples (was 165 missing).
109
-
110
- - [#194](https://github.com/ofri-peretz/eslint/pull/194) [`55d5c0a`](https://github.com/ofri-peretz/eslint/commit/55d5c0ab90bfaaecf01be5146a91a2e4b14e1d41) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - Fix a hard crash (`Error: Unknown class name: exit`) that aborted the entire ESLint run on ESLint 9 whenever the `recommended` or `strict` config was enabled.
111
-
112
- Three rules — `require-timeout-handling`, `no-missing-authorization-check`, and `no-unbounded-batch-processing` — registered their function-exit listener as a single comma-joined selector key:
113
-
114
- ```
115
- 'ArrowFunctionExpression:exit, FunctionExpression:exit, FunctionDeclaration:exit'
116
- ```
117
-
118
- ESLint only strips a **trailing** `:exit` before handing a selector to esquery, so the earlier `:exit` tokens survived into the parser and threw `Unknown class name: exit` for every linted file. Each listener is now registered as one key per node type, which is the only esquery-safe form.
119
-
120
- A config-level regression test (`src/index.test.ts`) now boots the real ESLint engine against both shipped configs, so any future comma-joined `:exit` — or any other unparseable selector in any rule — fails in CI instead of in a consumer's editor.
121
-
122
- `@interlace/eslint-config` re-exports the `recommended` config and is republished against the fixed plugin.
123
-
124
- - [#143](https://github.com/ofri-peretz/eslint/pull/143) [`213cde1`](https://github.com/ofri-peretz/eslint/commit/213cde190ff2aea49ca7c1b533170940f879d9b4) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - fix(no-missing-null-checks): eliminate 53 false positives via three new narrowing patterns
125
-
126
- Rules that were recognized as null guards are now correctly identified as safe:
127
- 1. **Truthy if guard** — `if (obj) { obj.prop }` — direct truthy check proves non-null. Also covers chains: `if (response)` protects `response.data.items`.
128
- 2. **Short-circuit AND** — `obj && obj.prop` — right side of `&&` only runs when left is truthy.
129
- 3. **Ternary consequent** — `obj ? obj.prop : fallback` — truthy test guards the consequent.
130
-
131
- Also: bumped `beforeAll` timeout to 30 seconds in 7 compatibility test files (`__compatibility__/*.spec.ts`). Native-addon packages routinely exceed the previous 10-second default on a cold ESM load.
132
-
133
- - Updated dependencies [[`736a5fe`](https://github.com/ofri-peretz/eslint/commit/736a5fed47e673f6157ea900b29fe2a54e4bc7df)]:
134
- - @interlace/eslint-devkit@1.4.1
135
-
136
- ### Bug Fixes
137
-
138
- - align codecov component IDs with full package names ([2831b968](https://github.com/ofri-peretz/eslint/commit/2831b968))
139
-
140
- ### Documentation
141
-
142
- - fix changelog header format across all packages ([c3a15082](https://github.com/ofri-peretz/eslint/commit/c3a15082))
143
-
144
- ### ❤️ Thank You
145
-
146
- - Ofri Peretz
147
-
148
- ## [1.2.2] - 2026-02-06
149
-
150
- ### Bug Fixes
151
-
152
- - align codecov component names and update docs components ([0a59a86c](https://github.com/ofri-peretz/eslint/commit/0a59a86c))
153
-
154
- ### ❤️ Thank You
155
-
156
- - Ofri Peretz
157
-
158
- ## [1.2.1] - 2026-02-02
159
-
160
- This was a version bump only for eslint-plugin-lambda-security to align it with other projects, there were no code changes.
161
-
162
- # Changelog
163
-
164
- All notable changes to `eslint-plugin-lambda-security` will be documented in this file.
165
-
166
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
167
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
168
-
169
- ## [1.0.0] - 2025-12-29
170
-
171
- ### Added
172
-
173
- #### Credential & Secrets Protection Rules (3)
174
-
175
- - `no-hardcoded-credentials-sdk` - Detect hardcoded AWS credentials in SDK v3 clients (CWE-798)
176
- - `no-secrets-in-env` - Detect secrets hardcoded in environment variables (CWE-798)
177
- - `no-env-logging` - Detect logging entire process.env object (CWE-532)
178
-
179
- #### CORS Security Rules (2)
180
-
181
- - `no-permissive-cors-response` - Detect wildcard CORS in Lambda response headers (CWE-942)
182
- - `no-permissive-cors-middy` - Detect permissive CORS in @middy/http-cors middleware (CWE-942)
183
-
184
- #### Presets (2)
185
-
186
- - `recommended` - Balanced security defaults
187
- - `strict` - All 5 rules as errors
188
-
189
- #### Features
190
-
191
- - LLM-optimized error messages with CWE references
192
- - OWASP Serverless Top 10 alignment (SAS-2, SAS-3, SAS-4)
193
- - AWS SDK v3 client detection (S3, DynamoDB, Lambda, STS, etc.)
194
- - Middy middleware detection (@middy/http-cors)
195
- - Real AWS access key pattern matching (AKIA*, ASIA*)
196
- - TypeScript support with exported option types
197
- - Comprehensive test coverage (78 tests, 97.40% line coverage)
198
- - Auto-fix for CORS violations
199
-
200
- ### Security
201
-
202
- - Covers 3 CWEs: 532, 798, 942
203
- - Maps to OWASP Serverless Top 10: SAS-2, SAS-3, SAS-4
@@ -1,23 +0,0 @@
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';
15
- export interface Options {
16
- /** Allow in test files. Default: true */
17
- allowInTests?: boolean;
18
- }
19
- type RuleOptions = [Options?];
20
- export declare const noEnvLogging: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
21
- name: string;
22
- };
23
- export {};
@@ -1,26 +0,0 @@
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';
16
- export interface Options {
17
- /** Allow in test files. Default: true */
18
- allowInTests?: boolean;
19
- /** Allow comments as documentation of intentional swallowing. Default: true */
20
- allowWithComment?: boolean;
21
- }
22
- type RuleOptions = [Options?];
23
- export declare const noErrorSwallowing: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
24
- name: string;
25
- };
26
- export {};
@@ -1,14 +0,0 @@
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
- export interface Options {
7
- endpoints?: string[];
8
- ignoreFiles?: string[];
9
- }
10
- type RuleOptions = [Options?];
11
- export declare const noExposedDebugEndpoints: import("@typescript-eslint/utils/ts-eslint").RuleModule<"violationDetected", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
12
- name: string;
13
- };
14
- export {};
@@ -1,24 +0,0 @@
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';
16
- export interface Options {
17
- /** Allow in test files. Default: true */
18
- allowInTests?: boolean;
19
- }
20
- type RuleOptions = [Options?];
21
- export declare const noExposedErrorDetails: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
22
- name: string;
23
- };
24
- export {};
@@ -1,24 +0,0 @@
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';
16
- export interface Options {
17
- /** Allow in test files. Default: true */
18
- allowInTests?: boolean;
19
- }
20
- type RuleOptions = [Options?];
21
- export declare const noHardcodedCredentialsSdk: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
22
- name: string;
23
- };
24
- export {};
@@ -1,26 +0,0 @@
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';
16
- export interface Options {
17
- /** Allow in test files. Default: true */
18
- allowInTests?: boolean;
19
- /** Handler file patterns to check. Default: common Lambda patterns */
20
- handlerPatterns?: string[];
21
- }
22
- type RuleOptions = [Options?];
23
- export declare const noMissingAuthorizationCheck: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
24
- name: string;
25
- };
26
- export {};
@@ -1,24 +0,0 @@
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';
16
- export interface Options {
17
- /** Allow in test files. Default: true */
18
- allowInTests?: boolean;
19
- }
20
- type RuleOptions = [Options?];
21
- export declare const noOverlyPermissiveIamPolicy: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
22
- name: string;
23
- };
24
- export {};
@@ -1,24 +0,0 @@
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';
16
- export interface Options {
17
- /** Allow in test files. Default: true */
18
- allowInTests?: boolean;
19
- }
20
- type RuleOptions = [Options?];
21
- export declare const noPermissiveCorsMidly: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
22
- name: string;
23
- };
24
- export {};
@@ -1,26 +0,0 @@
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';
16
- export interface Options {
17
- /** Allow in test files. Default: true */
18
- allowInTests?: boolean;
19
- /** Allowed origins (patterns). Default: [] */
20
- allowedOrigins?: string[];
21
- }
22
- type RuleOptions = [Options?];
23
- export declare const noPermissiveCorsResponse: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
24
- name: string;
25
- };
26
- export {};
@@ -1,26 +0,0 @@
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';
16
- export interface Options {
17
- /** Allow in test files. Default: true */
18
- allowInTests?: boolean;
19
- /** Additional secret patterns to detect. Default: [] */
20
- additionalPatterns?: string[];
21
- }
22
- type RuleOptions = [Options?];
23
- export declare const noSecretsInEnv: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
24
- name: string;
25
- };
26
- export {};
@@ -1,26 +0,0 @@
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';
16
- export interface Options {
17
- /** Allow in test files. Default: true */
18
- allowInTests?: boolean;
19
- /** Maximum allowed batch size before warning. Default: 100 */
20
- maxBatchSize?: number;
21
- }
22
- type RuleOptions = [Options?];
23
- export declare const noUnboundedBatchProcessing: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
24
- name: string;
25
- };
26
- export {};
@@ -1,26 +0,0 @@
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';
16
- export interface Options {
17
- /** Allow in test files. Default: true */
18
- allowInTests?: boolean;
19
- /** Additional event properties to check. Default: [] */
20
- additionalProperties?: string[];
21
- }
22
- type RuleOptions = [Options?];
23
- export declare const noUnvalidatedEventBody: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
24
- name: string;
25
- };
26
- export {};
@@ -1,24 +0,0 @@
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';
16
- export interface Options {
17
- /** Allow in test files. Default: true */
18
- allowInTests?: boolean;
19
- }
20
- type RuleOptions = [Options?];
21
- export declare const noUserControlledRequests: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
22
- name: string;
23
- };
24
- export {};
@@ -1,24 +0,0 @@
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';
16
- export interface Options {
17
- /** Allow in test files. Default: true */
18
- allowInTests?: boolean;
19
- }
20
- type RuleOptions = [Options?];
21
- export declare const requireTimeoutHandling: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
22
- name: string;
23
- };
24
- export {};