@fourteensystems/shipguard 0.2.3 → 0.2.4
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 +64 -1
- package/dist/engine/version.d.ts +1 -1
- package/dist/engine/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ npx @fourteensystems/shipguard init
|
|
|
15
15
|
Detects your framework and dependencies, generates a config, and runs your first scan.
|
|
16
16
|
|
|
17
17
|
```
|
|
18
|
-
Shipguard 0.
|
|
18
|
+
Shipguard 0.2.4
|
|
19
19
|
Detected: next-app-router · next-auth · prisma · upstash-ratelimit · middleware.ts
|
|
20
20
|
Score: 85 PASS
|
|
21
21
|
```
|
|
@@ -118,6 +118,39 @@ Shipguard auto-detects your stack and adjusts detection accordingly:
|
|
|
118
118
|
|
|
119
119
|
See [PATTERNS.md](../../PATTERNS.md) for full detection logic.
|
|
120
120
|
|
|
121
|
+
## Scoring
|
|
122
|
+
|
|
123
|
+
Shipguard computes a 0-100 security score. Each finding deducts points based on severity **and** confidence:
|
|
124
|
+
|
|
125
|
+
| | high confidence | med confidence | low confidence |
|
|
126
|
+
|---|---|---|---|
|
|
127
|
+
| **critical** | -15 | -3.75 | -1.5 |
|
|
128
|
+
| **high** | -6 | -1.5 | -0.6 |
|
|
129
|
+
| **med** | -3 | -0.75 | -0.3 |
|
|
130
|
+
| **low** | -1 | -0.25 | -0.1 |
|
|
131
|
+
|
|
132
|
+
A single rule can deduct at most 35 points (preventing one noisy rule from tanking the score).
|
|
133
|
+
|
|
134
|
+
| Score | Status | Meaning |
|
|
135
|
+
|-------|--------|---------|
|
|
136
|
+
| 80-100 | PASS | Healthy — no critical gaps |
|
|
137
|
+
| 50-79 | WARN | Issues to address |
|
|
138
|
+
| 0-49 | FAIL | Critical gaps in protection |
|
|
139
|
+
|
|
140
|
+
## Confidence Levels
|
|
141
|
+
|
|
142
|
+
Every finding has a confidence level:
|
|
143
|
+
|
|
144
|
+
- **high** — strong evidence (e.g., `publicProcedure.mutation()` with `prisma.create`)
|
|
145
|
+
- **med** — likely but uncertain (e.g., unrecognized procedure type)
|
|
146
|
+
- **low** — possible issue, may be false positive
|
|
147
|
+
|
|
148
|
+
Use `--min-confidence` in CI to control noise:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
shipguard ci --min-confidence high
|
|
152
|
+
```
|
|
153
|
+
|
|
121
154
|
## Monorepos
|
|
122
155
|
|
|
123
156
|
Shipguard must be run from the Next.js app directory (the one with `package.json` and `app/`). In a monorepo like Turborepo or pnpm workspaces:
|
|
@@ -134,6 +167,36 @@ Most teams do not need to configure Shipguard. Run `shipguard init` and commit t
|
|
|
134
167
|
|
|
135
168
|
With wrapper introspection, Shipguard resolves and analyzes your custom wrappers automatically. Hints are only needed for edge cases where the wrapper can't be resolved (e.g., auth handled by an API gateway, rate limiting at the CDN edge).
|
|
136
169
|
|
|
170
|
+
For advanced use cases, create `shipguard.config.json`:
|
|
171
|
+
|
|
172
|
+
```json
|
|
173
|
+
{
|
|
174
|
+
"framework": "next-app-router",
|
|
175
|
+
"include": ["app/**", "src/**"],
|
|
176
|
+
"exclude": ["**/*.test.*", "**/*.spec.*"],
|
|
177
|
+
"ci": {
|
|
178
|
+
"failOn": "critical",
|
|
179
|
+
"minConfidence": "high",
|
|
180
|
+
"minScore": 70,
|
|
181
|
+
"maxNewCritical": 0
|
|
182
|
+
},
|
|
183
|
+
"hints": {
|
|
184
|
+
"auth": {
|
|
185
|
+
"functions": ["auth", "getServerSession", "currentUser"],
|
|
186
|
+
"middlewareFiles": ["middleware.ts"],
|
|
187
|
+
"allowlistPaths": ["app/api/public/**"]
|
|
188
|
+
},
|
|
189
|
+
"rateLimit": {
|
|
190
|
+
"wrappers": ["rateLimit", "withRateLimit"],
|
|
191
|
+
"allowlistPaths": ["app/api/webhooks/**"]
|
|
192
|
+
},
|
|
193
|
+
"tenancy": {
|
|
194
|
+
"orgFieldNames": ["orgId", "tenantId", "workspaceId"]
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
137
200
|
### Hints
|
|
138
201
|
|
|
139
202
|
Hints are the "hard allow" escape hatch. Add function names when Shipguard can't verify protection automatically:
|
package/dist/engine/version.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ShipguardConfig } from "./types.js";
|
|
2
|
-
export declare const SHIPGUARD_VERSION = "0.2.
|
|
2
|
+
export declare const SHIPGUARD_VERSION = "0.2.4";
|
|
3
3
|
export declare const INDEX_VERSION = 1;
|
|
4
4
|
export declare function hashConfig(config: ShipguardConfig): string;
|
|
5
5
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/engine/version.js
CHANGED