Skip to content

madsmtm/check_execution_policy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Checking macOS execution policies

Motivated by discussion on the Rust Zulip to allow detecting when launching binaries for the first time will take ~200ms for Gatekeeper to do its thing.

The idea would be to someday warn against this in Cargo or similar.

NOTE: It seems that adding Terminal to Developer Tools and then removing it again doesn't take effect immediately. So when testing the slowdown, you need to wait a little bit before relaunching Terminal, until XProtect (or whatever?) has cleared its cache.

Xcode

Xcode avoids all this by having the com.apple.private.tcc.allow entitlement with the kTCCServiceDeveloperTool value set.

TODO: Could Cargo be signed in a way that it gets this entilement too? Probably not, right?

And even if it could, it wouldn't matter, since seems to only be "top-level" processes that matter?

Debuggers

By default, LLDB resets TCC (Transparency, Consent, and Control) provenance, requiring the process being debugged itself to be marked as a Developer Tool. You can opt to instead forward the parent process' permissions with the target.inherit-tcc setting:

lldb -O 'settings set target.inherit-tcc true' target/debug/check_execution_policy

Resources

Various resources:

About

Small script to detect if you're running with "Developer Tool" privileges

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages