Skip to content

macOS entitlements and entries for Info.plist disallow developing and running certain types of apps via VSCode #119787

@kroko

Description

@kroko
  • VS Code Version: 1.54.3
  • OS Version: macOS 10.15.7 (19H524)

Steps to Reproduce:

  1. macOS specific
  2. Develop a project in VSCode that somewhere down the chain uses call to NSAppleScript. In my case it is an Electron project that spawns multiple native binaries written in Swift where one of them uses NSAppleScript and pipes data between Electron main process and native runtime.
  3. Run the project through VSCode terminal (in my case it is live reloading Electron project).
  4. macOS security system will not ask user permission to allow access for VSCode to some other apps AE dictionary.
  5. Yes, VSCode, not the app developed via VSCode, because VSCode encapsulates the process and spawned subprocesses, it is the main bundle in this case.
  • When some process wants to access AE dictionaries for other apps a permission to macOS is asked which in turn results in permissions dialog represented to user. Permission can be denied or granted, and the entry with chosen allowance will show up in Automation anchor under System preferences : Security & Privacy.
  • In order for this to work the bundle that encapsulates the runtime that uses AE has to have

entitlement

<key>com.apple.security.automation.apple-events</key>
<true/>

Info.plist entry

<key>NSAppleEventsUsageDescription</key>
<string>Bla bla</string>

N.B. Entries NSAppleScriptEnabled and OSAScriptingDefinition are different beasts.

  • Due to VSCode entitlements and Info.plist settings the call will not go through, that is - process running in VSCode terminal will not signal macOS gatekeeper that permission to access specific app AE is asked, user (in this case a developer using VSCode) will not be notified, System preferences : Security & Privacy : Automation will not populate, and app development/debugging cannot happen.
  • Note that current VSCode setup passes through subprocesses that need Accessibility and Screen Recording permissions (I use them in my binaries, too) - System preferences : Security & Privacy anchors Accessibility and Screen Recording will populate. Not relevant to me, but I imagine that other permissions under com.apple.security.* cases might fail Apple docs on Hardened Runtime

IMHO, VSCode should open up permissions as its terminal serves for live debugging apps that may ask different kind of permissions to OS. Due to the very nature of VSCode I consider this to be a bug not missing feature.

Does this issue occur when all extensions are disabled?: Yes

Metadata

Metadata

Assignees

Labels

author-verification-requestedIssues potentially verifiable by issue authorbugIssue identified by VS Code Team member as probable buginsiders-releasedPatch has been released in VS Code InsidersmacosIssues with VS Code on MAC/OS XterminalGeneral terminal issues that don't fall under another labelverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions