trackslash
VAULT-106 P2 For an agent

Mac app: first launch sets the App Lock Password, and the lock screen

0
Sub-issue of VAULT-101 P2 A native Mac app

Description

Part of VAULT-101. It needs VAULT-105.

Bradley decided the Mac app requires an App Lock Password, so the Mac vault is only ever the encrypted vault file (G33).

First launch sets the App Lock Password before anything else:

  • the same rules as iOS: at least 8 characters, not only numbers (G27);
  • the same warning that it can't be reset (G30);
  • no way to skip it, and no Turn Off Password on the Mac.

There's no unencrypted store to convert from.

The lock screen:

  • Touch ID, Apple Watch or the Mac's password through LocalAuthentication, then the App Lock Password;
  • the shared unlock service, with the same deadline, attempt counter and waits (G11, G19, G26).

Locking:

  • straight away, or after the Require Unlock delay, when the app is left;
  • always and at once when the screen locks, the Mac sleeps, or the user switches away, whatever the delay;
  • locking drops the vault's items, caches, search and keys (G29).

Duress and erasing come from the same shared code as iOS:

  • set duress password, in every vault alike (G76);
  • erase after 10, if turned on (G18, G20).

Tests: unit tests for the Mac lock triggers, and a UI test of first launch through to unlocking, with the in-memory test vault.

Done when

A fresh install can't be used until a password is set, and the app locks on every trigger above. The new behaviour is in docs/security-model.md.

GitHub

0

No branches or pull requests linked.

Comments

1
Bradley

Fixed in https://github.com/badbundle/vault-app/pull/716 (merged as 391822ed).

  • The Mac app's first launch asks for the App Lock Password before anything else, and nothing skips it. Until then the vault is an empty store in memory, so no unencrypted vault is ever written. An erase goes back to the first launch.
  • The lock screen and unlock use the shared App Lock services. Vault locks at once when the screen locks, the screen saver starts, the Mac or its displays sleep, or another account takes over. It also locks when another app comes to the front (at once or after the Require Unlock delay), with Lock Vault (⌃⌘L), and on quitting. Other windows only say Vault is locked.
  • Signing: the Mac's data protection keychain refuses an app without a provisioning profile, so this Mac (the Mac Studio) was registered in the developer account and a "Vault Mac Development" profile was made for com.badbundle.vault (it expires on 2027-10-05). Debug builds of the Mac app sign with it. docs/mac-app.md (decision 7, Signing) records this.
  • Mac snapshots no longer depend on the screen being unlocked, with a channel-tolerance comparison in place of SnapshotTesting's perceptual one, which throws inside Core Image on macOS 27.
  • The Mac UI tests launch the app with -ApplePersistenceIgnoreState YES. Launched by a test, the app opens no window at all if macOS has saved state for it.
  • docs/security-model.md: G84 updated, G85 and G86 added.