Secret Scanning & Stack Guidelines
How Replov checks each deployment for credentials, and what is safe to ship for your stack
Every deployment is scanned for credentials such as API keys, tokens, private keys and passwords. For Static Sites, Replov scans twice: once on your repository and once on the files your site actually publishes (for example build/web for Flutter or dist for Vite), because anything in those files can be downloaded by every visitor.
Findings never stop a deployment. Your service goes live, and Replov tells you what it found — in a banner at the top of your service, on the deployment, and in the deployment email — together with what to do for your stack.
How findings are reported
| Finding | Examples | What you see |
|---|---|---|
| Private credential | Service-role keys, Stripe secret keys, GitHub tokens, AWS secrets, private keys, database URLs with passwords | Critical — a red banner with steps to rotate and remove it |
| Possible password | password = "…" style literals in scripts or config | Warning in your repository; critical if it is inside your site's published files |
| Public browser key | Firebase / Google browser API keys | Warning with steps to restrict the key to your domain |
Open your service and go to Deployments → Security findings to see each finding with its file, line and masked value. For each one you can:
- • Fix it — move the value to an environment variable, rotate it, and redeploy.
- • Mark it as resolved — once you have rotated, removed or restricted it. It stops appearing in the banner.
- • Mark it as a false positive — applies only to that value in that file; a changed value is scanned again. A reason is required for critical findings.
Every decision is recorded in your audit log and listed under Settings → Security reviews, where you can revoke it. Secret scanning itself cannot be turned off.
Guidelines by stack
The rule for every stack: anything the browser downloads is public. Secrets belong in environment variables on a server — a Replov Web Service or a Vitibase function.
Flutter Web
Everything in lib/ is compiled into main.dart.js and downloaded by every visitor.
Safe to include
- • Firebase client config from flutterfire (lib/firebase_options*.dart) — restricted to your domains
- • Vitibase / Supabase URL and anon (public) key, with Row Level Security enabled
- • Stripe publishable key (pk_live_… / pk_test_…)
Never include
- • Service-role keys, admin passwords, database connection strings
- • Stripe secret keys, private API keys, GitHub tokens
- • Anything passed with --dart-define that must stay private — it is baked into the bundle
What to do
- Restrict the Firebase API key in Google Cloud Console → APIs & Services → Credentials (HTTP referrers = your Replov domains).
- Protect Firestore / Storage with Security Rules and turn on Firebase App Check.
- Move privileged work (admin actions, payments, emails) into Vitibase functions or a Replov Web Service.
- Keep helper scripts (tool/*.mjs) on process.env, or move the app into its own folder and set it as the Root Directory.
React, Vite, Angular, Astro & other static sites
Build-time variables (VITE_*, REACT_APP_*, NEXT_PUBLIC_*, PUBLIC_*) are inlined into the JavaScript bundle.
Safe to include
- • Public API base URLs and feature flags
- • Firebase client config and other browser keys restricted by domain
- • Vitibase / Supabase anon key with Row Level Security
- • Stripe publishable key
Never include
- • Any value in a VITE_ / REACT_APP_ / NEXT_PUBLIC_ variable that must stay secret
- • Service-role keys, database URLs, Stripe secret keys, OpenAI / Anthropic keys
What to do
- Treat every build-time variable as public. Put secrets only in a backend.
- Call third-party APIs that need a secret from a Replov Web Service or Vitibase function, not from the browser.
- Use Static Site environment variables only for public configuration.
Node.js (Express, NestJS, Next.js server)
Server code is not downloaded by visitors, but anything committed to Git is readable by anyone with repository access — forever, in its history.
Safe to include
- • Reading secrets from process.env at runtime
- • A committed .env.example with placeholder values only
Never include
- • Committed .env files or hardcoded keys in source
- • Secrets inside NEXT_PUBLIC_* variables — those reach the browser
What to do
- Add secrets as environment variables on the Replov Web Service (Env Variables tab) and read them with process.env.NAME.
- Add .env to .gitignore. If a secret was ever committed, rotate it — removing the file does not remove it from Git history.
- Scripts in tool/ or scripts/ should also read process.env, not literals.
Python (Django, Flask, FastAPI)
Same rule as any server: secrets come from the environment, never from source.
Safe to include
- • os.environ["NAME"] / os.getenv("NAME") at runtime
- • settings files that only reference environment variables
Never include
- • SECRET_KEY or database passwords hardcoded in settings.py
- • Committed .env files
What to do
- Set DJANGO_SECRET_KEY / DATABASE_URL etc. as Replov environment variables.
- Rotate any key that was committed, then remove it from the code.
Custom Dockerfile
Every ENV, ARG and COPY ends up in image layers that can be inspected.
Safe to include
- • Runtime environment variables provided by Replov
- • Non-secret build arguments
Never include
- • ENV or ARG lines containing secrets
- • COPYing .env, key files or credentials into the image
What to do
- Remove secrets from ENV / ARG and supply them as Replov environment variables at runtime.
- Add .env and key files to .dockerignore.
Any other stack
Secrets belong in environment variables on the server, never in code or in anything the browser downloads.
Safe to include
- • Values read from environment variables at runtime
- • Public, domain-restricted browser keys
Never include
- • Private keys, tokens, passwords or connection strings committed to Git
What to do
- Move the value to a Replov environment variable.
- Rotate it with the provider if it was ever committed.
Vitibase / Supabase keys
- • The anon key is designed to be public, but only safe when Row Level Security is enabled on every table.
- • The service-role key bypasses Row Level Security. Use it only in server-side functions — never in a website or mobile app.
- • If a service-role key was exposed, rotate the project’s JWT secret / service key immediately.
Moving a hardcoded value to an environment variable
// Before — the password is committed to Gitconst adminPassword = "my-real-password";// After — read it at runtime, fail loudly if it is missingconst adminPassword = process.env.ADMIN_PASSWORD;if (!adminPassword) throw new Error('ADMIN_PASSWORD is not set');
For a Web Service, add ADMIN_PASSWORD under the service's Env Variables tab. For local scripts, keep it in a .env file that is listed in .gitignore.