-
Notifications
You must be signed in to change notification settings - Fork 0
Security
OWASP Top 10 is the checklist. Every playbook step's 🔒 Security notes maps back
to the non-negotiable defaults below.
-
Security headers on Hosting: CSP, HSTS (preload),
X-Content-Type-Options,X-Frame-Options: DENY,Referrer-Policy,Permissions-Policy, COOP. - Firestore / Storage rules are deny-by-default; tested with rules unit tests in CI.
- WSG Level 0-5 account model standardizes public, member, paid, diamond, admin, and owner access checks.
- RBAC via custom claims; privileged callables verify claims server-side.
- MFA enforcement option for admin roles.
- Sender/auth/MFA order is standardized: sender email, DNS, authorized domains, providers, claims, MFA, and smoke tests are verified before launch.
-
Secrets never in the repo;
.env*and*secrets*are git-ignored. -
Dependency audit (
npm audit) + secret scanning in CI. - App Check recommended for production to gate Firebase backends.
- Stripe webhooks verify signatures + use idempotency keys.
The starter's firebase.json already applies a hardened header set to every
response:
| Header | Value (summary) |
|---|---|
Content-Security-Policy |
default-src 'self'; scripts/styles from self + https; object-src 'none'; base-uri 'self'
|
Strict-Transport-Security |
max-age=63072000; includeSubDomains; preload |
X-Content-Type-Options |
nosniff |
X-Frame-Options |
DENY |
Referrer-Policy |
strict-origin-when-cross-origin |
Permissions-Policy |
geolocation=(), microphone=(), camera=() |
Cross-Origin-Opener-Policy |
same-origin-allow-popups |
Static assets under assets/** also get Cache-Control: public, max-age=31536000, immutable.
When you add Stripe, extend the CSP
script-src/frame-srcto includehttps://js.stripe.com(see Step 11).
URL="https://<your-project>.web.app"
curl -sI "$URL" | grep -i strict-transport-security
curl -sI "$URL" | grep -i content-security-policyIf you drive the 🚀 Start Template into Production wizard (or any setup) with an AI assistant, you will paste live keys and secrets into the session. The wizard ends with an explicit reminder — follow it:
- Delete the AI chat / conversation you used to run the setup.
- Secrets are written to
.env.localand.secrets.env(the latterchmod 600), both git-ignored by default — never commit them. - Never paste server secrets (Stripe secret key, webhook secret) back into a chat.
- If a secret may have been exposed, rotate it in the provider console.
- Store production secrets in Firebase Functions secrets / GCP Secret Manager, not in flat files on shared machines.
| Tier | Examples | Where it lives |
|---|---|---|
| Client (public) |
VITE_FIREBASE_*, VITE_STRIPE_PUBLISHABLE_KEY
|
Bundle / .env.local
|
| Server (secret) |
STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET, EMAIL_API_KEY
|
Functions secrets / GH Actions / GCP Secret Manager |
A Firebase web API key is not a secret — see Environment Variables.
- Start deny-by-default; open up reads/writes per collection deliberately.
- Keep a rules unit test in the suite to catch data-exposure regressions
(
@firebase/rules-unit-testing). - Deploy rules alongside hosting so they never drift:
bash .SYSTEMX/scripts/deploy.sh rules --project your-firebase-project-id.
- HSTS + CSP present on the live response (curl checks above).
- Firebase Auth authorized domains include localhost, preview/beta, custom, and production hosts.
- Sender email uses the selected provider path and SPF/DKIM/DMARC records are verified.
- Deployed rules match the repo (no drift).
- App Check enforcement enabled for production backends.
- Stripe in live mode only after a passing test-mode smoke.
- No
.env*/ secret files bundled intodist/. -
npm run ci:securitygreen with0 failed, 0 warning(s). -
npm audit --audit-level=moderatereportsfound 0 vulnerabilities. - MFA required for admin roles.
-
npm run auth:mfa:checkpasses before enabling private/admin routes.
See Step 07 — Security Rules and Step 11 — Build & Deploy for the detailed gates.
SFWA-WTL-G1 · Standard Firebase Web App, Wayne Tech Lab Generation 1 · Provided by Wayne Tech Lab LLC under MIT · Use at your own risk · Subject to daily change · Repository
- Home
- Quick Start
- WTL Standard Setup Guide
- One-Line Install
- Platform Matrix
- Linux Setup
- Windows Setup
- Architecture and Stack
- Project Structure
- SYSTEMX Root and Folder Standard
- Setup Playbook
- Environment Variables
- Security
- Deployment
- Testing and QA
- MCP and Agents
- GitHub Authors and Contribution Notes
- SYSTEMX WEBPORTAL
- White Paper
- Executive Summary
- CISO Note From the Founder
- Wayne Tech Lab Purpose
- Security Overview
- Long-Term Warnings
- .ENV Solutions
- Menu Operations
- Setup and Deployment
- Start and End of Day
- SYSTEMX Sync and Controlled Updates
- Agent 0 and Subagents
- Agent 0 Operating Model
- How Subagents Work
- Starter Prompts and Smart Routing
- Third-Party Responsibility
- User Ingest and Production Setup
- FAQ