-
Notifications
You must be signed in to change notification settings - Fork 6
chore: make local admission resource safe #491
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
Open
qnbs
wants to merge
29
commits into
main
Choose a base branch
from
h1-d-intel-qualification
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,135
−80
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
bace9bf
chore: make local admission resource safe
qnbs a3287ed
fix: avoid cache key secret scan false positive
qnbs a656835
fix: harden local admission policy checks
qnbs e295616
fix: close admission review gaps
qnbs c36b9f0
fix: close admission review gaps
qnbs 3445f7e
fix: harden admission review controls
qnbs cef5001
fix: close admission review gaps
qnbs b4f281b
fix: harden admission edge cases
qnbs 591671e
fix: close local admission review gaps
qnbs 43f3565
fix: harden bounded admission cleanup
qnbs 9ce0697
fix: close workflow and admission review gaps
qnbs 71fa70f
fix: close admission trigger review gaps
qnbs 161550e
fix: harden local admission termination and release policy checks
qnbs a4117a4
fix: fail closed on unresolved admission state
qnbs bd9f10d
fix: close review gaps in admission policy guards
qnbs 35adf7f
fix: harden qualification and diff policy checks
qnbs 8a5ab2d
fix: close release mutation and aggregate guard gaps
qnbs 0947aa3
fix: close latest review gaps in local admission
qnbs d017ee8
fix: close scanner descriptors on allocation failure
qnbs 811d391
fix: close workflow policy bypass classes
qnbs cad6b34
fix: normalize quoted workflow policy keys
qnbs 1807529
fix: close review policy edge cases
qnbs b303cb2
fix: close admission review edge cases
qnbs 05359d5
fix: close subprocess and workflow policy races
qnbs 52fb719
refactor: converge local admission authorities
qnbs e4c285e
fix: close exact-tree admission review findings
qnbs d93e992
fix: close process and workflow policy review findings
qnbs df19fae
fix: close latest workflow admission findings
qnbs 9bbeded
fix: close final workflow admission review findings
qnbs 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
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,167 @@ | ||
| # Non-publishing Intel qualification; this workflow never creates a release or latest.json. | ||
| name: Tauri Intel qualification | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| qualification_ref: | ||
| description: Exact branch, tag, or SHA to qualify (defaults to the dispatched ref) | ||
| required: false | ||
| type: string | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: tauri-intel-qualification-${{ github.ref }}-${{ inputs.qualification_ref || github.sha }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| resolve-ref: | ||
| name: Resolve qualification ref | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| outputs: | ||
| sha: ${{ steps.resolve.outputs.sha }} | ||
| steps: | ||
| - name: Resolve requested ref once | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| ref: ${{ inputs.qualification_ref || github.sha }} | ||
| fetch-depth: 1 | ||
| persist-credentials: false | ||
| - name: Export immutable qualification SHA | ||
| id: resolve | ||
| run: | | ||
| set -euo pipefail | ||
| sha="$(git rev-parse HEAD)" | ||
| git cat-file -e "$sha^{commit}" | ||
| printf 'sha=%s\n' "$sha" >> "$GITHUB_OUTPUT" | ||
| printf 'resolved_sha=%s\n' "$sha" > qualification-resolved-ref.txt | ||
| cat qualification-resolved-ref.txt | ||
|
|
||
| qualify: | ||
| name: ${{ matrix.role }} (${{ matrix.runner }}) | ||
| runs-on: ${{ matrix.runner }} | ||
| needs: [resolve-ref] | ||
| timeout-minutes: 60 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - runner: macos-15-intel | ||
| role: primary-production-candidate | ||
| - runner: macos-26-intel | ||
| role: advisory-forward-compatibility | ||
|
|
||
| steps: | ||
| - name: Check out the exact qualification ref | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| ref: ${{ needs.resolve-ref.outputs.sha }} | ||
| fetch-depth: 1 | ||
| persist-credentials: false | ||
|
|
||
| - name: Record source ref | ||
| env: | ||
| REQUESTED_REF: ${{ inputs.qualification_ref || github.sha }} | ||
| RESOLVED_REF: ${{ needs.resolve-ref.outputs.sha }} | ||
| run: | | ||
| set -euo pipefail | ||
| printf 'source_ref=%s\n' "$(git rev-parse HEAD)" > qualification-source.txt | ||
| printf 'requested_ref=%s\n' "$REQUESTED_REF" >> qualification-source.txt | ||
| printf 'resolved_ref=%s\n' "$RESOLVED_REF" >> qualification-source.txt | ||
| cat qualification-source.txt | ||
|
|
||
| - uses: ./.github/actions/setup | ||
|
|
||
| - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable | ||
|
|
||
| - uses: Swatinem/rust-cache@f0d9c3887740aee45f6153b24b3a6b815192ec16 # v2 | ||
| with: | ||
| workspaces: src-tauri | ||
| cache-all-crates: true | ||
| prefix-key: "intel-qual-v1" | ||
|
|
||
| - name: Install macOS packaging dependency | ||
| run: brew install create-dmg | ||
|
|
||
| - name: Prepare non-publishing bundle configuration | ||
| run: | | ||
| set -euo pipefail | ||
| # QNBS-v3: qualification must not publish or mutate release metadata. | ||
| jq '.bundle.createUpdaterArtifacts = false' src-tauri/tauri.conf.json > src-tauri/tauri.conf.json.tmp | ||
| mv src-tauri/tauri.conf.json.tmp src-tauri/tauri.conf.json | ||
| printf 'updater_artifacts=disabled\n' > qualification-config.txt | ||
| printf 'release_publication=disabled\n' >> qualification-config.txt | ||
| cat qualification-config.txt | ||
|
|
||
| - name: Build non-publishing Tauri bundle | ||
| run: | | ||
| set -euo pipefail | ||
| pnpm exec tauri build | ||
|
|
||
| - name: Verify Intel architecture and deployment target | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| test "$(uname -s)" = "Darwin" | ||
| host_arch="$(uname -m)" | ||
| test "$host_arch" = "x86_64" | ||
|
|
||
| app="$(find src-tauri/target/release/bundle -type d -name '*.app' -print -quit)" | ||
| test -n "$app" | ||
| executable_name="$(/usr/libexec/PlistBuddy -c 'Print :CFBundleExecutable' "$app/Contents/Info.plist")" | ||
| executable="$app/Contents/MacOS/$executable_name" | ||
| test -x "$executable" | ||
|
|
||
| file "$executable" | tee qualification-file.txt | ||
| grep -Eq 'x86_64' qualification-file.txt | ||
| lipo -info "$executable" | tee qualification-lipo.txt | ||
| lipo_archs="$(lipo -archs "$executable")" | ||
| test "$lipo_archs" = "x86_64" | ||
|
|
||
| load_commands="$(otool -l "$executable")" | ||
| printf '%s\n' "$load_commands" > qualification-otool.txt | ||
| minimum_os="$(awk '/LC_BUILD_VERSION/{mode="build"; next} /LC_VERSION_MIN_MACOSX/{mode="legacy"; next} mode == "build" && $1 == "minos"{print $2; exit} mode == "legacy" && $1 == "version"{print $2; exit}' qualification-otool.txt)" | ||
| test "$minimum_os" = "11.0" | ||
|
|
||
| dmg="$(find src-tauri/target/release/bundle -type f -name '*.dmg' -print -quit)" | ||
| test -n "$dmg" | ||
| test -s "$dmg" | ||
|
|
||
| updater_bundles="$(find src-tauri/target/release/bundle -type f \( -name '*.app.tar.gz' -o -name '*.app.tar.gz.sig' \) -print)" | ||
| printf 'updater_bundles=%s\n' "$updater_bundles" > qualification-updater-check.txt | ||
| test -z "$updater_bundles" | ||
|
|
||
| cat > qualification-result.json <<EOF | ||
| { | ||
| "runner": "${{ matrix.runner }}", | ||
| "role": "${{ matrix.role }}", | ||
| "sourceRef": "$(git rev-parse HEAD)", | ||
| "hostArchitecture": "$host_arch", | ||
| "binaryArchitecture": "x86_64", | ||
| "minimumMacOS": "$minimum_os", | ||
| "appBundle": "$app", | ||
| "dmg": "$dmg", | ||
| "updaterBundle": "NOT_PRODUCED: non-publishing qualification", | ||
|
qnbs marked this conversation as resolved.
|
||
| "releasePublication": false | ||
| } | ||
| EOF | ||
| cat qualification-result.json | ||
|
|
||
| - name: Upload qualification evidence | ||
| if: ${{ !cancelled() }} | ||
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | ||
|
qnbs marked this conversation as resolved.
|
||
| with: | ||
| name: tauri-intel-qualification-${{ matrix.runner }} | ||
| path: | | ||
| qualification-source.txt | ||
| qualification-config.txt | ||
| qualification-result.json | ||
| qualification-updater-check.txt | ||
| qualification-file.txt | ||
| qualification-lipo.txt | ||
| qualification-otool.txt | ||
| if-no-files-found: warn | ||
| retention-days: 30 | ||
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
Oops, something went wrong.
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.