Skip to content

Commit 2c772a5

Browse files
cameroncookeclaude
andcommitted
build(axe): Enforce signature checks in bundling
Make local AXe source path env-driven with a project-local default and add macOS verification gates for bundled artifacts. Validate codesign signatures for the AXe binary and bundled frameworks, run Gatekeeper assessment on the executable, and fail bundling when verification fails. Also use non-force directory removal where cleanup already guards for existence. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 3908854 commit 2c772a5

1 file changed

Lines changed: 22 additions & 3 deletions

File tree

scripts/bundle-axe.sh

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set -e
88
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
99
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
1010
BUNDLED_DIR="$PROJECT_ROOT/bundled"
11-
AXE_LOCAL_DIR="/Volumes/Developer/AXe"
11+
AXE_LOCAL_DIR="${AXE_LOCAL_DIR:-/Users/cameroncooke/Developer/AXe}"
1212
AXE_TEMP_DIR="/tmp/axe-download-$$"
1313

1414
echo "🔨 Preparing AXe artifacts for bundling..."
@@ -31,7 +31,7 @@ echo "📌 Using AXe version: $PINNED_AXE_VERSION"
3131
# Clean up any existing bundled directory
3232
if [ -d "$BUNDLED_DIR" ]; then
3333
echo "🧹 Cleaning existing bundled directory..."
34-
rm -rf "$BUNDLED_DIR"
34+
rm -r "$BUNDLED_DIR"
3535
fi
3636

3737
# Create bundled directory
@@ -147,6 +147,25 @@ ls -la "$BUNDLED_DIR/Frameworks/"
147147
# Verify binary can run with bundled frameworks (macOS only)
148148
OS_NAME="$(uname -s)"
149149
if [ "$OS_NAME" = "Darwin" ]; then
150+
echo "🔏 Verifying AXe signatures..."
151+
if ! codesign --verify --deep --strict "$BUNDLED_DIR/axe"; then
152+
echo "❌ Signature verification failed for bundled AXe binary"
153+
exit 1
154+
fi
155+
156+
while IFS= read -r framework_path; do
157+
if ! codesign --verify --deep --strict "$framework_path"; then
158+
echo "❌ Signature verification failed for framework: $framework_path"
159+
exit 1
160+
fi
161+
done < <(find "$BUNDLED_DIR/Frameworks" -name "*.framework" -type d)
162+
163+
echo "🛡️ Assessing AXe with Gatekeeper..."
164+
if ! spctl --assess --type execute "$BUNDLED_DIR/axe"; then
165+
echo "❌ Gatekeeper assessment failed for bundled AXe binary"
166+
exit 1
167+
fi
168+
150169
echo "🧪 Testing bundled AXe binary..."
151170
if DYLD_FRAMEWORK_PATH="$BUNDLED_DIR/Frameworks" "$BUNDLED_DIR/axe" --version > /dev/null 2>&1; then
152171
echo "✅ Bundled AXe binary test passed"
@@ -166,7 +185,7 @@ echo "📋 AXe version: $AXE_VERSION"
166185
# Clean up temp directory if it was used
167186
if [ -d "$AXE_TEMP_DIR" ]; then
168187
echo "🧹 Cleaning up temporary files..."
169-
rm -rf "$AXE_TEMP_DIR"
188+
rm -r "$AXE_TEMP_DIR"
170189
fi
171190

172191
# Show final bundle size

0 commit comments

Comments
 (0)