@mago-foundation/mago-ski 0.4.0 → 0.5.0-beta.1
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 +5 -3
- package/action.yml +21 -2
- package/dist/hosts/github/check.d.ts +21 -0
- package/dist/hosts/github/check.js +124 -0
- package/dist/hosts/github/publish.d.ts +7 -0
- package/dist/hosts/github/publish.js +52 -0
- package/dist/hosts/github/run.d.ts +12 -0
- package/dist/hosts/github/run.js +32 -18
- package/dist/hosts/pi/index.js +40 -18
- package/dist/src/admin.d.ts +2 -1
- package/dist/src/admin.js +3 -2
- package/dist/src/admission-evidence.d.ts +15 -0
- package/dist/src/admission-evidence.js +48 -0
- package/dist/src/admission.d.ts +102 -0
- package/dist/src/admission.js +316 -0
- package/dist/src/canonical-json.d.ts +6 -0
- package/dist/src/canonical-json.js +11 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +229 -5
- package/dist/src/diff.d.ts +9 -0
- package/dist/src/diff.js +3 -2
- package/dist/src/dsse.js +2 -2
- package/dist/src/experimental/sigstore.d.ts +30 -0
- package/dist/src/experimental/sigstore.js +35 -5
- package/dist/src/fs-safe.d.ts +15 -2
- package/dist/src/fs-safe.js +68 -50
- package/dist/src/gate/adapters/claude-code.js +8 -5
- package/dist/src/gate/adapters/codex.js +5 -6
- package/dist/src/gate/generations.js +2 -0
- package/dist/src/gate/instance.js +7 -7
- package/dist/src/gate/proc.d.ts +6 -0
- package/dist/src/gate/proc.js +14 -3
- package/dist/src/gate/service.js +3 -0
- package/dist/src/gate/setup.d.ts +5 -5
- package/dist/src/gate/setup.js +128 -88
- package/dist/src/policy.d.ts +7 -0
- package/dist/src/policy.js +19 -2
- package/dist/src/profile.d.ts +34 -0
- package/dist/src/profile.js +182 -0
- package/dist/src/published-by.d.ts +64 -0
- package/dist/src/published-by.js +227 -0
- package/dist/src/recovery-admin.js +7 -4
- package/dist/src/root-events.d.ts +2 -0
- package/dist/src/root-events.js +61 -4
- package/dist/src/tree-digest.d.ts +6 -0
- package/dist/src/tree-digest.js +8 -0
- package/dist/src/usf-check.d.ts +28 -0
- package/dist/src/usf-check.js +128 -0
- package/dist/src/usf.d.ts +48 -0
- package/dist/src/usf.js +238 -0
- package/docs/hosts/publish.md +65 -0
- package/docs/hosts/skill-check.md +91 -0
- package/docs/spec/admission-v0.md +84 -0
- package/docs/spec/gui-admin-rack-v1.md +1 -1
- package/docs/spec/observed-profile-v1.md +51 -0
- package/docs/spec/root-recovery-v1.md +3 -2
- package/docs/spec/trust-documents-v1.md +1 -1
- package/docs/threat-model.md +12 -0
- package/package.json +5 -1
|
@@ -24,7 +24,7 @@ An organization's trust is anchored in one **root key**, kept offline. Hosts pin
|
|
|
24
24
|
|
|
25
25
|
- `version`: positive integer, increased on every change. Hosts with a configured state file reject versions lower than those recorded there.
|
|
26
26
|
- `root.public_key` must hash to `root.key_id`, which must equal the pinned fingerprint and the envelope's `keyid`.
|
|
27
|
-
- `approvers`: sorted by `key_id`, unique, at most 256. The root key may not also be an approver. With root recovery, a host also refuses (`UNVERIFIABLE`) a trust root that lists an approver whose key has held the root or timestamp role in the root events the host walked: `trust root lists approver <id>, which has held the root or timestamp role; a key that left those roles never takes another`.
|
|
27
|
+
- `approvers`: sorted by `key_id`, unique, at most 256. The root key may not also be an approver. With root recovery, a host also refuses (`UNVERIFIABLE`) a trust root that lists an approver whose key has held the root or timestamp role in the root events the host walked: `trust root lists approver <id>, which has held the root or timestamp role; a key that left those roles never takes another`. Keys shown leaving a role in events before `root_events_after` count too; the gate trust store does not check it. Before upgrading, remove such approvers (see the CHANGELOG).
|
|
28
28
|
- `scopes`: sorted, unique, 1–64 per approver. `*` matches every Skill name; `prefix*` matches names starting with `prefix`; anything else matches one exact name.
|
|
29
29
|
|
|
30
30
|
## Revocation list
|
package/docs/threat-model.md
CHANGED
|
@@ -35,6 +35,18 @@ mago-ski answers one question: **is the Skill this agent is about to use the exa
|
|
|
35
35
|
- **Files excluded from the digest** (`.skilldigestignore`, root `.git`) are not approved. The Pi host refuses to read them from a verified Skill, but other tools may still use them.
|
|
36
36
|
- **Windows.** Not supported yet. Windows has no POSIX executable bit, so it cannot reproduce Linux and macOS digests; see the [digest spec](spec/skill-tree-v2.md).
|
|
37
37
|
|
|
38
|
+
## Accepted risks
|
|
39
|
+
|
|
40
|
+
Findings from security reviews that were kept on purpose. A review that raises one again should say what changed.
|
|
41
|
+
|
|
42
|
+
| Risk | Why it is kept |
|
|
43
|
+
|---|---|
|
|
44
|
+
| **`verifySkill` reads `SKILL.md` twice** (once for the digest, once for the name), so a file swapped in between gives a different name | It fails closed: a name that does not match the certificate is refused. Discovery stops at the outer `SKILL.md`, whose digest covers any nested one |
|
|
45
|
+
| **Gate: one user can spend the decision socket's rate limit for others** | Telling users apart needs the connecting process's credentials (`SO_PEERCRED`), which Node does not provide. Changing this means a native addon or a different socket design |
|
|
46
|
+
| **Gate: revoked Skill generations stay readable on disk** until they are pruned | Sessions admitted before the revocation may still read them. Every new use is refused, in every mode |
|
|
47
|
+
| **Gate: the host binary is matched by path, not by inode** | An inode check would refuse every host after a normal upgrade. A process that fakes the path can only be the user's own, which [What it does not protect against](#what-it-does-not-protect-against) already covers |
|
|
48
|
+
| **Codex: a user can rename `~/.codex`** to get around `--lock-user-skill-folders` | Listed in the [Codex guide](hosts/codex.md#what-codex-leaves-to-your-organisation); `gate doctor` reports it. Preventing it needs control of the home directory, which the organisation has, not mago-ski |
|
|
49
|
+
|
|
38
50
|
## Revocation timing
|
|
39
51
|
|
|
40
52
|
Revocation is not instant everywhere. A host acts on a revocation once it reads the updated list. Until then it accepts its current list for as long as that list is unexpired, so the list's lifetime (30 days by default, set with `--expires`) is the longest a revoked certificate can still pass. Shorten it for high-risk organizations and republish often (`revoke refresh`). The host state file stops a host from being moved back to an older list. In CI there is no state file; the Action reads the list from the protected base revision, so a revocation applies to pull requests once it is merged there. With `freshness` in a v2 policy, the bound drops to the timestamp's `max_lifetime` (24 hours by default): a host that is not given the new list stops trusting the old one when its timestamp expires.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mago-foundation/mago-ski",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0-beta.1",
|
|
4
4
|
"description": "Skills PKI: organization-approved, exact-version Skill certificates enforced on the agent host",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "The Mago Foundation",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"test:live:claude-code": "node tests/live/claude-code-gate.live.ts",
|
|
41
41
|
"test:live:codex": "node tests/live/codex-gate.live.ts",
|
|
42
42
|
"live:scenarios": "node scripts/live-scenarios.mjs",
|
|
43
|
+
"sast": "semgrep scan --config .semgrep.yml --error --metrics=off --timeout 60",
|
|
43
44
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
44
45
|
},
|
|
45
46
|
"peerDependencies": {
|
|
@@ -78,5 +79,8 @@
|
|
|
78
79
|
"extensions": [
|
|
79
80
|
"./dist/hosts/pi/index.js"
|
|
80
81
|
]
|
|
82
|
+
},
|
|
83
|
+
"dependencies": {
|
|
84
|
+
"yaml": "2.9.1"
|
|
81
85
|
}
|
|
82
86
|
}
|