smaple.tr
Security

Secure SDLC: What Each Phase Should Produce

Mehmet Kurtipek
July 2, 2026
15 min read
Security
Secure SDLC
Threat modeling
Application security

A secure SDLC is your normal development lifecycle with a security activity added to every phase, and each activity leaves something you can check: written security requirements at planning, a threat model at design, review rules and automated scans during the build, targeted tests before release, and a patch and disclosure routine after launch. The point is to catch the flaws a scanner can't see, such as a missing authorization check, while they are still a line in a ticket. The most widely cited reference is NIST's Secure Software Development Framework (SSDF). Version 1.1 is still the final one; a draft of 1.2 came out in December 2025.

Why it's worth the effort

You will often see a chart claiming a bug costs 100 times more to fix in production than in design, credited to IBM. Nobody has found the study behind it. When The Register looked into it in 2021, the trail ended at internal IBM training-course notes cited in a 1987 textbook, with no project data behind them, so it's a weak number to build a business case on.

The better argument is that some flaws can be fixed late and some can't. A missing rate limit can go on the API gateway next week. A data model that never recorded which organization owns each record can't be patched by a scanner or a firewall; someone has to rewrite queries across the codebase. Broken access control is still first in the OWASP Top 10:2025, and nobody can test an access rule that was never written down.

If you sell software or connected devices in the EU, there is also a legal reason. The Cyber Resilience Act has been in force since December 2024. Since 11 September 2026, manufacturers have had to report actively exploited vulnerabilities in their products: an early warning within 24 hours of becoming aware, then a fuller notification within 72 hours. The main obligations apply from 11 December 2027: security requirements covering planning, design, development and maintenance, vulnerability handling, and a software bill of materials (SBOM) that covers at least the top-level dependencies.

Check which side of the scope line you're on. The Act covers hardware and software products, including the remote data processing they need to work, such as the cloud back end that lets a smart-home app control a device. Its recital 12 leaves out websites that don't support a product's functionality and points cloud services, SaaS included, to the NIS2 Directive. A product that sits on the boundary is a question for a lawyer.

What each phase should produce

Call the phases whatever your process calls them (our SDLC post covers the general lifecycle). What matters is that each one leaves evidence someone else can look at.

Requirements: rules a test can pass or fail

"The system must be secure" is a wish. A security requirement is something a test or a reviewer can mark as met or not met. A starting set for a typical web app or API:

  • Every endpoint that takes a record ID checks that the record belongs to the caller's organization, and returns 404 if it doesn't.
  • Failed logins are throttled per account, with waits that grow after each failure. NIST SP 800-63B-4, final since July 2025, allows at most 100 consecutive failures per authenticator before it is disabled, and lists increasing waits (30 seconds up to an hour, for example) as a way to slow attackers without locking people out. The "lock the account after five attempts" rule from older checklists lets anyone who knows a username lock that user out.
  • Passwords used on their own are at least 15 characters (8 when they are one factor of MFA), with no composition rules, and are checked against a list of common and breached passwords. That is from the same NIST document.
  • Admin accounts require multi-factor authentication.
  • Personal data never goes into logs, URLs or analytics events.
  • Every approval, role change and data export writes an audit record: who, what and when.

You don't have to invent these. The OWASP Application Security Verification Standard (ASVS 5.0, released in May 2025) is a catalog of requirements in three levels. Level 1 is the minimum and holds about a fifth of them, and ASVS itself says most applications should aim for Level 2. If you're buying custom development, it also gives you a contract line: name the ASVS level you expect and ask the vendor to show how they meet it.

The rules about who may do what need the most care, because they are specific to your product and no checklist knows them. Two client systems we have worked on show what they look like. The data migration platform we built for Tribute Technology in 2022 and 2023 had four roles (superadmin, admin, staff and client) and an approve-or-reject step before data was exported. On Oplist's hospital rostering platform, where we have been the engineering team since November 2023, we added organizations, roles and approval workflows. Each rule like that raises questions such as "can a staff member approve their own import?", and each one needs a written answer before anyone builds the endpoint.

