Repository Public License
1#!/usr/bin/env bash2# =============================================================================3# SP BOUCHER | INFRASTRUCTURE & AUTOMATION4# ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5# =============================================================================6#7# Project : ORIX Monitor8# File : Scripts/sign.sh9# Description : Verifies the Developer ID signature, Hardened Runtime,10# timestamp and entitlements of dist/ORIX Monitor.app.11# Signing itself is done by Xcode in the Release build.12# Module : Scripts13# Repository : https://git.spboucher.ai/orix-monitor14# Created : 2026-11-2115# Last Modified : 2026-11-2116#17# Author : Simon-Pierre Boucher18# Position : Professor of Finance19# Institution : Université du Québec en Outaouais (UQO)20# Organization : SP Boucher21# Website : https://spboucher.ai22# Git : https://git.spboucher.ai23#24# Preferred Contact: support@spboucher.ai25# Technical Contact: dev@spboucher.ai26# Security/Admin : admin@spboucher.ai27#28# Copyright (c) 202629# Simon-Pierre Boucher30# All rights reserved where applicable. This file is governed by the31# applicable project license, copyright notices and relevant law.32# Existing third-party rights and notices remain unaffected.33#34# License : Proprietary, all rights reserved (see license file)35# License File : LICENSE36#37# Do not embed credentials, private keys, access tokens,38# certificates or confidential personal information.39#40# =============================================================================41# END OF SP BOUCHER SOURCE HEADER42# =============================================================================4344set -euo pipefail45cd "$(dirname "$0")/.."46APP="dist/ORIX Monitor.app"47[[ -d "$APP" ]] || { echo "ERROR: $APP not found. Run Scripts/build.sh release first." >&2; exit 1; }48INFO="$(codesign -dvv "$APP" 2>&1)"49fail() { echo "FAIL: $1" >&2; exit 1; }50grep -q "^Authority=Developer ID Application: " <<<"$INFO" || fail "not signed with a Developer ID Application identity"51grep -q "flags=.*runtime" <<<"$INFO" || fail "Hardened Runtime is not enabled"52grep -q "^Timestamp=" <<<"$INFO" || fail "no secure timestamp"53grep -q "^Identifier=ai.spboucher.orix.monitor$" <<<"$INFO" || fail "unexpected bundle identifier"54codesign --verify --deep --strict "$APP" || fail "signature does not verify"55ENT="$(codesign -d --entitlements - --xml "$APP" 2>/dev/null | plutil -p - 2>/dev/null || true)"56if grep -q "get-task-allow" <<<"$ENT"; then fail "get-task-allow entitlement present (debug entitlement in a release build)"; fi57echo "Signature : $(sed -n 's/^Authority=\(Developer ID Application: .*\)$/\1/p' <<<"$INFO" | head -1)"58echo "Team : $(sed -n 's/^TeamIdentifier=//p' <<<"$INFO")"59echo "Runtime : hardened ($(sed -n 's/^.*flags=\(.*\) hashes.*$/\1/p' <<<"$INFO"))"60echo "Timestamp : $(sed -n 's/^Timestamp=//p' <<<"$INFO")"61echo "Entitlements: ${ENT:-none}"62echo "OK: signature verified."63