-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Support environment contraints (launch constraints and library contraints) #83
Comments
Some links that can help: Apple presentation at WWDC: https://developer.apple.com/videos/play/wwdc2023/10266/ XNU has some code related to it: https://github.com/search?q=repo%3Aapple-oss-distributions%2Fxnu%20launch%20constraints&type=code |
I think basic feature implementation will be pretty straightforward. All 4 flavors of environment constraints appear to be DER encoded plists stored as separate blobs in the embedded signature. Like entitlements. So I think for an initial pass we essentially need to allow user-defined plists to define constraints and then turn them into blobs if present. Open questions:
|
On first glance this appears to encode identically to entitlements plist DER. |
Actually, the DER decoded plist has some extra data in there:
Looks like the encoded plist is roughly equivalent to:
So we'll have to figure out what Fortunately, |
https://theevilbit.github.io/posts/launch_constraints_deep_dive/ has a great write-up of launch constraints internals. @theevilbit Thanks for writing up your insights on launch constraints! I was wondering if you have any knowledge to share on the DER/plist encoding of environment constraints inside Mach-O code signatures. From the previous comment, we see the user-provided constraints plist is joined by 3 additional keys: I'm guessing But I'm unsure what the others could be. Perhaps I'm not yet sure what So far every Mach-O with launch constraints I've come across has |
Hi, Sorry, no experience with these, but it certainly looks interesting. Csaba |
I have this feature mostly implemented locally. I'm going to hardcode If constraints take off in popularity, we can look into making it easier to generate pre-canned constraints policies during signing operations. |
There's a new blob (
0xfade8181
magic) defining launch constraints. There's also a new Lightweight Code Requirements primitive related to it.I haven't looked into it much and don't know how critical it is. Figured I'd file an issue to track implementing the missing feature.
The text was updated successfully, but these errors were encountered: