Skip to main content

Secure development process

Scope and principles

The process covers the web application, database migrations, server-side functions, third-party integrations, build artefacts, and production operations. It follows these principles:

  • security requirements are considered with functional requirements;
  • tenant isolation and least privilege are preserved through every change;
  • secrets and privileged service credentials stay outside public source and browser code;
  • database changes are reviewable, reversible migrations rather than undocumented live edits;
  • evidence is retained for design decisions, implementation, verification, deployment, and rollback;
  • unresolved security risk is recorded and accepted by an authorised owner rather than silently treated as complete.

Current lifecycle

PhaseImplemented controlOpen action
Requirements and designFeature documentation, business context, architecture decisions, and change-specific acceptance criteria are retained with the projectEnforce one security-requirements and threat-modelling record for every high-risk change
Planning and riskHigher-risk database and authorization work includes explicit scope, invariants, preconditions, staging checks, rollback steps, and deferred-risk decisionsApply the same risk record and approval gate to every security-relevant change
ImplementationCode-formatting and correctness rules are configured; authentication, tenant context, database policies, and trusted server checks form the security boundariesKeep the linter as a correctness control and retain Snyk Code as the dedicated SAST control
Source and secret handlingLocal environment files and build credentials are excluded from source control; privileged credentials remain server-side or in deployment configurationAdd deterministic secret scanning to pull requests and repository history
Peer reviewNon-draft pull requests trigger automated code and security review; Codex review is active, and CodeRabbit is used for selected reviewsRequire human approval and designated ownership for security-sensitive paths; enforce the rule through protected-branch configuration
Build and functional verificationSnyk Open Source and Snyk Code run on pull requests; production builds, formatter/linter checks, manual QA, and browser-assisted testing are retained when performedAdd required build, non-mutating lint, and automated test checks that block merge on failure
Database change controlChanges are represented as migrations, reviewed before deployment, tested against role and tenant invariants where risk requires it, and accompanied by rollback or restoration guidanceRecord production deployment approval and post-deployment verification for every migration
Release and deploymentCloudflare Pages builds the web application; protected build configuration handles monitoring source maps without placing them in the public artefactDocument required approval, environment separation, rollback authority, and a completed rollback exercise
Monitoring and feedbackProduction exceptions and selected performance traces reach the monitoring platform; activity records preserve implementation and validation historyAssign security-event ownership, escalation routing, and measurable acknowledgement targets
Vulnerability responseInternal security assessments, Snyk results, AI-assisted review, and provider advisories identify weaknessesOperate one vulnerability register from discovery through verified closure and retain independent retest evidence where required

Security requirements by change type

Every security-relevant change records the applicable requirements before implementation.

Change typeMinimum security considerations
Authentication or sessionAccount eligibility, credential handling, session expiry, token storage, logout behaviour, abuse controls, and MFA impact
Authorization or tenant scopeAllowed actors, denied actors, cross-tenant negative cases, direct API access, row-level policy behaviour, and privileged server checks
Personal or policy dataData minimisation, field validation, access scope, retention, export, logging, encryption, and deletion behaviour
Database migrationForward compatibility, schema preconditions, grants, row-level policies, function execution rights, backfill safety, backup dependency, verification query, and rollback
Server-side functionCaller authentication, tenant and role revalidation, input bounds, replay or idempotency handling, secret access, external-call failure, and auditability
Third-party integrationData shared, purpose, credentials, authentication, callback validation, timeout and retry policy, incident dependency, and supplier change monitoring
Frontend or buildInput/output encoding, client-exposed configuration, dependency impact, source-map handling, content security assumptions, and production-build verification

Required change evidence

A security-relevant change retains, as applicable:

  1. requirement and business owner;
  2. security impact and data-flow change;
  3. design decision or threat assessment for high-risk work;
  4. code-review outcome and unresolved findings;
  5. build, lint, automated-test, and manual-test results;
  6. negative authorization and cross-tenant test results;
  7. migration preconditions and post-deployment verification;
  8. deployment identifier, operator, and approval;
  9. rollback procedure and recovery dependency;
  10. monitoring, vulnerability, or incident follow-up.

The change record identifies every unavailable test and failed validation explicitly. Absence of a tool or environment is recorded as incomplete evidence, not a passing result.

Database and backend safeguards

  • Browser requests use the authenticated user context; privileged service credentials remain inside trusted execution and are absent from public clients.
  • Exposed application tables use row-level security, with grants controlling whether an API role can reach an object and policies controlling the rows it can access.
  • Privileged database functions and server-side operations require explicit caller, tenant, role, and target validation.
  • Migration verification includes anonymous, normal user, management, leadership, mapped-scope, cross-tenant, and service-operation cases where relevant.
  • Security-advisor output is reviewed as a point-in-time signal. The current review found outstanding advisories, so advisor execution is not presented as a clean or automated release gate.
  • Provider changelog review is required before platform, client-library, authentication, database, or deployment changes.

Current gaps and improvement plan

PriorityRequired improvementCompletion evidence
HighAdd required CI checks for a clean production build and non-mutating lint validationChecks execute on every pull request and block merge on failure
HighAdd automated secret scanning and prevent privileged credentials from entering commit historyPull-request and repository-history scans pass; response procedure is documented
HighExpand Snyk Code coverage, confirm required-check settings, retain dependency-scan evidence, and introduce risk-based DASTItem 14 contains configuration evidence, dated results, triage, remediation ownership, and authorised DAST scope
HighEstablish protected-branch rules, required human approval, and security ownership for sensitive pathsSource-control settings and approval evidence are retained
HighAdd an automated test runner beginning with authentication, authorization, tenant isolation, and critical business workflowsTests run in CI and include negative security cases
MediumCommit and enforce one supported dependency lockfile and define an update cadenceReproducible clean installation and scheduled dependency review are demonstrated
MediumStandardise security requirements and lightweight threat modelling for high-risk changesPull requests link to the completed risk record
MediumDocument Cloudflare Pages release approval, environment separation, rollback, and recovery verificationA dated release and rollback exercise is retained
MediumDefine vulnerability severity, remediation targets, exception approval, and retest rulesFindings can be traced from discovery through verified closure
MediumTrack Supabase security advisories to triage or accepted riskEach relevant advisory has an owner, decision, and review date

Framework alignment

The process is organised around the four outcome groups in the NIST Secure Software Development Framework: prepare the organisation, protect the software, produce well-secured software, and respond to vulnerabilities. OWASP SAMM is used as a maturity reference across governance, design, implementation, verification, and operations.

The reviewed process demonstrates useful controls but does not yet satisfy a mature, fully automated DevSecOps release gate. The improvement plan above is therefore part of the documented posture.

References