Lesson 2 of 3
In Progress

Workshop Textbook: SSDLC with Hands-On Coding

omri sagron 20/09/2026

Workshop Textbook — Secure Software Development Lifecycle (SSDLC) with Hands-On Coding

How to read this book. Each chapter opens with what you are about to learn and closes with a quick self-check. Along the way you will meet four kinds of companions:

💡 Tip — a field-tested shortcut or industry statistic worth remembering.

🌍 Real World — an actual breach or incident that makes the theory concrete.

⚠️ Watch Out — the mistake practitioners actually make with this topic.

Learning Outcome — what you should be able to do before moving on.

Table of Contents

  1. Introduction to SSDLC
  2. Key Security Principles
  3. Requirements Gathering
  4. Secure Design
  5. Secure Development
  6. Secure Testing
  7. Deployment and Monitoring
  8. DevSecOps and Continuous Monitoring
  9. Case Studies and Practical Exercises
  10. Final Reflections and Best Practices

Appendices: SSDLC Terminology · Bibliography and References


Chapter 1: Introduction to the Secure Software Development Lifecycle

🎯 In this chapter: what the classic SDLC looks like, what changes when the “S” for Secure is added, and why the industry paid billions to learn this lesson the hard way.

1.1 What is SDLC?

The Software Development Lifecycle (SDLC) is a well-defined process used to design, develop, test, and deploy software efficiently. It typically includes the phases of Requirements Gathering, Design, Development, Testing, Deployment, and Maintenance.

When security is integrated throughout the SDLC, we transition to the Secure Software Development Lifecycle (SSDLC). In an SSDLC, security is a fundamental consideration in every phase of development — not an afterthought bolted on at the end.

1.2 The Importance of SSDLC

🌍 Real World: The MOVEit file-transfer breach and the T-Mobile data breach both trace back to vulnerabilities that an SSDLC would have been designed to catch. The result: hundreds of millions of exposed records and remediation costs far exceeding what prevention would have required.

Integrating security early reduces the likelihood of vulnerabilities reaching production and dramatically lowers the cost of fixing security issues — a cost that grows steeply the later a flaw is discovered.

💡 Tip: “Security left until the end of development is more expensive to address than building it in early on” (Codacy Blog, 2023).

🧠 Check yourself: Can you name the six SDLC phases — and say, for one of them, what a “security activity” in that phase would look like?

Chapter 2: Key Security Principles

🎯 In this chapter: the three ideas that underpin every security decision you will ever make — the CIA Triad, Least Privilege, and Defense in Depth.

2.1 The CIA Triad

The CIA Triad is the foundation of security in software development:

  • Confidentiality: Only authorized users have access to sensitive information.
  • Integrity: Information is protected from being altered or tampered with.
  • Availability: Systems and information are available to authorized users when needed.

2.2 Principle of Least Privilege (PoLP)

The Principle of Least Privilege is a cornerstone of security: users and systems are granted only the minimum access required to perform their roles. This limits the potential damage caused by user error, compromised credentials, or malicious activity.

⚠️ Watch Out: The most common PoLP failure is not granting too much access — it is never revoking it. Access reviews belong on the calendar, not on the wish list.

2.3 Defense in Depth

Defense in Depth is a layered security strategy that places multiple, overlapping security measures at different points in the software architecture. Each layer provides redundancy — if one defense fails, others remain in place to protect the system.

Learning Outcome: You can explain the key security principles and describe how each contributes to a secure software system.

Chapter 3: Requirements Gathering

🎯 In this chapter: how to write security requirements next to functional ones, and how thinking like an attacker (misuse cases) sharpens both.

3.1 Introduction to Security Requirements

The Requirements Gathering phase traditionally focuses on functional specifications. In an SSDLC, security requirements must be defined just as early: encryption standards, authentication rules, and compliance with regulations such as the GDPR and PCI DSS.

3.2 Use Cases and Misuse Cases

To capture security requirements, developers create two complementary artifacts:

  • Use cases describe how the system should function.
  • Misuse cases describe how an attacker might abuse it (e.g., SQL injection, cross-site scripting).

Example:

  • Use case: The system requires users to authenticate with a username and password.
  • Misuse case: An attacker attempts to bypass authentication by injecting malicious code into the input fields.

A complete security requirement set for user authentication:

  • Multi-factor authentication (MFA) required for all users.
  • Passwords stored using bcrypt hashing with a minimum cost factor of 12.
  • Account lockout after 5 consecutive failed login attempts.

3.3 Security Checklists

Use checklists during requirements gathering to make security coverage systematic rather than ad hoc: data protection laws, access controls, encryption protocols, and secure data storage.

💡 Tip: “Well-defined security requirements can prevent 50% of vulnerabilities” (SAFECode, 2018).

Learning Outcome: You can write a security use case and its corresponding misuse case.

Chapter 4: Secure Design

🎯 In this chapter: finding vulnerabilities while they are still lines on a whiteboard — the cheapest moment you will ever have to fix them.

4.1 Threat Modeling

Threat modeling identifies possible vulnerabilities and designs mitigations during the design phase. Tools such as the Microsoft Threat Modeling Tool and OWASP Threat Dragon help visualize potential attack surfaces.

The four steps of threat modeling:

  1. Identify assets (e.g., sensitive data).
  2. Identify potential threats (e.g., SQL injection).
  3. Analyze the risk and potential impact of each threat.
  4. Design mitigations (e.g., parameterized queries).

4.2 Secure Design Principles

  • Separation of duties: No single user should have full control over critical tasks.
  • Fail-secure defaults: When an operation fails, the system defaults to a secure state.
  • Defense in depth: Multiple layers of protection survive the failure of any single layer.

Example: For a file upload feature — restrict the permitted file types (e.g., .jpg, .png, .pdf), verify file headers to prevent content spoofing, and scan every file for malware before accepting it.

💡 Tip: “Implement security at every design stage to reduce attack surfaces” (Scopic, 2023).

Learning Outcome: You can build a basic threat model and describe its mitigations.

Chapter 5: Secure Development

🎯 In this chapter: the three coding habits that prevent most vulnerabilities, demonstrated on the attack that has topped incident charts for two decades — SQL injection.

5.1 Secure Coding Practices

Three practices carry most of the weight:

  • Input validation: Always validate user input to prevent SQL injection and other injection attacks.
  • Output encoding: Encode output to prevent cross-site scripting (XSS).
  • Error handling: Handle errors securely, without exposing stack traces or connection strings.

Insecure — vulnerable to SQL injection:

cursor.execute("SELECT * FROM users WHERE username = '" + username + "' AND password = '" + password + "'")

Secure — parameterized queries instead of dynamic SQL:

cursor.execute("SELECT * FROM users WHERE username = %s AND password = %s", (username, password))

Secure — escaping output against XSS:

<div>Hello, <?php echo htmlspecialchars($_GET['name'], ENT_QUOTES, 'UTF-8'); ?></div>

5.2 Using Secure Coding Standards

Follow established secure coding guidelines rather than inventing your own:

  • OWASP Top 10: The ten most critical web application security risks.
  • CERT Secure Coding Standards: Language-specific guidelines for avoiding common vulnerabilities.

💡 Tip: “90% of software vulnerabilities stem from improper coding practices” (SAFECode).

Learning Outcome: You can identify common security vulnerabilities and apply secure coding practices to mitigate them.

Chapter 6: Secure Testing

🎯 In this chapter: the three families of security testing, when to use each, and how a penetration test thinks.

6.1 Types of Security Testing

  • SAST (Static Application Security Testing): Analyzes code without executing it — catches issues such as SQL injection in the source itself.
  • DAST (Dynamic Application Security Testing): Tests the running application — finds runtime issues such as insecure server configurations.
  • IAST (Interactive Application Security Testing): Combines both, observing the application from within while it runs.

Example — running a SonarQube static analysis:

sonar-scanner \
  -Dsonar.projectKey=myproject \
  -Dsonar.sources=. \
  -Dsonar.host.url=http://localhost:9000 \
  -Dsonar.login=your_token

6.2 Penetration Testing

Penetration testing simulates real-world attacks on the system to identify and exploit vulnerabilities before an attacker does. Tools such as OWASP ZAP automate testing for common vulnerabilities like XSS and CSRF:

zap.sh -daemon -config api.key=your_api_key -port 8080

Learning Outcome: You can differentiate between the security testing methods and conduct basic tests using automated tools.

Chapter 7: Deployment and Monitoring

🎯 In this chapter: shipping without undoing everything you secured — hardening, configuration, and the logs that tell you something is wrong.

7.1 Secure Deployment Practices

  • Environment hardening: Remove unnecessary services; enforce least privilege on deployment credentials and infrastructure.
  • Monitoring: Continuously watch for threats using tools such as the ELK Stack, Graylog, Splunk, or Datadog.

Example — logging failed login attempts in Python:

import logging
logging.basicConfig(filename='security.log', level=logging.WARNING)
logging.warning('Failed login attempt for user: %s', username)

