Skip to content
prod 352bb92
Browse

1 · Pre-flight security hygiene (P0)

Objective — confirm the Phase 10 consolidated verdict allows production, rotate every test-mode key and non-production password that touched a chat or log, vault plaintext credentials, re-scope over-privileged service accounts, and record the audit, so no convenience credential from iteration becomes a liability the moment real traffic arrives.

Steps at a glance:

  1. Rotate every test-mode payment key — Roll each key that appeared in chat or log history, then revoke the old value at the source.
  2. Rotate all non-production-side passwords — SMTP, database, and hosting-panel credentials — and any password that lived in a plaintext file.
  3. Migrate plaintext credentials into a real secrets manager — Move every secret into the appropriate vault, then replace the plaintext store with pointers (or delete it and .gitignore it).
  4. Re-scope over-privileged service accounts — Narrow each API key and the deploy user to the minimum permissions they actually need.
  5. Record the audit — Capture what changed so the rotation is auditable later. An agent can draft this record from your notes.

Never skip this. Every production deploy starts here. Non-production and production are different security contexts: credentials that were convenient during iteration become liabilities the moment real traffic arrives.

Read the production row in Zaj-PROJECT.md before rotating or deploying anything. It must name the production URL/domain, hosting account, SSH alias, host/user/port, deploy target, source branch, DB name, web PHP, CLI PHP binary, credential pointer, noindex/robots posture, and last verified date. If any value is missing or stale, stop here and update the row before touching production.

Before reporting SSH access as blocked, inspect the operator’s existing machine config and test the recorded alias:

Terminal window
grep -nE '^Host |HostName|User|Port|IdentityFile' ~/.ssh/config 2>/dev/null
SSH_PRODUCTION_ALIAS="<production-alias-from-Zaj-PROJECT>"
PHPBIN="<production-cli-php-from-Zaj-PROJECT>"
ssh -o BatchMode=yes -o ConnectTimeout=8 "$SSH_PRODUCTION_ALIAS" "pwd && $PHPBIN -v | head -1"
# Expected: exit 0; alias/host/user/port match the production row

Task P.0 — Verify the Phase 10-CONSOLIDATED verdict

Section titled “Task P.0 — Verify the Phase 10-CONSOLIDATED verdict”

Before rotating secrets or preparing the production release, prove the pre-launch verdict allows Phase 12 production to start.

  1. Open the latest consolidated verdict and confirm the decision line is 🟢 GO or explicitly accepted 🟡 CONDITIONAL GO. If the report is missing, incomplete, or 🔴 NO-GO, stop before touching production.

    • ✅ The consolidated verdict exists and clears Phase 12 production to start.
  2. Verify the production row in Zaj-PROJECT.md. Confirm production URL, deploy target, SSH alias, DB name, web PHP, CLI PHP binary, credential pointer, and last verified date are current. Re-run the SSH alias proof above.

    • Zaj-PROJECT.md has a current production row and SSH proof.
  3. Verify production DNS + origin TLS before any deploy step. If Cloudflare is in front, this prevents the broken public state where production is orange-clouded but the current origin has no valid certificate.

    Terminal window
    PROD_DOMAIN="<production-domain-from-Zaj-PROJECT>"
    EXPECTED_ORIGIN_IP="<production-origin-ip-from-Zaj-PROJECT>"
    dig +short "$PROD_DOMAIN" A | grep -Fx "$EXPECTED_ORIGIN_IP"
    curl -sI "https://$PROD_DOMAIN" | head -1
    echo | openssl s_client -connect "$PROD_DOMAIN:443" -servername "$PROD_DOMAIN" 2>/dev/null \
    | openssl x509 -noout -subject -issuer -dates
    # Expected: DNS matches the current origin; HTTPS is not 525; cert is valid and not expired

    If dig returns an old IP, stop — Cloudflare is talking to the wrong box. If Cloudflare returns 525, stop — issue the origin cert first (use DNS-only/grey cloud if Hostinger AutoSSL needs direct validation), then re-proxy and use Full (Strict).

    • ✅ Production DNS points at the current origin, origin TLS is valid, and Cloudflare is not returning 525.

Roll each key that appeared in chat or log history, then revoke the old value at the source.

  1. Roll each test-mode key in the gateway dashboard, update the affected non-production environment row/secret with the new value, and revoke the old key.

    • ✅ Every test-mode key is rotated and the old keys are revoked at the source.

2. Rotate all non-production-side passwords

Section titled “2. Rotate all non-production-side passwords”

SMTP, database, and hosting-panel credentials for any non-production environment — and any password that lived in a plaintext file.

If an agent assists inside provider consoles after the user logs in, use the vendor console automation guide: the user owns login, password entry, and secret-copy moments; the agent can navigate, verify state, and prepare non-secret fields.

  1. Rotate the non-production-side passwords — SMTP, database, hosting-panel, and anything that lived in a plaintext file.

    • ✅ All non-production-side passwords are rotated.

3. Migrate plaintext credentials into a real secrets manager

Section titled “3. Migrate plaintext credentials into a real secrets manager”

Move every secret into the appropriate vault, then replace the plaintext store with pointers (or delete it and .gitignore it).

  1. Move every secret into the appropriate vault, then replace the plaintext store with pointers — or delete it and .gitignore it.

    • ✅ Plaintext credentials are replaced with vault pointers (or deleted + gitignored).

4. Re-scope over-privileged service accounts

Section titled “4. Re-scope over-privileged service accounts”

Narrow each API key and the deploy user to the minimum permissions they actually need.

For provider console navigation, use the vendor console automation guide and keep final authorization/scope approval human-owned.

  1. Narrow each API key and the deploy user — payments, analytics, error tracking — to the minimum permissions they actually need.

    • ✅ Every service-account scope is narrowed to the minimum.

Capture what changed so the rotation is auditable later. An agent can draft this record from your notes.

  1. Write the audit summary in your customizations log — what was rotated, what moved to the vault, what was re-scoped, and any accepted exceptions with the reason.

    • ✅ The audit summary is committed.

Do not mark this step done until every box below is checked.

  • 🔀 Entry gate (Task P.0) — Phase 10-CONSOLIDATED verdict exists and is 🟢 GO or explicitly accepted 🟡 CONDITIONAL GO; 🔴 NO-GO or missing verdict means deploy nothing.
  • 🤖 Production row verifiedZaj-PROJECT.md records current production URL/domain, SSH alias, deploy target, DB name, web/CLI PHP, credential pointer, and last verified date; SSH alias proof exits 0.
  • 🔀 Test-mode keys rotated — every test-mode payment key rolled; old keys revoked at the source; user owns secret values and provider authorization.
  • 🔀 Non-production passwords rotated — SMTP, database, and hosting-panel credentials all changed; user enters new passwords, agent verifies non-secret evidence.
  • 🔀 Credentials vaulted — plaintext secrets replaced with vault pointers (or deleted + gitignored); user owns secret capture, agent records pointers.
  • 🔀 Scopes minimized — every API key and the deploy user narrowed to minimum permissions; user approves final scopes, agent verifies the resulting state.
  • 🔀 Audit recorded — rotation/move/re-scope summary committed to the customizations log.