Courseiva
CAS-005Chapter 6 of 15Objective 2.3

Secure Software Development Lifecycle and Application Security

The secure software development lifecycle (SSDLC) integrates security into every phase of building an application, from planning to maintenance. Without it, software is riddled with hidden flaws that attackers exploit, leading to data breaches and financial loss. For your CAS-005 exam, understanding SSDLC is non-negotiable because it is the foundation for applying secure coding practices, threat modelling, and application security testing.

12 min read
Advanced
Updated Jul 23, 2026
Reviewed by Johnson Ajibi· Senior Network & Security Engineer · MSc IT Security

A simple way to picture Secure Software Development Lifecycle and Application Security

The Custom-Home Construction Analogy

Starting to build a house without a blueprint leads to a chaotic, unsafe structure that costs a fortune to fix later. This mirrors the secure software development lifecycle (SSDLC), where planning security from the start prevents catastrophic vulnerabilities.

Imagine you are hiring a contractor to build a custom home. Most people would demand a detailed blueprint before a single brick is laid. The blueprint shows where every wall, wire, and pipe goes. In software, the blueprint is the design phase, and security requirements are like building codes. A contractor who skips the blueprint and starts framing walls risks putting a load-bearing beam right where the kitchen sink should be. That is a vulnerability. Later, adding a fire escape or reinforcing the foundation after the drywall is up costs ten times more and weakens the whole structure.

In the same way, SSDLC forces developers to think about threats (like a burglar casing the house) before writing a single line of code. They map out every entry point, like windows and doors (APIs and user inputs), and decide which locks (encryption and authentication) go where. An application built without this security-focused blueprint will inevitably have flaws that attackers exploit. Just as a home inspector checks for code violations, application security testing tools scan for vulnerabilities. The entire process replaces the old 'build first, bolt on security later' approach with a proactive, integrated method that saves time, money, and reputations.

How It Actually Works

The secure software development lifecycle (SSDLC) is a structured process for building software that prioritises security at every stage. It replaces the old, dangerous approach of writing code first and then attempting to 'bolt on' security features later—a method that inevitably leaves critical gaps. Think of it as the difference between baking a cake with the sugar already mixed in versus trying to sprinkle sugar on top after it is baked; the first method evenly distributes the ingredient, while the second leaves a clumpy, inconsistent result.

The SSDLC typically follows these phases: planning, design, development, testing, deployment, and maintenance. In the planning phase, the team defines security requirements alongside functional requirements. For example, if the software will handle medical records, the team must plan for compliance with healthcare privacy laws. In the design phase, threat modelling occurs. Threat modelling is a structured activity where the team identifies potential attackers, their goals, and the system's entry points (called the 'attack surface'). A common technique is STRIDE, which stands for Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, and Elevation of Privilege. Each category represents a type of threat: spoofing is pretending to be someone else, tampering is altering data without permission, repudiation is denying an action you performed, information disclosure is leaking sensitive data, denial of service is making a system unavailable, and elevation of privilege is gaining unauthorised access rights.

During the development phase, developers follow secure coding practices. This means not just writing code that works, but writing code that resists attacks. Key concepts include input validation—never trusting user input without checking it first, because malicious input can crash the system or inject harmful commands. Another is output encoding, which ensures that data displayed in a web browser cannot be interpreted as code. For example, if a user types '<script>alert('hack')</script>' into a search box, the application must convert those special characters into harmless text (< becomes &lt;) before showing it on a web page. This prevents cross-site scripting (XSS) attacks, where an attacker forces a website to display malicious code.

Application security testing happens in the testing phase and includes several types of checks. Static application security testing (SAST) analyses the source code without running it, like a spell-checker for security flaws. Dynamic application security testing (DAST) tests the running application by simulating attacks, like a penetration tester poking at a live website. Interactive application security testing (IAST) combines both by instrumenting the application to monitor for vulnerabilities during test execution. These tools find common weaknesses such as SQL injection, where an attacker tricks a database into running malicious commands by typing SQL code into a form field. For instance, if a login form takes a username and password and directly plugs them into a database query, an attacker could enter ' OR '1'='1 as the password, which might log them in as the first user without knowing a real password. Proper input validation and parameterised queries—where the database treats input as data, not code—prevent this.

The deployment phase involves securely configuring the production environment, including setting up firewalls, encrypting data in transit with HTTPS, and managing secrets like API keys with a vault service. Finally, maintenance involves monitoring for new vulnerabilities and applying patches. The entire lifecycle is iterative; feedback from production incidents feeds back into the planning phase for the next cycle. The old development model, called 'waterfall', handled security as a separate, final phase, which meant flaws were discovered far too late. The SSDLC, often implemented using agile methodologies, weaves security checks into every sprint (a short development cycle, typically two weeks). This makes fixes cheaper and faster, exactly as the custom-home analogy illustrates.

The secure software development lifecycle (SSDLC) flows from planning through deployment, with key activities in each phase feeding back into earlier phases for continuous improvement.