7.2 Secure Configuration

  • Disable unused ports and services.
  • Regularly update and patch all software components.
  • Keep API keys and other secrets out of the codebase.

⚠️ Watch Out: A hardened server with a secret committed to the repository is not hardened. Secret scanning belongs in the pipeline, not in the post-mortem.

Learning Outcome: You can outline a secure deployment strategy and implement basic monitoring.

Chapter 8: DevSecOps and Continuous Monitoring

🎯 In this chapter: turning everything from chapters 3–7 into an automated pipeline that runs on every commit.

8.1 What is DevSecOps?

DevSecOps integrates security into the DevOps pipeline, automating security checks at every stage. Security becomes a continuous property of the delivery process — from the developer’s commit to the production environment — rather than a gate at the end.

8.2 Automating Security Checks

CI/CD tools such as Jenkins and Azure Pipelines run security tests (SAST, DAST, IAST) automatically on every code change, alongside dependency scanning with Dependabot. These pipelines ensure new code does not introduce known vulnerabilities.

Learning Outcome: You understand the principles of DevSecOps and can add automated security checks to a CI/CD pipeline.

Chapter 9: Case Studies and Practical Exercises

🎯 In this chapter: everything becomes practice — a real breach on the operating table, and a vulnerability for you to fix with your own hands.

9.1 Case Study: The MOVEit File Transfer Breach

🌍 Real World: Analyze the MOVEit breach and determine how an SSDLC approach could have prevented the underlying vulnerability. Review the case, propose concrete mitigations, and map each one to the SDLC phase where it belongs.

9.2 Hands-On Exercise: SQL Injection

A live coding exercise: identify and fix a SQL injection vulnerability by replacing dynamic SQL with parameterized queries, then verify the fix by re-testing the application.

🛠 Practice placeholder: the interactive lab environment for this exercise will be embedded here.

Chapter 10: Final Reflections and Best Practices

10.1 Best Practices for Secure Software Development

  • Always validate user input.
  • Use strong encryption for sensitive data — in transit and at rest.
  • Continuously monitor for, and patch, new vulnerabilities.

10.2 Final Thoughts

Security is a continuous process, not a one-time event. Integrating security into the SDLC protects against vulnerabilities, reduces the long-term cost of development, and turns security from a launch-blocking scramble into an everyday engineering habit. The case studies, exercises, and tips in this textbook are designed so that you can apply the theory directly to real-world systems — starting with your very next commit.


Appendix A: SSDLC Terminology

Term Definition
CIA Triad Confidentiality, Integrity, Availability — the foundational principles of information security.
SSDLC A methodology that integrates security practices into every phase of the software development process.
Principle of Least Privilege (PoLP) Users, processes, and systems receive the minimal access necessary to perform their tasks.
Defense in Depth A layered security strategy using multiple defensive mechanisms to protect data and systems.
Threat Modeling Identifying and addressing potential security threats to a system during the design phase.
SAST Static Application Security Testing — testing code for vulnerabilities without executing the application.
DAST Dynamic Application Security Testing — testing a running application for vulnerabilities that appear during execution.
IAST Interactive Application Security Testing — a combination of SAST and DAST that tests both code and runtime behavior.
MFA Multi-Factor Authentication — requiring two or more verification factors to gain access to a system.
RBAC Role-Based Access Control — restricting system access to authorized users based on their organizational role.
OWASP Top 10 The ten most critical web application security risks, published by the Open Worldwide Application Security Project.
SQL Injection A code injection technique that exploits vulnerabilities in an application’s SQL queries to manipulate a database.
Cross-Site Scripting (XSS) A vulnerability allowing attackers to inject malicious scripts into webpages viewed by other users.
Penetration Testing A simulated cyberattack used to identify exploitable vulnerabilities in an application or network.
CI/CD Continuous Integration / Continuous Deployment — code changes are automatically tested and deployed, with security tests integrated into the process.

Appendix B: Bibliography and References

  1. SAFECode (2018). “Fundamental Practices for Secure Software Development.” Available at: SAFECode
  2. Scopic Software (2023). “The Secure Software Development Life Cycle (SSDLC): A Comprehensive Guide.”
  3. OWASP. “OWASP Top 10: The Ten Most Critical Web Application Security Risks.” Available at: OWASP Top 10
  4. Ponemon Institute (2021). “Cost of a Data Breach Report.”
  5. CERT Secure Coding Standards (2020).
  6. Codacy Blog (2023). “Why Early Integration of Security in the Software Development Lifecycle Saves Costs.”
  7. Microsoft Threat Modeling Tool. Available at: Microsoft Security
  8. OWASP ZAP. Available at: OWASP ZAP