Secret Scanning & Stack Guidelines - Replov Docs
Skip to main content

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

FindingExamplesWhat you see
Private credentialService-role keys, Stripe secret keys, GitHub tokens, AWS secrets, private keys, database URLs with passwordsCritical — a red banner with steps to rotate and remove it
Possible passwordpassword = "…" style literals in scripts or configWarning in your repository; critical if it is inside your site's published files
Public browser keyFirebase / Google browser API keysWarning 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.

Deleting a secret is not enough
Once a credential has been committed, it stays in your Git history. Always rotate it with the provider (create a new key, revoke the old one) before or after removing it from the code.

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

  1. Restrict the Firebase API key in Google Cloud Console → APIs & Services → Credentials (HTTP referrers = your Replov domains).
  2. Protect Firestore / Storage with Security Rules and turn on Firebase App Check.
  3. Move privileged work (admin actions, payments, emails) into Vitibase functions or a Replov Web Service.
  4. 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

  1. Treat every build-time variable as public. Put secrets only in a backend.
  2. Call third-party APIs that need a secret from a Replov Web Service or Vitibase function, not from the browser.
  3. 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

  1. Add secrets as environment variables on the Replov Web Service (Env Variables tab) and read them with process.env.NAME.
  2. Add .env to .gitignore. If a secret was ever committed, rotate it — removing the file does not remove it from Git history.
  3. 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

  1. Set DJANGO_SECRET_KEY / DATABASE_URL etc. as Replov environment variables.
  2. 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

  1. Remove secrets from ENV / ARG and supply them as Replov environment variables at runtime.
  2. 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

  1. Move the value to a Replov environment variable.
  2. 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

tool/seed_admin.mjsjavascript
// Before — the password is committed to Git
const adminPassword = "my-real-password";
// After — read it at runtime, fail loudly if it is missing
const 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.

Keep tools out of your site
If your repository contains scripts that your website does not need, move the app into its own folder and set that folder as the service's Root Directory. Replov then builds and scans only the app.

Next Steps