Skip to content
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

Basic automation with URL scheme and other improvements #253

Merged
merged 10 commits into from Oct 23, 2023

Conversation

insidegui
Copy link
Owner

Improvements

  • Redesigns settings window for macOS Ventura and later 💅🏻
  • Fixes a memory leak that was leaking VMController instances 💦

Automation

This pull request introduces the virtualbuddy:// URL scheme that can be used to automate basic functions of the app. It's just the foundation for future developments in this area, which I currently plan on including a command-line interface and Shortcuts actions.

URL Scheme Actions

Here's the list of actions currently supported by the URL scheme:

open: Opens the Window for a Specific Virtual Machine

Example: virtualbuddy://open?name=macOS%20Sonoma

boot: Boots a Virtual Machine

This action supports options:

  • bootInRecoveryMode (macOS only): boots the VM in recovery mode
  • bootOnInstallDevice (Linux only): boots the VM from the installer ISO (if available)

Example: virtualbuddy://boot?name=macOS%20Sonoma&options.bootInRecoveryMode=true

stop: Stops a Virtual Machine

Example: virtualbuddy://stop?name=macOS%20Sonoma

Security Considerations

I didn't want to have a URL scheme that can control people's VMs without any sort of authentication, since any app on macOS can open any URL scheme without explicit permission from the user.

This PR includes the DeepLinkSecurity framework that implements an Apple TCC-like approach to user consent.

The first time an app attempts to open a URL scheme in VirtualBuddy, the user will be prompted to allow the app to do so. If allowed, the app may then continue to open URLs in VirtualBuddy, if not, all further attempts will be ignored.

Authentication is done by collecting the audit token from the open URL Apple Event, validating it against the app's code signature, then storing the user's decisions on the Keychain. This data is signed with a private key owned by VirtualBuddy, which is generated and stored on the Keychain the first time it's needed.

This prevents other apps from modifying the data directly in order to spoof authorization, since access to the private key owned by VirtualBuddy would trigger a Keychain permission prompt.

@insidegui insidegui merged commit d7414cc into main Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant