nulladrift 0.6.1 → 0.7.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 +30 -7
- package/dist/index.js +708 -173
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -50,6 +50,13 @@ Then in CI:
|
|
|
50
50
|
npx nulladrift check # exit 0 clean · 1 drift · 2 could not complete the audit
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
+
`check` starts every stdio server in the config, so it runs the commands a pull request writes
|
|
54
|
+
there. Run it on `pull_request`, which gives a fork no secrets, and never on
|
|
55
|
+
`pull_request_target`. A config cannot reach the job's own credentials through `${VAR}`: the
|
|
56
|
+
token and identity the CI provider puts in every job, and every `NULLADRIFT_` variable, are
|
|
57
|
+
refused. A secret your workflow sets for a server is filled as written, and a server that runs
|
|
58
|
+
does so as the job's user.
|
|
59
|
+
|
|
53
60
|
When it fails, see what moved and decide:
|
|
54
61
|
|
|
55
62
|
```bash
|
|
@@ -67,14 +74,18 @@ nulladrift login <server> # opens a browser, stores tokens owner-only; check
|
|
|
67
74
|
```
|
|
68
75
|
|
|
69
76
|
In CI, set `oauth.clientId` / `oauth.clientSecret` on the server in your config (the secret can
|
|
70
|
-
be `${ENV_VAR}`)
|
|
77
|
+
be `${ENV_VAR}`), with `oauth.issuer` naming the authorization server the secret is for, and no
|
|
78
|
+
browser is involved. The issuer is required: without it the secret goes to whichever
|
|
79
|
+
authorization server the MCP server names, and a compromised server can name its own. Auditing a gated server *without* credentials is
|
|
71
80
|
not a smaller audit, the spec lets the tool list vary with who is asking, so `check` reports
|
|
72
81
|
those servers as needing credentials rather than pinning whatever an anonymous client sees.
|
|
73
82
|
|
|
74
|
-
`init` reads the config files your clients already use, `.mcp.json`,
|
|
75
|
-
`.
|
|
76
|
-
|
|
77
|
-
|
|
83
|
+
`init` reads the config files your clients already use in the project, `.mcp.json`,
|
|
84
|
+
`.vscode/mcp.json` and `.cursor/mcp.json`, so there is nothing to configure to try it. Your own
|
|
85
|
+
configs (`~/.claude.json`, `~/.cursor/mcp.json`, `claude_desktop_config.json`, Windsurf's
|
|
86
|
+
`~/.codeium/windsurf/mcp_config.json`, Copilot's `~/.copilot/mcp-config.json`) are read with
|
|
87
|
+
`--user-configs`: they are one person's servers, often with their keys and home paths, and the lock
|
|
88
|
+
is the project's and is committed. `init` says when it left them out. `nulladrift logout <server>` deletes what `login`
|
|
78
89
|
stored.
|
|
79
90
|
|
|
80
91
|
## What lands in the lock
|
|
@@ -135,8 +146,9 @@ registry lookups for an air-gapped run.
|
|
|
135
146
|
**What it leaves out: credentials, wherever a config puts them.** `env` and header values are
|
|
136
147
|
recorded by name only, and a URL loses its query string and `user:password`. A credential
|
|
137
148
|
written literally (`--api-key sk-...`, `-e GITHUB_TOKEN=ghp_...`, a connection string's password,
|
|
138
|
-
|
|
139
|
-
|
|
149
|
+
`--header "Authorization: Bearer ..."`, a key in JSON passed as an argument, a key in a hosted
|
|
150
|
+
server's URL path or query) is replaced with `REDACTED`, and `init`, `check` and `push` say which
|
|
151
|
+
server it was. Write it as `${VAR}` instead; the lock keeps the placeholder. If an
|
|
140
152
|
earlier `mcp.lock` was committed with the key in it, rotate the key: taking it out of the file
|
|
141
153
|
does not take it out of git history.
|
|
142
154
|
|
|
@@ -198,6 +210,13 @@ any branch as clean. `push` can send your CI provider's signed identity token as
|
|
|
198
210
|
control plane then records the repository, ref and commit as the provider stated them. An
|
|
199
211
|
organization can list the builds it trusts and require every reading to come from one.
|
|
200
212
|
|
|
213
|
+
On GitHub Actions the signature also covers what the reading says. `push` asks for a second
|
|
214
|
+
token, minted for the sha256 of the exact bytes it sends and for the control plane it sends them
|
|
215
|
+
to, so it vouches for one reading at one place and nothing else. An organization can require
|
|
216
|
+
that too: a trusted build's reading whose contents nothing signed then fails. GitLab mints its
|
|
217
|
+
token before the job runs, for an audience fixed in the pipeline file, so a GitLab reading proves
|
|
218
|
+
its build and not its contents.
|
|
219
|
+
|
|
201
220
|
GitHub Actions needs one permission, and `push` does the rest:
|
|
202
221
|
|
|
203
222
|
```yaml
|
|
@@ -217,6 +236,10 @@ nulladrift:
|
|
|
217
236
|
```
|
|
218
237
|
|
|
219
238
|
Any other CI that can mint an OpenID Connect token for a job can put it in `NULLADRIFT_ID_TOKEN`.
|
|
239
|
+
|
|
240
|
+
`push` sends its tokens only over `https` (plain `http` only to `localhost`), refuses an API address
|
|
241
|
+
with credentials in it, and does not follow redirects, so the reading and the identity token reach
|
|
242
|
+
the control plane you named and nowhere else.
|
|
220
243
|
Without one, the reading is recorded as unverified, exactly as before -- `push` never fails for
|
|
221
244
|
want of a token.
|
|
222
245
|
|