Bolt 和 Replit 應用安全:上線部署後要檢查的 6 項內容
Bolt and Replit app security: 6 things to check on your live deployment
文章列出 Bolt 和 Replit 應用上線部署後要檢查的 6 類安全問題,並提供相應修復方法。檢查範圍包括前端程式碼中的密鑰、.env 是否對外提供、Supabase 的 Row Level Security、公開儲存桶、除錯路由與詳細錯誤,以及正式環境的 source maps;建議先撤銷外洩金鑰,再處理資料庫和儲存空間。
Bolt and Replit apps ship fast, and the same few mistakes show up again and again. Here is what to check on a live deployment, and how to fix each one.
1. Secrets in the client bundle
Anything prefixed for the browser (for example VITE_ or NEXT_PUBLIC_) is public. Do not put a service_role key, a Stripe secret or an AI provider key there. If one is already live, revoke it first, then move the call to a server function.
2. Replit and Bolt environment files
Check that .env is not served at your domain, and that it is in .gitignore before the first commit. A key committed once stays in history even after you delete the file, so rotate it.
3. Open database tables
If the app uses Supabase, turn on Row Level Security and write per-operation policies. Test signed out and as a second user.
4. Public storage buckets
Uploads, invoices and avatars often sit in a public bucket. Make private buckets private and use signed URLs.
5. Debug routes and verbose errors
Remove test endpoints and turn off stack traces in production.
6. Source maps
Disable production source maps unless you want your source public.
Fix order
Revoke leaked keys, then close the database, then storage, then the rest. Rotating a key is more urgent than a code cleanup.
ProofForge scans your live URL from the outside, read-only and without logging in, and writes fix prompts you can paste back into Bolt or Replit. Free first scan: https://proofforge.live/check/bolt
來源:DEV Community · dev.to