Commit 7d4b793
committed
chore(security): P3 batch — placeholder email + swagger gate
Two of the eight P3 audit findings warrant a focused fix; the others are
informational / future-proofing / feature-requests and stay in the
findings doc as backlog.
### P3-1 — SECURITY.md placeholder contact email
SECURITY.md instructed reporters to email security@example.com "(replace
with actual email)" — a TODO that never got replaced. Two call sites
(line 25 and line 213) just stripped both. GitHub Security Advisories
is the recommended path anyway: report stays private to the maintainer
until a fix is ready to ship, doesn't require running a security
inbox, and integrates with CVE numbering when needed.
### P3-2 — Swagger UI gate
`/swagger` and `/swagger/*` were registered unconditionally with no
auth. In production, this lets any unauthenticated caller enumerate
every endpoint + JSON schema of the agent — a fingerprinting aid for
attackers, and the kind of detail that pairs with CVE search to find
known-vulnerable builds. In development the UI is genuinely useful for
debugging the API contract.
Gate behind a new opt-in: GEARBOX_AGENT_SWAGGER_ENABLED=true. Default
is off (production-safe). When enabled, the startup log emits a WARN
making the operator aware the UI is reachable.
config.SwaggerEnabled wires through ServerConfig.SwaggerEnabled to the
NewServer route registration. Existing prod deployments inherit the
default (off) without action.
P3-1 and P3-2 from the 2026-05 security audit.1 parent c174f39 commit 7d4b793
4 files changed
Lines changed: 41 additions & 16 deletions
File tree
- gearbox-agent
- cmd/gearbox-agent
- internal
- api
- framework/config
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
| |||
208 | 207 | | |
209 | 208 | | |
210 | 209 | | |
211 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
212 | 213 | | |
213 | | - | |
214 | | - | |
| 214 | + | |
| 215 | + | |
215 | 216 | | |
216 | 217 | | |
217 | 218 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
321 | 322 | | |
322 | 323 | | |
323 | 324 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
48 | 55 | | |
49 | 56 | | |
50 | 57 | | |
| |||
85 | 92 | | |
86 | 93 | | |
87 | 94 | | |
88 | | - | |
89 | | - | |
90 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
91 | 105 | | |
92 | 106 | | |
93 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
63 | 69 | | |
64 | 70 | | |
65 | 71 | | |
| |||
152 | 158 | | |
153 | 159 | | |
154 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
155 | 164 | | |
156 | 165 | | |
157 | 166 | | |
| |||
0 commit comments