Skip to content

fix: harden deployment scripts for security#698

Open
simple-agent-manager[bot] wants to merge 1 commit intomainfrom
sam/deploy-script-security-hardening-01kp4w
Open

fix: harden deployment scripts for security#698
simple-agent-manager[bot] wants to merge 1 commit intomainfrom
sam/deploy-script-security-hardening-01kp4w

Conversation

@simple-agent-manager
Copy link
Copy Markdown
Contributor

Summary

  • configure-secrets.sh: Replace echo "$secret_value" with printf '%s' "$secret_value" to prevent expansion of special characters in PEM keys and hide values from process listings
  • configure-r2-cors.sh: Replace hardcoded /tmp/r2-cors-response.txt with mktemp + cleanup trap to avoid world-readable temp files
  • sync-wrangler-config.ts: Replace execSync shell string with execFileSync array args to prevent shell injection via PULUMI_STACK
  • run-migrations.ts: Replace execSync shell string with execFileSync array args to prevent shell injection via db.name
  • setup-local-dev.ts: Replace error: any, (db: any), (ns: any) with proper types; log swallowed errors instead of empty catch blocks
  • verify-pages-domain.sh: Replace python3 -c "import json..." with jq equivalents, matching every other script in the repo
  • setup-github.ts: Fix shebang from #!/usr/bin/env npx tsx to #!/usr/bin/env tsx for consistency

Test plan

  • pnpm lint passes (0 errors)
  • pnpm typecheck passes
  • Scripts are deployment scripts — no unit test coverage expected; verify on next staging deploy

🤖 Generated with Claude Code

…osure

- configure-secrets.sh: use printf instead of echo to prevent expansion of special chars in PEM keys
- configure-r2-cors.sh: use mktemp with cleanup trap instead of world-readable /tmp file
- sync-wrangler-config.ts: use execFileSync to prevent shell injection via PULUMI_STACK
- run-migrations.ts: use execFileSync to prevent shell injection via db.name
- setup-local-dev.ts: replace error:any with proper types, log swallowed errors
- verify-pages-domain.sh: replace python3 dependency with jq for consistency
- setup-github.ts: fix shebang to match all other scripts (tsx, not npx tsx)

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
3 Security Hotspots

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant