Repository navigation
fix(server,web,shared,apple): follow-ups found while hardening (ISSUE-28 · ISSUE-29 · ISSUE-25 · ISSUE-23 · ISSUE-20 · ISSUE-31 · ISSUE-18 · ISSUE-17 · ISSUE-19 · ISSUE-30 · ISSUE-24 · ISSUE-26 · ISSUE-27 · ISSUE-34 · ISSUE-36 · ISSUE-37) #33
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
34 commits
Select commit
Hold shift + click to select a range
ea81733
fix(server): staging and the hourly sweep refuse an org's .viewswitch…
2witstudios 3ac9acc
fix(server): the library scan, org.json and a set's removal never rea…
2witstudios 96957d5
fix(web,server): the Orgs show's library has its own cache key; the S…
2witstudios 0da1dc0
fix(server): a new org is filled in staging and renamed into place; t…
2witstudios 1e9340d
fix(server): a hand-edited settings.json is followed while the server…
2witstudios 09e0932
fix(apple): each build has its own server log, the ad hoc build passe…
2witstudios aa655eb
feat(shared): checkPack warns about a show's name or initial in a scr…
2witstudios fb873db
fix(apple): the ad hoc build launches: library validation off for --u…
2witstudios 0c8fe59
perf(web): a _shared/ change reloads only the views that use that fol…
2witstudios 6bb6417
perf(server): one library change costs one scan: a finished scan is k…
2witstudios 9f027ca
perf(server,web): a library change carries each changed view's hash, …
2witstudios fd97078
fix(server,shared,apple): flushes publish in order, style attributes …
2witstudios 27f85ee
fix(server,web,apple): a linked staging token or projects/ is never w…
2witstudios 7f41b16
fix(server): scene titles are read from the checked real path with O_…
2witstudios 061e5a8
fix(web,server,shared,apple): the org's own views follow any shared c…
2witstudios 67c40d9
fix(server): the title cache stamps through a no-link open too, so a …
2witstudios 1e948e5
fix(server,web,apple): one failed flush can't stall the rest, the A→B…
2witstudios c117088
fix(server,shared): a named pipe named like a view can't hang the sca…
2witstudios fa9dcec
fix(server): every full read of a library file goes through one no-li…
2witstudios 697440d
fix(server,shared): the scan's JSON and manifests read no-link and no…
2witstudios ac6b42a
fix(server,shared): a read-only starter's folders are made writable t…
2witstudios 6cb25bc
fix(server): read_file, write_file, the on-air guard, duplicate and n…
2witstudios e258e7b
refactor(server): an install reads staged files straight from raw wit…
2witstudios ddb1b83
fix(server,shared): a view's <style> comments still warn (a page's fi…
2witstudios 7813fd6
fix(server): the guide and the library kit read non-blocking plain fi…
2witstudios ef9448e
fix(server,shared): a file the on-air scan can't read marks its list …
2witstudios 5f0f7c8
fix(server): the guard names an on-air file it can't read instead of …
2witstudios 046c4b6
fix(server,shared): stale on-air refs don't block agents, customize c…
2witstudios 117f237
fix(server): the unreadable-file refusal says what it now means (a di…
2witstudios f10118d
fix(server): an on-air ref is unknown only when /library/ would serve…
2witstudios 26d0941
test(server): the kit leaves a folder or pipe alone, and an on-air fi…
2witstudios c3d3d0d
fix(server): resolveInLibrary says no permission as that and passes a…
2witstudios 8f5a9e5
fix(server): an on-air ref that is a dangling link lists where it poi…
2witstudios 807bc78
fix(server): on-air refs are followed through links for every ref, fr…
2witstudios 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| <plist version="1.0"> | ||
| <!-- mac:build --unsigned only (scripts/build.sh). An ad hoc signature has no team, and the hardened | ||
| runtime's library validation refuses a framework (Sparkle) whose team doesn't match the app's, | ||
| so an ad hoc app on the runtime can't launch without this. A Developer ID build never has it. --> | ||
| <dict> | ||
| <key>com.apple.security.cs.disable-library-validation</key> | ||
| <true/> | ||
| </dict> | ||
| </plist> |
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,11 @@ | ||
| # Checks build.sh runs on what it signed. Sourced; also sourced by sign-check.test.ts. | ||
|
|
||
| # Whether the code at <path> is signed for the hardened runtime: the runtime bit (0x10000) of its | ||
| # code directory's flags, whatever else is set beside it. A Developer ID signature reads | ||
| # flags=0x10000(runtime), an ad hoc one (mac:build --unsigned) flags=0x10002(adhoc,runtime). | ||
| hardened_runtime() { | ||
| local out flags | ||
| out="$(codesign -dv "$1" 2>&1 || true)" | ||
| flags="$(sed -n 's/.*CodeDirectory .*flags=0x\([0-9a-fA-F]*\).*/\1/p' <<<"$out" | head -1)" | ||
| [ -n "$flags" ] && (( (16#$flags & 16#10000) != 0 )) | ||
| } |
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,34 @@ | ||
| // sign-check.sh's hardened-runtime check on real code signatures (copies of /usr/bin/true, signed | ||
| // here), run through macOS's own bash (3.2), as build.sh runs it. | ||
| import { afterAll, describe, expect, test } from "bun:test"; | ||
| import { copyFileSync, mkdtempSync, rmSync, writeFileSync } from "node:fs"; | ||
| import { tmpdir } from "node:os"; | ||
| import { join } from "node:path"; | ||
|
|
||
| const check = join(import.meta.dir, "sign-check.sh"); | ||
| const dir = mkdtempSync(join(tmpdir(), "vs-sign-")); | ||
| afterAll(() => rmSync(dir, { recursive: true, force: true })); | ||
| const canSign = process.platform === "darwin" && Bun.which("codesign") !== null; | ||
|
|
||
| /** A copy of /usr/bin/true signed ad hoc with `options`; its path. */ | ||
| function signed(name: string, options: string[]) { | ||
| const path = join(dir, name); | ||
| copyFileSync("/usr/bin/true", path); | ||
| const r = Bun.spawnSync(["codesign", "--force", ...options, "--sign", "-", path]); | ||
| if (r.exitCode !== 0) throw new Error(r.stderr.toString()); | ||
| return path; | ||
| } | ||
| const hardened = (path: string) => Bun.spawnSync(["/bin/bash", "-c", `source "${check}"; hardened_runtime "$1"`, "_", path]).exitCode === 0; | ||
|
|
||
| describe.skipIf(!canSign)("hardened_runtime", () => { | ||
| test("an ad hoc signature on the hardened runtime (mac:build --unsigned) passes", () => { | ||
| expect(hardened(signed("adhoc-runtime", ["--options", "runtime"]))).toBe(true); | ||
| }); | ||
| test("a signature without the runtime fails, and so does unsigned or missing code", () => { | ||
| expect(hardened(signed("adhoc", []))).toBe(false); | ||
| expect(hardened(join(dir, "nothing-here"))).toBe(false); | ||
| const plain = join(dir, "plain.txt"); | ||
| writeFileSync(plain, "not code"); | ||
| expect(hardened(plain)).toBe(false); | ||
| }); | ||
| }); |
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.