Privacy rules belong here too. The first-party tracking script we wrote for a US paid-media agency's attribution platform hashes emails and phone numbers with SHA-256 in the browser. A rule like that is easy to test: capture the outgoing request in an automated test and assert that no plain email address is in it. Write down its limit as well. Anyone who already has an email address can compute the same hash, so hashed identifiers still need the handling you'd give personal data.

Design: a short threat model for each feature

Threat modeling sounds heavier than it is. The Threat Modeling Manifesto reduces it to four questions: What are we working on? What can go wrong? What are we going to do about it? Did we do a good enough job? For one feature, that can be a 30 to 60 minute conversation between the person designing it, the person building it, and someone willing to play the attacker.

STRIDE gives "what can go wrong" a structure: Spoofing, Tampering, Repudiation, Information disclosure, Denial of service and Elevation of privilege. Sketch the data flow, mark where data crosses a trust boundary (browser to API, API to storage, your system to a third party), and ask about each letter at each crossing.

Here is a worked example for a feature most B2B apps end up with. Staff upload a CSV of customer records, a background job parses it, an admin reviews the result and approves it, and only then do the records go live.

What can go wrong

STRIDE

Control

Test

The upload route works without a session (a forgotten debug route, a misconfigured middleware)

Spoofing

Authentication on by default, with an explicit list of public routes

A request with no session gets 401

A staff user changes organizationId in the request and imports into another customer's account

Tampering

The organization always comes from the session; any value in the request body is ignored

An upload with a foreign organizationId is rejected or lands in the caller's own organization

An admin later says they never approved the import

Repudiation

Audit record with the user, the time and the file's hash

Approving writes an audit row

The uploaded file can be downloaded without logging in

Information disclosure

Private storage bucket, short-lived signed URLs

An unsigned URL returns 403

A 2 GB file or a million rows stalls the server

Denial of service

Size limit at the proxy and in the app, a row cap, parsing in a background job

An oversized upload gets 413

A staff user calls the approve endpoint directly

Elevation of privilege

Server-side role check on approve; the uploader can't approve their own import

A staff token on approve gets 403

Two habits keep this from turning into paperwork. Every row becomes an acceptance criterion and a test on the ticket. And risks you decide to accept are written down with a name and a date, so the decision can be revisited.

Imported records usually get exported again, which brings one more well-known hole: a cell that starts with = turns into a live formula when someone opens the export in Excel. ASVS 5.0 (requirement 1.2.10) asks for a single quote in front of any exported field that starts with =, +, -, @, a tab or a null character.

Save the bigger, whole-system threat model for new systems and new trust boundaries: a new public API, a new third-party integration, a new kind of data such as health records.

Build: make the safe way the easy way

  • Lean on framework defaults: parameterized queries through the ORM or query builder, template auto-escaping, the framework's session and CSRF handling. Every place that bypasses them (hand-built SQL strings, dangerouslySetInnerHTML, eval) is a review flag.
  • Route every data access through one authorization helper instead of scattering checks across controllers. Reviewers then have one question to ask: does this new endpoint use it?
  • Keep secrets out of the repository. Secret scanning with push protection blocks a key before it reaches the history. It's free on public GitHub repositories; private ones need GitHub Secret Protection, and on GitLab it's an Ultimate feature. Without either, run gitleaks as a pre-commit hook and in CI. If a key leaks anyway, rotate it; deleting the commit leaves the key in every clone.
  • Put four questions in the pull request template: does this change touch login or permissions, add a dependency, log anything a user sent, or add a public route?

The first requirement in the list above turns into a test like this one. It uses Vitest with supertest; in Jest, drop the first import, since Jest provides it and expect as globals. seed stands for your own fixtures.

import { expect, it } from "vitest";
import request from "supertest";
import { app } from "../src/app";
import { seed } from "./helpers/seed";

it("hides another organization's invoice", async () => {
  const { orgA, orgB } = await seed();

  const own = await request(app)
    .get(`/api/invoices/${orgA.invoice.id}`)
    .set("Authorization", `Bearer ${orgA.userToken}`);
  expect(own.status).toBe(200);

  const foreign = await request(app)
    .get(`/api/invoices/${orgB.invoice.id}`)
    .set("Authorization", `Bearer ${orgA.userToken}`);
  expect(foreign.status).toBe(404);
});

The first request matters as much as the second. A mistyped route also returns 404, and without the 200 check the test would pass against an endpoint that doesn't exist. One test like this per resource type goes straight at the bug class at the top of the OWASP list.

Verification: automate the cheap checks, test the risky parts by hand

A pipeline for a small team needs five kinds of checks. Our DevSecOps post covers wiring them into CI:

  • Static analysis (SAST): Semgrep or CodeQL.
  • Dependencies (SCA): Dependabot or Renovate to keep them current, Trivy or OWASP Dependency-Check for known vulnerabilities.
  • Secrets: gitleaks in CI, on top of push protection.
  • Infrastructure as code: Trivy, which has absorbed tfsec, or Checkov.
  • Dynamic scanning (DAST): ZAP, now branded ZAP by Checkmarx, against staging.