Walk-Through

1

Define Security Requirements

During the planning phase, the team collaboratively writes functional and security requirements. For example, they decide that user passwords must be hashed and stored, and that the application must enforce multi-factor authentication for admin accounts. This step sets the security foundation for the entire project.

2

Conduct Threat Modelling

In the design phase, the team maps out data flows, identifies entry points (the attack surface), and systematically categorises threats using STRIDE. They create a data flow diagram and a threat list, then prioritise the highest-risk threats for mitigation. This proactive step prevents design flaws from reaching code.

3

Write Secure Code

During development, developers follow a secure coding standard checklist. They validate all input, encode all output, use parameterised queries for database interactions, and store secrets (like API keys) in environment variables or a vault, never in the source code. They also perform peer code reviews focused on security.

4

Perform Application Security Testing

Before release, the testing phase runs SAST tools on the source code and DAST tools on the running application in a staging environment. Identified vulnerabilities (e.g., SQL injection, XSS, insecure direct object references) are logged, prioritised by severity, and assigned to developers to fix before deployment.

5

Secure Deployment and Monitor

In the deployment phase, the team ensures the production environment is hardened (e.g., firewalls, HTTPS, least privilege for service accounts). After deployment, continuous monitoring with a web application firewall and log analysis detects and alerts on suspicious activity, feeding back into the next planning cycle.

What This Looks Like on the Job

An IT professional, specifically a security architect or a DevSecOps engineer, uses the SSDLC daily to prevent breaches before they happen. Consider a mid-sized e-commerce company building a new checkout feature. The product manager, developers, and security lead meet in the planning phase. They decide that the feature must handle credit card numbers, so they immediately document a requirement: 'All credit card data must be encrypted at rest and in transit, in compliance with Payment Card Industry Data Security Standard (PCI DSS).' This is not a technical decision yet; it is a security requirement written into the user story.

During the design phase, the team conducts a threat modelling session. They draw a data flow diagram showing how data moves from the user's browser to the web server, to the payment gateway, and to the database. They identify a risk: if a developer accidentally logs the full credit card number server-side, an attacker who breaches the server could steal thousands of records. The team decides to implement a 'tokenisation' service, which replaces the real card number with a random token, so the actual number never touches the application's database. This decision is documented.

In the development phase, a junior developer writes a function that takes user input for a discount coupon code and directly inserts it into an SQL query. The security lead runs a SAST tool during the code review, which flags the line as a SQL injection vulnerability. The developer revises the code to use a parameterised query, which defeats the injection attempt. The senior developer also enforces a rule that every function validating user input must call a central sanitation library, not be written from scratch.

During testing, a QA engineer runs a DAST tool against the staging environment. The tool finds that the 'apply coupon' endpoint returns verbose error messages that reveal database table names—an information disclosure vulnerability. The team changes the error handler to show only a generic 'Invalid coupon code' message. After deployment, the operations team sets up continuous monitoring with a web application firewall (WAF) that blocks common attack patterns, and they configure alerts for when the WAF detects a sudden spike in SQL injection attempts. The security professional's job is to facilitate this entire process: facilitating threat modelling workshops, configuring SAST/DAST tools, reviewing code for common weaknesses, and ensuring that every team member knows the secure coding standards. They do not just test after the fact; they embed security checkpoints into every phase, making security a shared responsibility.

How CAS-005 Actually Tests This

For the CAS-005 exam, you must know the SSDLC phases and exactly which security activity belongs to each phase. The exam loves to test your ability to sequence events correctly. A typical question might list four activities (e.g., 'conduct threat model', 'run SAST scan', 'perform code review', 'define security requirements') and ask which is done first. The correct answer is always 'define security requirements' in the planning phase, before any code is written.

The exam also hones in on specific types of application security testing. Expect questions that ask you to differentiate between SAST, DAST, and IAST. A trap they set is describing a tool that examines running code—that is DAST or IAST, not SAST. Another trap: they might describe a 'vulnerability scanner' that checks a live web application for known flaws like outdated libraries; this is DAST. Remember: SAST is white-box testing (you see the source code), DAST is black-box testing (you only see the running app), and IAST is a hybrid that runs alongside the application.

Threat modelling with STRIDE is a high-yield topic. You must memorise the six categories and be able to recognise examples of each. For instance, a question might present a scenario: 'An attacker forges a cookie to impersonate another user.' That is spoofing. Or 'A user claims they did not perform a transaction, but logs do not prove otherwise.' That is repudiation. They may ask which STRIDE category is mitigated by adding digital signatures (answer: repudiation).

Secure coding practices are also heavily tested. You must understand input validation, output encoding, and parameterised queries. A common question format: 'Which coding practice prevents an attacker from injecting SQL commands into a login form?' The answer is 'parameterised queries' (also called prepared statements). They may also test the concept of 'least privilege'—meaning a user or process should have only the minimum access rights necessary to perform its function. For example, a database account used by a web application should not have admin rights.

