supply-scan 1.0.1 → 1.0.2
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 +27 -15
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -6,6 +6,8 @@ Universal npm supply chain attack scanner. Detects compromised packages from **1
|
|
|
6
6
|
npx supply-scan
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
+
> Requires Node.js >= 20
|
|
10
|
+
|
|
9
11
|
## What It Detects
|
|
10
12
|
|
|
11
13
|
| Attack | Date | Severity | Type |
|
|
@@ -29,7 +31,17 @@ npx supply-scan
|
|
|
29
31
|
2. **Malware Files** — Checks for RAT payloads, droppers, and artifacts on disk
|
|
30
32
|
3. **Network Connections** — Detects active connections to C2 servers
|
|
31
33
|
4. **Suspicious Processes** — Identifies running malware and persistence mechanisms
|
|
32
|
-
5. **
|
|
34
|
+
5. **Package Manager Caches** — Scans npm, pnpm, yarn, and bun caches for malicious packages
|
|
35
|
+
|
|
36
|
+
## Supported Package Managers
|
|
37
|
+
|
|
38
|
+
| Manager | Lockfile | Cache |
|
|
39
|
+
|---------|----------|-------|
|
|
40
|
+
| npm | `package-lock.json` | `~/.npm` |
|
|
41
|
+
| pnpm | `pnpm-lock.yaml` | pnpm store |
|
|
42
|
+
| yarn v1 | `yarn.lock` | yarn cache dir |
|
|
43
|
+
| yarn v2+ | `yarn.lock` | `.yarn/cache` |
|
|
44
|
+
| bun | `bun.lock` / `bun.lockb` | `~/.bun/install/cache` |
|
|
33
45
|
|
|
34
46
|
## Usage
|
|
35
47
|
|
|
@@ -112,37 +124,37 @@ Each attack is defined as a JSON file in the `rules/` directory. To add a new at
|
|
|
112
124
|
}
|
|
113
125
|
```
|
|
114
126
|
|
|
115
|
-
No code changes needed — the scanner automatically picks up new rule files.
|
|
127
|
+
No code changes needed — the scanner automatically picks up new rule files. See [docs/RULES.md](docs/RULES.md) for the complete schema reference.
|
|
116
128
|
|
|
117
129
|
## Architecture
|
|
118
130
|
|
|
119
131
|
```
|
|
120
132
|
supply-scan/
|
|
121
|
-
├── bin/supply-scan.js # CLI entry point
|
|
122
133
|
├── src/ # TypeScript source
|
|
123
|
-
│ ├── index.ts #
|
|
124
|
-
│ ├── scanner.ts # Scan engine
|
|
125
|
-
│ ├── ui.ts # Terminal UI (zero deps)
|
|
126
|
-
│ ├── utils.ts # Utilities
|
|
134
|
+
│ ├── index.ts # CLI entry + interactive prompts
|
|
135
|
+
│ ├── scanner.ts # Scan engine orchestrator
|
|
136
|
+
│ ├── ui.ts # Terminal UI (zero deps, ANSI codes)
|
|
137
|
+
│ ├── utils.ts # Utilities (args, paths, JSON, etc.)
|
|
127
138
|
│ ├── types.ts # TypeScript interfaces
|
|
128
139
|
│ └── checks/
|
|
129
|
-
│ ├── packages.ts # Package
|
|
140
|
+
│ ├── packages.ts # Package + lockfile scanner
|
|
130
141
|
│ ├── files.ts # Malware file detector
|
|
131
142
|
│ ├── network.ts # C2 connection checker
|
|
132
|
-
│ ├── processes.ts # Process scanner
|
|
133
|
-
│ └── cache.ts #
|
|
143
|
+
│ ├── processes.ts # Process + persistence scanner
|
|
144
|
+
│ └── cache.ts # Package manager cache scanner
|
|
134
145
|
├── rules/ # Attack definitions (JSON)
|
|
135
|
-
|
|
146
|
+
├── __tests__/ # Unit tests (Vitest)
|
|
147
|
+
├── docs/ # Rule writing guide
|
|
148
|
+
├── .github/workflows/ # CI + publish + dependency review
|
|
149
|
+
└── dist/ # Compiled output (tsup, single file)
|
|
136
150
|
```
|
|
137
151
|
|
|
138
152
|
**Zero runtime dependencies.** This is a security scanner — we don't depend on packages that could themselves be compromised.
|
|
139
153
|
|
|
140
154
|
## Contributing
|
|
141
155
|
|
|
142
|
-
|
|
143
|
-
2. Add a new rule JSON file in `rules/`
|
|
144
|
-
3. Submit a pull request with a reference link to the attack advisory
|
|
156
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for setup instructions, how to add new attack rules, and PR guidelines.
|
|
145
157
|
|
|
146
158
|
## License
|
|
147
159
|
|
|
148
|
-
MIT
|
|
160
|
+
[MIT](LICENSE)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "supply-scan",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Universal npm supply chain attack scanner. Detects compromised packages from 12+ known attacks.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"security",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"rules/"
|
|
34
34
|
],
|
|
35
35
|
"engines": {
|
|
36
|
-
"node": ">=
|
|
36
|
+
"node": ">=20"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "tsup",
|