Field notes on the secure software development lifecycle (secure SDLC). Opinions are marked as opinions.
The core idea
Security bugs found late cost more than bugs found early. The usual reasons: code is already written around the flaw, other teams depend on it, and a fix may need a redesign instead of a one-line change. A design weakness caught in a whiteboard discussion costs an hour. The same weakness found by a customer costs a release, an incident review and possibly a notification to regulators.
Secure SDLC simply means putting security activities into each phase, not tacking a penetration test on at the end. Frameworks you will hear named: Microsoft’s SDL, NIST’s Secure Software Development Framework (SP 800-218), and OWASP’s SAMM and ASVS as maturity and requirements guides. Do not treat any of them as a checklist to complete. Treat them as menus.
Phase by phase
Requirements. Write security requirements next to functional ones. “Users can upload a profile photo” gets a companion: allowed file types, size limits, who can view the photo, how long it is retained. Also decide what data the feature touches. If it handles personal data, the privacy duties under India’s Digital Personal Data Protection Act enter the discussion now, not at launch.
Design. Draw the data flows and ask what could go wrong at each trust boundary. Threat modelling is the structured version of that. Opinion: even a thirty-minute session with a diagram and four engineers finds more serious issues than a month of scanning later, because scanners do not understand your business logic.
Implementation. Give developers safe defaults: framework features that handle output encoding and parameterised database access, approved libraries for crypto, a secrets vault so passwords never enter source files. Add peer review with a short security question list. Automatic checks run on every commit: static analysis of source, a scan of third-party dependencies for known flaws, and a secret-detection tool.
Testing. Dynamic scanning of a running test build, plus targeted tests for abuse cases (“can user A fetch user B’s invoice by changing a number?”). Manual testing by a skilled person for high-risk releases. Opinion: tests for authorisation failures are the most undervalued kind, and broken access control sits at the top of the OWASP Top 10 list for good reason.
Release and operations. Hardened configuration, logging that records security-relevant events without logging passwords or personal data, monitoring, and a clear route for people to report vulnerabilities. Keep an inventory of the components inside each release, which is the idea behind a software bill of materials, so that when a library flaw is announced you can answer “are we affected?” in minutes.
Maintenance and retirement. Patch dependencies on a schedule. Old services nobody owns are future incidents; decommission them and delete their data and credentials properly.
A small worked case
An invented example: a team building a leave-management feature. At requirements, someone notes that leave records include medical reasons, so these are sensitive. At design, the threat discussion spots that managers should see only their own reports’ leave, which suggests a server-side check on every request rather than hiding buttons in the interface. At build, the dependency scan flags an outdated date library with a known flaw, fixed by upgrading. In testing, an abuse-case test changes the employee ID in a request and, surprisingly, retrieves a colleague’s record: the check was missing on one endpoint. It is fixed before release. Total extra effort: a few hours. The alternative is a data exposure report from an employee.
What is theatre
Opinion again. Running a scanner, exporting a 400-page PDF and filing it is theatre if no one triages the results. A mandatory yearly training with a quiz, but no secure defaults in the codebase, is theatre. A security gate that blocks every build for any finding, regardless of severity, teaches developers to bypass it. Better to block only on high-severity, high-confidence findings and track the rest as backlog with owners and dates.
The thing that works is making the secure path the easy path: templates, libraries and pipelines that do the right thing unless you go out of your way. Appoint security champions inside delivery teams, who are developers with a bit of extra training and a direct line to the security team. Measure what matters, such as time to fix high-severity findings and the number of repeat issues, rather than raw counts of bugs found.
Agile and DevOps teams ship daily, so do not bolt on a heavyweight gate. Automate what can be automated, and save human attention for design and the riskiest changes.
Figures and names in the examples are illustrative.
Leave a Reply