-
Notifications
You must be signed in to change notification settings - Fork 0
security: lock mise runtime artifacts #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
fc6d7e0
security: add locked mise runtime config
eXPerience83 ecc8f22
security: commit mise runtime artifacts
eXPerience83 01fa193
security: validate mise runtime lock
eXPerience83 d6fae66
security: add mise lock regeneration helper
eXPerience83 76d33ee
security: install mise runtimes from lockfile
eXPerience83 1eb6c0c
security: validate locked mise build inputs
eXPerience83 ed21ab9
security: regenerate mise lock in upstream automation
eXPerience83 0a7a0f4
docs: explain locked runtime maintenance
eXPerience83 d9a78d2
docs: link runtime lock maintenance guide
eXPerience83 3e83778
docs: record locked mise runtime security
eXPerience83 6cda75a
security: reverify locked runtime provenance
eXPerience83 ca310fe
security: validate provenance re-verification
eXPerience83 662ab23
docs: explain locked provenance verification
eXPerience83 69832a0
security: disable unused mise experimental features
eXPerience83 2c5b3a5
ci: bound mise lock regeneration time
eXPerience83 63c2e49
security: guard mise cache cleanup path
eXPerience83 a0f66bb
refactor: split mise lock validation helpers
eXPerience83 15f929e
chore: include mise lock in CodeRabbit review
eXPerience83 d0bc259
fix: preserve full CodeRabbit review scope
eXPerience83 332c55e
security: harden mise lock schema validation
eXPerience83 c75e87d
test: cover adversarial mise lock inputs
eXPerience83 32d761e
test: run mise lock validation cases in CI
eXPerience83 850a560
chore: narrow CodeRabbit lockfile review override
eXPerience83 6a7e156
test: make mise lock mutations version-independent
eXPerience83 aad84e7
chore: keep review policy changes separate
eXPerience83 ab3c8a9
security: isolate mise lock regeneration inputs
eXPerience83 ceef08f
test: exercise isolated mise lock regeneration
eXPerience83 8efe75e
test: run isolated lock regeneration cases in CI
eXPerience83 93ab5c6
fix: validate mise regeneration timeouts
eXPerience83 f1b44eb
test: cover regeneration timeout validation
eXPerience83 db84742
security: require cross-platform lock coherence
eXPerience83 4087e71
test: cover cross-platform lock coherence
eXPerience83 42b70b8
security: serialize upstream update writes
eXPerience83 25e445f
docs: describe fail-closed lock validation
eXPerience83 c7da89f
fix: replace regenerated mise lock atomically
eXPerience83 a09af10
fix: publish edge for mise lock changes
eXPerience83 3537e4c
test: cover atomic mise lock replacement
eXPerience83 50b4269
test: require edge publication for lock inputs
eXPerience83 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # Locked mise runtimes | ||
|
|
||
| Python, Node.js and uv are installed by mise, but their build inputs are committed rather than resolved dynamically during the image build. | ||
|
|
||
| ## Source of truth | ||
|
|
||
| The runtime pins are represented in three places for different purposes: | ||
|
|
||
| - `versions.env` supplies reviewed repository and build arguments. | ||
| - `mise.toml` declares the exact mise-managed runtime versions and enables provenance re-verification for locked installs. | ||
| - `mise.lock` records the resolved Linux AMD64 and ARM64 artifact URLs, SHA-256 checksums and available provenance requirements. | ||
|
|
||
| `scripts/validate-version-pins.sh` fails when these files or the base Dockerfile disagree. The lock validator treats both TOML files as security-sensitive schemas: unknown sections or fields, malformed platform values, unexpected backends or URLs, invalid checksums, missing provenance, mixed Python build dates and reused uv asset IDs are rejected. Adversarial fixtures exercise these rejection paths on every validation run. | ||
|
|
||
| The Dockerfile copies `mise.toml` and `mise.lock` as read-only inputs and runs `mise install --locked`; a missing artifact entry, dynamic-resolution requirement, provenance failure or checksum mismatch stops the build. `locked_verify_provenance = true` ensures that Python and uv GitHub artifact attestations are checked during installation instead of trusting only the provenance marker already stored in the lockfile. | ||
|
|
||
| The current CI builds Linux AMD64, so it downloads, checksums, installs and re-verifies provenance for the AMD64 artifacts. ARM64 entries are checked for exact schema, platform, backend, URL, checksum and provenance metadata coherence, but are not executed by the current AMD64 job. A future ARM64 image build will use the same locked installation and re-verification path before ARM64 publication. | ||
|
|
||
| npm is intentionally excluded from `mise.lock` because the image installs it separately from the npm registry. | ||
|
|
||
| ## Regenerate the lockfile | ||
|
|
||
| Use the exact mise release pinned by `MISE_VERSION` in `versions.env`. The helper rejects any other mise version. It copies only `versions.env`, `mise.toml` and the existing `mise.lock` into a temporary workspace, clears inherited `MISE_*` settings, uses isolated config/data/cache/system/tmp directories, bounds network and command time, validates the generated lock and replaces the repository lock only after validation succeeds. A failed or malformed regeneration leaves the previous lock untouched. | ||
|
|
||
| ```bash | ||
| source versions.env | ||
| mise --version | ||
| bash scripts/regenerate-mise-lock.sh | ||
| bash scripts/validate-version-pins.sh | ||
| ``` | ||
|
|
||
| When changing Python, Node.js or uv: | ||
|
|
||
| 1. Update the version in `versions.env`. | ||
| 2. Update the matching `ARG` default in `images/base/Dockerfile`. | ||
| 3. Update the matching tool in `mise.toml`. | ||
| 4. Run `scripts/regenerate-mise-lock.sh` with the pinned mise release. | ||
| 5. Review every changed URL, SHA-256 and provenance field for both `linux-x64` and `linux-arm64`. | ||
| 6. Run `make validate` and build the AMD64 images so mise verifies the current-platform downloaded artifacts and supported provenance. | ||
|
|
||
| The daily upstream workflow follows the same procedure with a freshly downloaded mise binary whose SHA-256 is verified before it regenerates the lock. A plain `mise lock` refreshes artifact metadata for the already pinned versions, so the workflow may propose a lock-only change when an upstream provider publishes a newer artifact for an unchanged runtime version. The workflow is restricted to `main`, serialized to prevent competing writers and uses a force-with-lease update for its dedicated automation branch. | ||
|
|
||
| ## Recovery | ||
|
|
||
| Do not remove `--locked`, disable `locked_verify_provenance`, delete `mise.lock` or fall back to `mise use` to work around a stale lock. Regenerate the lock with the exact pinned mise version, review the artifact changes, and keep the version/config/lock updates in one pull request. | ||
|
|
||
| If a checksum has changed unexpectedly for an artifact URL that should be immutable, stop the update and investigate upstream before merging. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| [settings] | ||
| lockfile = true | ||
| locked_verify_provenance = true | ||
| lockfile_platforms = ["linux-x64", "linux-arm64"] | ||
|
|
||
| [tools] | ||
| python = "3.14.6" | ||
| node = "24.18.0" | ||
| uv = "0.11.32" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.