mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-09-24 14:55:37 +00:00
ci(macos): reject unreviewed root entitlements
This commit is contained in:
@@ -72,6 +72,17 @@ describe("macOS distribution entitlement policy", () => {
|
||||
"distribution build must not enable com.apple.security.get-task-allow",
|
||||
]);
|
||||
});
|
||||
|
||||
it("rejects unreviewed root runtime exceptions", () => {
|
||||
expect(
|
||||
collectEntitlementErrors({
|
||||
...validEntitlements,
|
||||
"com.apple.security.cs.allow-dyld-environment-variables": true,
|
||||
}),
|
||||
).toEqual([
|
||||
"unexpected root application entitlement: com.apple.security.cs.allow-dyld-environment-variables",
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("macOS distribution architecture policy", () => {
|
||||
|
||||
@@ -8,6 +8,8 @@ export const REQUIRED_MACOS_ENTITLEMENTS = Object.freeze([
|
||||
"com.apple.security.device.camera",
|
||||
]);
|
||||
|
||||
const ALLOWED_MACOS_ENTITLEMENTS = new Set(REQUIRED_MACOS_ENTITLEMENTS);
|
||||
|
||||
function readCodeSignValue(details, key) {
|
||||
const prefix = `${key}=`;
|
||||
return details
|
||||
@@ -66,8 +68,20 @@ export function collectEntitlementErrors(entitlements) {
|
||||
}
|
||||
}
|
||||
|
||||
if (entitlements["com.apple.security.get-task-allow"] === true) {
|
||||
errors.push("distribution build must not enable com.apple.security.get-task-allow");
|
||||
for (const entitlement of Object.keys(entitlements).sort()) {
|
||||
if (ALLOWED_MACOS_ENTITLEMENTS.has(entitlement)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (
|
||||
entitlement === "com.apple.security.get-task-allow" &&
|
||||
entitlements[entitlement] === true
|
||||
) {
|
||||
errors.push("distribution build must not enable com.apple.security.get-task-allow");
|
||||
continue;
|
||||
}
|
||||
|
||||
errors.push(`unexpected root application entitlement: ${entitlement}`);
|
||||
}
|
||||
|
||||
return errors;
|
||||
|
||||
Reference in New Issue
Block a user