Secure Software Development Lifecycle
VΓ²ng Δα»i PhΓ‘t triα»n PhαΊ§n mα»m An toΓ n
Security Activities at Each SDLC Phase
Security is not a phase β it is a continuous concern across every stage of the SDLC. The earlier a vulnerability is discovered, the cheaper it is to fix. This is the foundation of shift-left security.
| Phase | Security Activities | Cost to Fix if Found Here |
|---|---|---|
| Requirements | Security requirements, privacy requirements, compliance requirements (BSP/SBV/PCI-DSS), threat modeling kick-off | Cheapest ($1) |
| Design | Architecture risk analysis, secure design principles, data flow diagrams, attack surface analysis, threat modeling | Low ($10) |
| Implementation | Secure coding standards, peer code review, SAST in IDE (real-time), avoid dangerous functions | Medium ($100) |
| Testing | DAST, IAST, SCA, fuzz testing, security test cases, misuse case testing | High ($1,000) |
| Deployment | SAST gate in CI/CD, secrets scanning, container image scanning, DAST against staging | Very High ($10,000) |
| Maintenance | Patch management, SCA for new CVEs, periodic penetration testing | Highest ($100,000+) |
The 1-10-100 Rule: Fixing a defect in Requirements costs $1 (relative). In Design: $10. In Testing: $100 (CISSP exam often uses this simplified ratio). In production: $10,000+. Shift-left to minimize cost and risk.
Development Methodologies & Security Implications
| Methodology | How Security Fits | Security Risk |
|---|---|---|
| Waterfall | Sequential phases; security review typically at end of cycle | HIGH β late discovery |
| Agile / Scrum | Security user stories in backlog; security checklist in Definition of Done; security sprints | MEDIUM β needs discipline |
| DevOps | Continuous delivery; security must be automated in pipeline (β DevSecOps) | MEDIUM β speed pressure |
| Spiral | Risk-driven; iterates through planning β risk analysis β engineering β evaluation; security naturally embedded | LOW β risk analysis built-in |
Agile Security Checklist (Definition of Done)
- βΈSecurity acceptance criteria met
- βΈSAST scan passed (no new High/Critical)
- βΈNo new CVEs in added dependencies
- βΈPeer security review for security-sensitive code
Key SDLC Security Documents
- βΈSecurity Requirements Specification
- βΈThreat Model (STRIDE / PASTA)
- βΈSecurity Architecture Document
- βΈCode Review Report + VAPT Report
Misuse Cases & Software Acquisition Security
Misuse Cases
A misuse case defines how a system should NOT be used β documenting attacker scenarios. For each use case, developers should define the corresponding misuse case and ensure test cases cover it.
Use Case vs Misuse Case
Use Case: "Customer submits loan application"
Misuse Case: "Attacker submits loan application with another customer's ID to commit fraud"
Software Acquisition & Outsourcing
When buying software or outsourcing development, security cannot be assumed β it must be contractually defined.
- βΈSecurity requirements in contract/SLA
- βΈRight to audit third-party code
- βΈSLA for critical security patches
- βΈSBOM requirement for delivered software
- βΈSource code escrow for critical systems
Key Terms
Software Development Life Cycle β structured process for planning, creating, testing, and deploying software
Move security testing and review to earlier phases β requirements and design β rather than testing phase
Relative cost to fix: $1 in requirements, $10 in design, $100 in testing, $10,000+ in production
Documents how an attacker might abuse the system β inverse of a use case; drives security test cases
Risk-driven iterative methodology: Planning β Risk Analysis β Engineering β Evaluation; security naturally embedded
Dynamic / Static / Interactive Application Security Testing β different phases, complementary coverage
- 1. Shift-left = catch security issues EARLY (requirements/design) β 100Γ cheaper than fixing in production. This is a core CISSP principle.
- 2. Waterfall security risk: security review only at the end = high cost if issues found late. CISSP often presents Waterfall as the "risky" choice for security.
- 3. Agile: add security acceptance criteria to user stories β "As a user, I want my data encrypted at rest" is a valid security requirement in a backlog.
- 4. Misuse cases: define how system should NOT be used, then derive security test cases from them. This is how QA tests security.
- 5. Software acquisition: security requirements must be in the CONTRACT β you cannot audit code you have no right to see.
(1) Requirements phase: All new Platform C features require a "Security Impact" field in Jira β what data is collected/processed? What regulatory obligation applies (BSP, SBV, PCI-DSS)?
(2) Design phase: STRIDE threat model required for any new external integration (new partner APIs, telco integrations for Partner C, Partner E payment redirect).
(3) Implementation: Security checklist in PR template β parameterized queries? input validation? no secrets in code? encryption used?
(4) Testing: govulncheck + gosec run before every merge to main. Java Platform A: SpotBugs + Checkmarx SAST.
(5) Deployment: Trivy image scan + ArgoCD approval required before any production deploy.
(6) Maintenance: Dependabot weekly dependency scans; Partner A penetration test annually.
Action: Add security acceptance criteria to the next 3 Platform C sprints. Example: "Acceptance: loan data encrypted at rest (AES-256), loan_id not guessable from URL."
Practice Questions
Q1: Why does fixing a vulnerability in the requirements phase cost far less than in production?
A: In requirements, only the specification document changes. In production, the fix requires code change, testing, re-deployment, potentially notifying regulators, and possibly incident response β all multiplying the cost.Q2: Which SDLC methodology carries the highest risk of late security discovery, and why?
A: Waterfall β because security review is typically performed only at the end of the sequential process. All phases must complete before testing begins, meaning vulnerabilities introduced in requirements or design are not found until very late.Q3: What is a misuse case, and how does it differ from a use case?
A: A use case describes legitimate intended usage ("Customer submits loan application"). A misuse case describes how an attacker would abuse the system ("Attacker submits loan application with another customer's ID"). Misuse cases drive security test cases.Q4: At which SDLC phase should the initial threat model be created?
A: Design phase β before any code is written. A threat model created in requirements/design costs $10 to act on. The same model created after production deployment costs $10,000+.Q5: When acquiring third-party software, what security element must be contractually defined?
A: Security requirements, SLA for critical security patches, right-to-audit provisions, and SBOM delivery. You cannot enforce what is not in the contract.