-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Revert Entitlement related changes from #116659 #119824
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR reverts entitlement-related functionality from #116659 to improve security by not preserving entitlements by default in macOS code signing. The changes focus on removing entitlement blob support from the MachO signing infrastructure.
Key Changes
- Removes entitlement preservation logic from macOS code signing operations
- Eliminates entitlement-specific blob classes and enum values
- Simplifies signature size calculations by removing entitlement considerations
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/native/corehost/apphost/static/CMakeLists.txt | Removes entitlements from single file host signing |
| src/installer/tests/Microsoft.NET.HostModel.Tests/MachObjectSigning/SigningTests.cs | Removes entitlement-related tests and helper methods |
| src/installer/managed/Microsoft.NET.HostModel/MachO/MachObjectFile.cs | Simplifies signing API by removing entitlement parameters |
| src/installer/managed/Microsoft.NET.HostModel/MachO/Enums/CodeDirectorySpecialSlot.cs | Removes entitlement enum values |
| src/installer/managed/Microsoft.NET.HostModel/MachO/Enums/BlobMagic.cs | Removes entitlement magic constants |
| src/installer/managed/Microsoft.NET.HostModel/MachO/BinaryFormat/Blobs/EntitlementsBlob.cs | Deletes entire entitlements blob class |
| src/installer/managed/Microsoft.NET.HostModel/MachO/BinaryFormat/Blobs/EmbeddedSignatureBlob.cs | Removes entitlement blob handling from signature creation |
| src/installer/managed/Microsoft.NET.HostModel/MachO/BinaryFormat/Blobs/DerEntitlementsBlob.cs | Deletes entire DER entitlements blob class |
| src/installer/managed/Microsoft.NET.HostModel/MachO/BinaryFormat/Blobs/CodeDirectoryBlob.cs | Removes entitlement hash calculations |
| src/installer/managed/Microsoft.NET.HostModel/MachO/BinaryFormat/Blobs/BlobParser.cs | Removes entitlement blob parsing cases |
| src/installer/managed/Microsoft.NET.HostModel/Bundle/Bundler.cs | Updates bundle signing to not pass entitlement parameters |
|
Tagging subscribers to this area: @vitek-karas, @agocke |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
|
/backport to release/10.0 |
|
Started backporting to release/10.0: https://github.com/dotnet/runtime/actions/runs/17871893425 |
* Revert Entitlements related changes from dotnet#116659 * Re-add entitlements to singlefilehost * Typo --------- Co-authored-by: Andy Gocke <[email protected]>
Context: #119429
The entitlements for the apphost were preserved after #116659 for the reasons outlined in #113707. The primary reason was that when signing a Mac app with the hardened runtime setting, it wasn't clear that the entitlements needed to be reapplied. However, preserving the entitlements by default may keep more entitlements than is necessary, which is not the most secure default, and it can lead to issues like what was addressed in #119429. We should instead avoid preserving entitlements and add better documentation describing how to sign with the required entitlements.
This PR removes the Entitlements and DerEntitlements blobs, and removes reference to the entitlements blobs from all size calculations and equality operations. It is not a simple revert of #116659 because there were some other performance changes and tests not specific to the entitlements blobs in that PR.