Before the First Commit: Five Security Gates to Erect Before Development Begins
Ask a security engineer where most breaches begin, and the answer is rarely 'during coding.' It is before coding — in the decisions about architecture, tooling, and process that get made in the eager, deadline-free days before a project kicks off. Retrofit security onto a running project and you will pay a premium in rework and risk. Establish it beforehand, and it becomes load-bearing infrastructure.
Below are five gates every enterprise should erect before the first line of code is written. For each, we include implementation steps scaled for small teams, mid-size organizations, and well-funded enterprises.
Gate One: Threat Modeling
Threat modeling forces a team to answer, in writing, what they are building, what can go wrong, and what they will do about it — before the architecture calcifies.
Small teams: Use a simple STRIDE-based walkthrough during design reviews. A whiteboard session and a shared document cost nothing. Even two hours of structured 'how would an attacker abuse this?' discussion catches the obvious gaps.
Mid-size organizations: Adopt a lightweight template (OWASP's Threat Dragon is free) and make a completed model a gate criterion for any new service. Assign an engineer — not a security specialist, an engineer — ownership of each model.
Enterprise: Integrate threat modeling into your SDLC tooling so no design doc reaches approval without an attached model. Track findings as tickets with SLAs, and review models annually as architectures drift.
Gate Two: Dependency Vetting
Your supply chain is only as trustworthy as the least scrutinized package in it. Decide before development which components are acceptable and how they will be verified.
Small teams: Maintain an allowlist of package registries. Prefer dependencies with healthy maintenance histories, and pin versions. A quick pass with a free SCA tool like OWASP Dependency-Check takes minutes.
Mid-size organizations: Automate SCA scanning in CI, generate a Software Bill of Materials (SBOM) for every build, and set a policy for triaging flagged vulnerabilities by severity.
Enterprise: Establish a formal open source review board, require SBOMs from all vendors, and use repository proxying so internal builds only pull from a curated internal mirror.
Gate Three: Secrets Management
Hardcoded credentials are the gift that keeps giving — to attackers. The half-life of a leaked API key in a public repository is measured in minutes; the half-life of one buried in a private codebase is measured in years.
Small teams: Adopt a secrets manager early — even free tiers from major cloud providers beat environment files committed to Git. Add a pre-commit secret scanner from day one.
Mid-size organizations: Standardize on a central vault, enforce short-lived credentials where possible, and rotate on a schedule rather than on incident.
Enterprise: Implement workload identity so services authenticate without static secrets at all, and run continuous scanning across all repositories — including archived ones — for leaked material.
Gate Four: Build Pipeline Hardening
Your CI/CD pipeline is the most privileged system in your organization. It touches source code, credentials, and production — which makes it a prime target.
Small teams: Enable branch protection and require review before merge. Restrict who can modify pipeline configuration files, and treat those files as production code.
Mid-size organizations: Use ephemeral, isolated build runners; sign build artifacts; and scope pipeline credentials to the minimum permissions each job requires.
Enterprise: Apply zero-trust principles to the pipeline itself — identity-based access for every job, artifact signing and verification at deployment, and continuous auditing of pipeline configuration changes.
Gate Five: Rollback Strategy
Security is not just prevention; it is recovery. A team that cannot quickly revert a bad deploy cannot contain a bad deploy being used maliciously.
Small teams: Simply decide, in advance, how you will roll back. Document the steps. Test them once before you need them.
Mid-size organizations: Automate rollbacks with health-check triggers, and retain versioned artifacts so any prior release can be redeployed on demand.
Enterprise: Build rollback into your incident response runbooks, rehearse it in game days, and ensure rollback paths themselves are protected — an attacker who can poison your recovery can hold you hostage indefinitely.
The Common Thread
None of these gates requires exotic technology. What they require is the discipline to make security a precondition rather than a retrofit. Teams that erect these five gates before development begins do not just ship more securely — they ship faster, because they spend less time unwinding decisions that were made carelessly in week one. In enterprise security, the cheapest vulnerabilities to fix are the ones that never get designed in.