← Back to Pull requests

feat(infra): deploy isolated Secret Server roles on GCP #3156

Closed
unknown closed this pull request without merging on Dec 04, 2026 06:57 UTC
View on GitHub
unknown unknown commented on Nov 30, 2026 03:17 UTC
Author

TL;DR

Deploy private Secret Server write and fetch services on GCP with persistent encryption keys and automatic endpoint delivery to the API and Runners.

How it works

Each stage creates boxlite_secrets on the existing Cloud SQL instance and reuses the boxlite login. Both services receive the same pinned Secret Manager key version through SECRET_MASTER_KEY_BASE64, including in production. Design

API identity    → write service → boxlite_secrets
Runner identity → fetch service → boxlite_secrets
API and fetch logs → Cloud Monitoring → incident.io

Each caller receives the serving URL that Cloud Run reports for its configured token audience. Deployment fails if Cloud Run omits that address.

For example, an existing Runner missing SECRET_SERVER_URL receives the fetch URL through GCE OS Config and restarts. Reapplying the same address leaves the Runner running.

Dev uses an upstream workflow branch at the PR head. Staging accepts a stable tag, and production uses a published stable release containing the image. Deployment and readiness checks

Verification

  • Before the fix, OS Config reported a Runner missing the fetch URL as compliant. The updated policy repaired missing and stale URLs and skipped a second restart.

  • The mdeploy, mstage and mbuild suites passed, including the Cloud Run resource and endpoint tests.

  • Secret Server unit and PostgreSQL integration tests passed, covering migrations, readiness and rejection of an incorrect persistent key.

  • GCP deployment, protected requests, incident delivery and Box E2E remain pending. Box E2E requires compatible write, fetch and Runner builds.
  • Design review

    The audit passed with limited independent verification of references, dependency versions and rollout assumptions.

    Reviewers suggested checking the token headers on a protected request and rehearsing rollback against the migrated schema and pinned key. The Runner fixture covers missing, stale and unchanged URLs.

    Diff: 271 lines (+203 / -68) across 3 files Reviewer: DefeatMan Review duration: 5980m
    All Vouch review confidence checks passed
    Residual risk 0.27 = Change Risk (0.63) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.63 · 271 lines diff across 3 files
    0.63
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.335
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.063
    Real PR Conversation Timeline
    1 comments
    "Review active on #3156"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 62.6% (MEDIUM) · Higher = larger blast radius
    62.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 27.1% · Safe to merge
    27.1%