-
Notifications
You must be signed in to change notification settings - Fork 0
fix: make macOS Keychain repair action-based #70
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,3 +63,9 @@ jobs: | |
| - uses: golangci/golangci-lint-action@v7 | ||
| with: | ||
| version: v2.12.2 | ||
|
|
||
| test-scripts: | ||
| runs-on: ubuntu-latest | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Fix: change the runner to Reply inline to this comment. |
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - run: make test-scripts | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| # Scripts | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. File-level note: scripts/README.md The README documents scripts/repair-macos-keychain-credentials.sh --keychain ~/Library/Keychains/login.keychain-dbReply inline to this comment. |
||
|
|
||
| Shared support scripts for Open CLI Collective repositories. | ||
|
|
||
| ## `repair-macos-keychain-credentials.sh` | ||
|
|
||
| Repairs macOS Keychain generic-password ACLs for Collective CLI credentials | ||
| that still trust ad-hoc or per-build `cdhash` identities instead of the current | ||
| stable-signed CLI binaries. | ||
|
|
||
| Default mode is inspect-only: | ||
|
|
||
| ```bash | ||
| scripts/repair-macos-keychain-credentials.sh | ||
| ``` | ||
|
|
||
| Preview an additive heal: | ||
|
|
||
| ```bash | ||
| scripts/repair-macos-keychain-credentials.sh --heal | ||
| ``` | ||
|
|
||
| Apply an additive heal: | ||
|
|
||
| ```bash | ||
| scripts/repair-macos-keychain-credentials.sh --heal --apply | ||
| ``` | ||
|
|
||
| Clean up already-healed `stable+stale-cdhash` items by rebuilding them into | ||
| canonical metadata and stable app ACLs: | ||
|
|
||
| ```bash | ||
| scripts/repair-macos-keychain-credentials.sh --cleanup | ||
| scripts/repair-macos-keychain-credentials.sh --cleanup --apply | ||
| ``` | ||
|
|
||
| Use the heavy rebuild path when an item should be recreated canonically from its | ||
| current secret value: | ||
|
|
||
| ```bash | ||
| scripts/repair-macos-keychain-credentials.sh --rebuild --tool nrq | ||
| scripts/repair-macos-keychain-credentials.sh --rebuild --tool nrq --apply | ||
| ``` | ||
|
|
||
| Limit discovery to one or more tools: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Reply inline to this comment. |
||
|
|
||
| ```bash | ||
| scripts/repair-macos-keychain-credentials.sh --tool cr --tool nrq | ||
| ``` | ||
|
|
||
| Run this as the normal macOS user who owns the login Keychain, not with `sudo`. | ||
| Real mutation requires `--apply` plus exactly one action: `--heal`, `--cleanup`, | ||
| or `--rebuild`. `--apply` alone exits without scanning or mutating. | ||
|
|
||
| `--heal --apply` does not read, print, delete, or recreate secret values. It is | ||
| intentionally additive: it appends missing stable-signed trusted application | ||
| grants to explicit decrypt ACL app lists and preserves existing trusted | ||
| applications. It skips `NULL` or non-explicit app-list ACLs instead of narrowing | ||
| their meaning. | ||
|
|
||
| `--cleanup --apply` and `--rebuild --apply` read the existing secret value, | ||
| delete the old Keychain item, and recreate it with canonical label, | ||
| description, and stable-signed app ACLs. They never print secrets or pass them | ||
| as process arguments. | ||
|
|
||
| `stable+stale-cdhash` means the current stable-signed app is already trusted. | ||
| macOS may still report older cdhash grants or partition metadata for that item; | ||
| the script treats that state as repaired. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File-level note: .github/workflows/ci.yml
ci.md §1requires aconcurrencygroup keyed on the ref withcancel-in-progress: true(MUST). The workflow has noconcurrencyblock, so rapid pushes or re-pushes on the same ref queue redundant runs rather than cancelling the superseded one. This is pre-existing, but this PR modifiesci.ymland is the natural place to add it.Suggested addition immediately after the
on:block:Reply inline to this comment.