From 55fd124054e8fc065f6af5d3dab3cf57f04c48b8 Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Fri, 10 Apr 2020 03:04:02 -0700 Subject: [PATCH] fix: add separate helper entitlements --- build/azure-pipelines/darwin/entitlements.plist | 2 -- .../darwin/helper-gpu-entitlements.plist | 8 ++++++++ .../darwin/helper-plugin-entitlements.plist | 10 ++++++++++ .../darwin/helper-renderer-entitlements.plist | 14 ++++++++++++++ .../darwin/product-build-darwin.yml | 8 +++++++- 5 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 build/azure-pipelines/darwin/helper-gpu-entitlements.plist create mode 100644 build/azure-pipelines/darwin/helper-plugin-entitlements.plist create mode 100644 build/azure-pipelines/darwin/helper-renderer-entitlements.plist diff --git a/build/azure-pipelines/darwin/entitlements.plist b/build/azure-pipelines/darwin/entitlements.plist index d38a213ab0ab9..689b28b688adc 100644 --- a/build/azure-pipelines/darwin/entitlements.plist +++ b/build/azure-pipelines/darwin/entitlements.plist @@ -8,8 +8,6 @@ com.apple.security.cs.disable-library-validation - com.apple.security.cs.allow-dyld-environment-variables - com.apple.security.device.camera com.apple.security.device.audio-input diff --git a/build/azure-pipelines/darwin/helper-gpu-entitlements.plist b/build/azure-pipelines/darwin/helper-gpu-entitlements.plist new file mode 100644 index 0000000000000..4efe1ce508f85 --- /dev/null +++ b/build/azure-pipelines/darwin/helper-gpu-entitlements.plist @@ -0,0 +1,8 @@ + + + + + com.apple.security.cs.allow-jit + + + diff --git a/build/azure-pipelines/darwin/helper-plugin-entitlements.plist b/build/azure-pipelines/darwin/helper-plugin-entitlements.plist new file mode 100644 index 0000000000000..7cd9df032bd08 --- /dev/null +++ b/build/azure-pipelines/darwin/helper-plugin-entitlements.plist @@ -0,0 +1,10 @@ + + + + + com.apple.security.cs.allow-unsigned-executable-memory + + com.apple.security.cs.disable-library-validation + + + diff --git a/build/azure-pipelines/darwin/helper-renderer-entitlements.plist b/build/azure-pipelines/darwin/helper-renderer-entitlements.plist new file mode 100644 index 0000000000000..be8b7163da7fc --- /dev/null +++ b/build/azure-pipelines/darwin/helper-renderer-entitlements.plist @@ -0,0 +1,14 @@ + + + + + com.apple.security.cs.allow-jit + + com.apple.security.cs.allow-unsigned-executable-memory + + com.apple.security.cs.disable-library-validation + + com.apple.security.cs.allow-dyld-environment-variables + + + diff --git a/build/azure-pipelines/darwin/product-build-darwin.yml b/build/azure-pipelines/darwin/product-build-darwin.yml index d77dbbd2e0f22..cba9161a2cc76 100644 --- a/build/azure-pipelines/darwin/product-build-darwin.yml +++ b/build/azure-pipelines/darwin/product-build-darwin.yml @@ -171,13 +171,19 @@ steps: - script: | set -e + APP_ROOT=$(agent.builddirectory)/VSCode-darwin + APP_NAME="`ls $APP_ROOT | head -n 1`" + APP_FRAMEWORK_PATH="$APP_ROOT/$APP_NAME.app/Contents/Frameworks" security create-keychain -p pwd $(agent.tempdirectory)/buildagent.keychain security default-keychain -s $(agent.tempdirectory)/buildagent.keychain security unlock-keychain -p pwd $(agent.tempdirectory)/buildagent.keychain echo "$(macos-developer-certificate)" | base64 -D > $(agent.tempdirectory)/cert.p12 security import $(agent.tempdirectory)/cert.p12 -k $(agent.tempdirectory)/buildagent.keychain -P "$(macos-developer-certificate-key)" -T /usr/bin/codesign security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k pwd $(agent.tempdirectory)/buildagent.keychain - codesign -s 99FM488X57 --deep --force --options runtime --entitlements build/azure-pipelines/darwin/entitlements.plist $(agent.builddirectory)/VSCode-darwin/*.app + codesign -s 99FM488X57 --deep --force --options runtime --entitlements build/azure-pipelines/darwin/entitlements.plist "$APP_FRAMEWORK_PATH/$APP_NAME Helper.app" + codesign -s 99FM488X57 --deep --force --options runtime --entitlements build/azure-pipelines/darwin/helper-gpu-entitlements.plist "$APP_FRAMEWORK_PATH/$APP_NAME Helper (GPU).app" + codesign -s 99FM488X57 --deep --force --options runtime --entitlements build/azure-pipelines/darwin/helper-plugin-entitlements.plist "$APP_FRAMEWORK_PATH/$APP_NAME Helper (Plugin).app" + codesign -s 99FM488X57 --deep --force --options runtime --entitlements build/azure-pipelines/darwin/helper-renderer-entitlements.plist "$APP_FRAMEWORK_PATH/$APP_NAME Helper (Renderer).app" displayName: Set Hardened Entitlements - script: |