Finally, the exam will present scenarios of 'shift left' security, which means moving testing earlier in the lifecycle. A question might ask why this is beneficial, and the correct answer is that it reduces the cost and time of fixing vulnerabilities (because fixing a flaw in design is cheaper than fixing it in production). Memorise the SSDLC phases in order and map each security activity to its correct phase. This direct mapping is the most reliable pattern for exam questions.

Key Takeaways

The secure software development lifecycle (SSDLC) integrates security into every phase—planning, design, development, testing, deployment, and maintenance—rather than leaving it to the end.

Threat modelling, using frameworks like STRIDE, identifies potential attackers and their methods before any code is written, reducing costly late-stage fixes.

Static application security testing (SAST) analyses source code for vulnerabilities without running the program, while dynamic application security testing (DAST) tests the live application.

Input validation and output encoding are the two most fundamental secure coding practices, preventing injection attacks and cross-site scripting (XSS) respectively.

Parameterised queries (prepared statements) completely separate SQL code from user data, eliminating the risk of SQL injection.

Shifting security left—performing security checks early in the development cycle—drastically reduces the cost and effort required to fix vulnerabilities.

Easy to Mix Up

These come up on the exam all the time. Here's how to tell them apart.

Static Application Security Testing (SAST)

Analyses source code without running it (white-box).

Detects flaws like SQL injection patterns in code.

Run early in the development phase, before the app is deployed.

Dynamic Application Security Testing (DAST)

Tests the running application by simulating attacks (black-box).

Detects runtime issues like misconfigured headers.

Run in a staging or production-like environment after the app is built.

Input Validation

Checks user-supplied data before it is processed.

Prevents attacks like SQL injection and command injection.

Implemented on the server side, rejecting invalid input.

Output Encoding

Transforms data before it is displayed to the user.

Prevents cross-site scripting (XSS) by converting < to &lt;.

Implemented when rendering data in a web page or email.

Threat Modelling (STRIDE)

Performed during the design phase, before any code is written.

Focuses on identifying potential threats systematically.

Output is a list of threats and mitigation strategies.

Vulnerability Scanning (DAST)

Performed on a running application, during testing or production.

Focuses on finding known vulnerabilities in the live system.

Output is a list of specific, exploitable flaws with severity ratings.

Watch Out for These

Mistake

Security is only a concern for the testing team at the end of the project.

Correct

Security must be integrated into every phase of the software development lifecycle, starting from planning and design.

This misconception persists because older development methodologies (like waterfall) treated testing as a final phase, and many introductory resources still imply security is a separate step. Beginners naturally think of testing as the last thing you do.

Mistake

Threat modelling is just drawing a diagram and is done once at the start of the project.

Correct

Threat modelling is a documented, iterative process of systematically identifying and prioritising threats. It should be revisited whenever the design changes or new features are added.

Because the name sounds like a one-time 'modelling' activity, beginners assume it is like creating a static blueprint. They do not realise that threats evolve as the system evolves.

Mistake

If a developer uses a library that handles authentication, they do not need to worry about secure coding for that part.

Correct

Using a library does not automatically guarantee security; the developer must configure it correctly (e.g., strong password requirements, session timeout) and avoid exposing the library's internal workings.

Many beginners believe that third-party libraries are 'magic' and absolve them of responsibility. They have not yet learned that misconfiguration is a leading cause of breaches.

Mistake

Encrypting all data in the database is enough to make the application secure.

Correct

Encryption protects data at rest, but it does not prevent attacks like SQL injection, XSS, or broken authentication, which target the application logic itself.

Encryption is a very visible and concrete security measure (padlock icon), so beginners overvalue it. They are unaware that most breaches exploit vulnerabilities in code, not in storage.

Do You Actually Know This?

Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.

Frequently Asked Questions

What is the difference between SAST and DAST?

SAST (static application security testing) analyses the source code while the application is not running, like a spell-checker. DAST (dynamic application security testing) tests the running application by simulating attacks, like a penetration tester.

Do I need to memorise all six STRIDE categories for the exam?

Yes, you must memorise them and be able to identify real-world examples of Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, and Elevation of Privilege.

What does 'shift left' mean in security?

Shifting left means performing security testing and reviews earlier in the development lifecycle, which reduces the cost and time required to fix vulnerabilities.

Is static application security testing (SAST) used on compiled binaries?

SAST typically works on source code, not compiled binaries. For binary analysis, a different tool (often called binary analysis or reverse engineering) is required.

What is the most effective way to prevent SQL injection?

Using parameterised queries (also called prepared statements) completely separates SQL logic from user data, making injection impossible.

Can a web application firewall (WAF) replace secure coding?

No, a WAF is a layer of defence that helps block known attack patterns, but it cannot fix underlying insecure code. Secure coding is still required.

Terms Worth Knowing

Keep going

You've finished Secure Software Development Lifecycle and Application Security. Continue through the CAS-005 study guide to build a complete picture of the exam.

Done with this chapter?