Treat the scanners as dependencies too. On 19 March 2026, attackers with stolen credentials published a malicious Trivy release and force-pushed 76 of the 77 version tags of the trivy-action GitHub Action to credential-stealing code (Aqua's advisory). Pipelines that referenced the action by tag ran it; Trivy images referenced by digest were not affected. Pin third-party actions to a full commit SHA and images to a digest, and let Dependabot or Renovate propose the updates. Pinning narrows the risk without removing it (some older trivy-action commits still pulled another action by tag), so keep the list of third-party actions short.

Fail the build only on findings you would always stop for: a committed secret, or a critical vulnerability in a dependency you actually use, especially one listed in CISA's Known Exploited Vulnerabilities catalog. Everything else goes to a triage list someone reads every week. If the pipeline fails on every medium finding, people learn to click past it.

Scanners don't know your business rules, so authorization and workflow logic need hands-on testing. Run the threat-model tests, then try to break the flows: change IDs, replay requests, skip steps, approve your own work. Before a major launch, or for systems holding sensitive data, an external penetration test is worth paying for. Hand the testers your threat model so they spend their days on your real risks.

Release: a short checklist and an SBOM

  • No open critical or high findings, unless someone has signed off on the risk with a date.
  • Secrets live in a secret manager, separate for each environment, and production data isn't copied into test.
  • Security headers and TLS settings are checked; debug routes and verbose error pages are off.
  • Logins, permission changes and exports are logged, and someone gets an alert when they spike.
  • An SBOM in CycloneDX or SPDX format is generated at build time and stored with the release.

The SBOM is what lets you answer "are we affected?" quickly the next time a widely used library gets a critical CVE. For products sold in the EU, the CRA makes it mandatory from December 2027.

Maintenance and response: patch deadlines and a way to hear about bugs

After launch, most security work is upgrades. When we were the engineering team for Diderot, the course platform at Carnegie Mellon, part of the job was upgrading the AWS Elastic Beanstalk platform and the Python version while courses were running on it. Plan for that work, because runtimes stop getting security fixes on a published date: Python 3.10 reached end of life on 1 October 2026.

Write down patch deadlines you can keep. A reasonable start for a small team: actively exploited or critical issues within two working days, high within two weeks, the rest with the next scheduled upgrade. Name the person who reads the alerts, because an unread Dependabot queue is no better than none.

Give outsiders a way to report problems: a security.txt file (RFC 9116) at /.well-known/security.txt with a contact address and an expiry date (both fields are required), and a reply within a few days.

Agree on the incident plan before you need it: who decides, who tells customers, and which clocks start. Under the GDPR you have 72 hours to notify the supervisory authority of a personal data breach, and the CRA adds its 24-hour early warning for exploited vulnerabilities. Our post on incident response goes through the plan itself.

Which framework to follow

Framework

What it is

Good for

NIST SSDF (SP 800-218)

Practices in four groups: Prepare the Organization, Protect the Software, Produce Well-Secured Software, Respond to Vulnerabilities

Mapping your process to a neutral, widely referenced list

Microsoft SDL

Ten practices, from threat modeling and cryptography standards to the supply chain and monitoring

Seeing what a mature program covers

OWASP SAMM 2.0

Maturity model with 5 business functions and 15 practices

Scoring where you are and choosing the next step

OWASP ASVS 5.0

Catalog of verifiable requirements in three levels

Writing requirements, test cases and contract terms

For a small team, use ASVS for requirements and the SSDF as the map. A SAMM assessment becomes useful once a handful of practices are actually running; before that, it mostly measures gaps you already know about.

Where a small team should start

If you're starting from nothing, this order puts the cheap pieces in place first:

  1. Write down the access rules for your main resources and add one cross-organization test per resource type.
  2. Turn on secret scanning with push protection (or gitleaks where you don't have it) and dependency alerts on every repository.
  3. Hold one threat-model session for the next feature that touches login, payments, files or personal data, and put the rows on the ticket.
  4. Add the four security questions to the pull request template.
  5. Write down your patch deadlines and who reads the alerts.
  6. Before the next major release, generate an SBOM and go through the release checklist.

Keep the trail: tickets, review comments, scan results, accepted risks. That is what you'll show when a customer sends a security questionnaire, and what an ISO 27001 or SOC 2 auditor asks for; in ISO 27001:2022, Annex A controls 8.25 to 8.31 cover secure development, from the lifecycle itself to outsourced development and separate environments. We are working toward ISO 27001 and preparing for SOC 2 ourselves, and hold neither yet.

Frequently asked questions

Is a secure SDLC the same as DevSecOps?

They overlap. DevSecOps is mostly about automating security checks in the delivery pipeline. A secure SDLC also covers requirements, design reviews and vulnerability response, which no pipeline does for you.

Do we need a dedicated security team?

Not to start. You need one person who owns the process: they keep the requirement list, run the threat-model sessions and watch the patch deadlines. Bring in outside specialists for penetration tests and for systems where a breach would be expensive.

Does anything change for AI features?

NIST has published SP 800-218A, an SSDF profile for generative AI and dual-use foundation models. For an app that calls a model API, the threat model also needs to cover prompt injection, what the model can do through the tools you give it, and which data you send to the provider. The OWASP Top 10 for LLM Applications (2025) works as the checklist here: prompt injection is LLM01, and a model with more tools or permissions than it needs is LLM06, excessive agency.

If you're planning a product and want to talk through its security requirements before the build starts, get in touch.

Related Articles

July 15, 2026

DevSecOps Pipeline: What to Scan, Where, and What Should Block

Secret, code, dependency, image and DAST scans for a small team's CI/CD pipeline: where each runs, what should block a merge, and a working GitHub Actions file.

Read More: DevSecOps Pipeline: What to Scan, Where, and What Should Block
June 23, 2026

OWASP Top 10 2025: What Changed and How to Fix Each Risk

OWASP's 2025 list adds two categories and folds SSRF into access control. What each risk looks like in a real web app or API, and what to fix first.

Read More: OWASP Top 10 2025: What Changed and How to Fix Each Risk
June 22, 2026

Buying a Penetration Test: Scope, Cost Drivers and Preparation

A buyer's and developer's guide to penetration testing: what you pay for, how to scope and prepare, and what to do when the report arrives.

Read More: Buying a Penetration Test: Scope, Cost Drivers and Preparation