Lesson plan: Protecting Applications

AP Cybersecurity · Unit 5 Securing Applications and Data · Topic 5.5 Protecting Applications · Practice set

At a glance

Suggested time
2 class periods (45 min)
Pacing
The only set for Topic 5.5. The CED gives Topic 5.5 two class periods; this plan suggests 2 for this set, Day 1 for 5.5.A (secure by design and secure by default) and Day 2 for 5.5.B (input sanitization). The CED does not divide its periods between the two LOs, so that split is this plan's suggestion. Input sanitization is the mitigation for the attacks students met in Injection Attacks and Memory and Path Attacks.
Before this set
Injection Attacks (SQL injection, cross site scripting, and the quote mark that ends a typed value early) and Memory and Path Attacks (directory traversal, which Problem 9 🔒 uses). The Foundations lesson Web Applications, Databases, and Files for how a form's input reaches a query, a page, or a file. From Anti-Malware and Patching (Unit 4): why installing updates matters, which the lesson's Log4Shell story leans on.
Skills
2.A Identify security controls, and explain how they mitigate risks.
2.B Determine layered security controls that address vulnerabilities.

The one idea: Security is the maker's job, built in from the first design and switched on when the product ships. In code, that starts with checking every piece of user input before the program uses it.

Day by day

Day 1 · Secure by design and secure by default45 min

Day 2 · Input sanitization45 min

Differentiation

If students are struggling
On Day 1, before the pairs work, students make a four-row chart from the lesson's definition boxes: secure by default and the three principles, each with one thing a company does to follow it. On Day 2, they add one row each for SQL injection, cross site scripting, and directory traversal: what the adversary types and what the check removes or refuses.
Extension
Students check an app they use from outside, as the lesson's bookstore owner would: does the maker publish security notices that name the flaw, the versions affected, and the fix? What is switched on in a fresh install before anyone changes a setting? They write three sentences on what they found.
Vocabulary support
library, vulnerability, secure by design, secure by default, radical transparency, accountability, security-first posture, control characters, input sanitization, verification function, structured query language (SQL) injection, cross site scripting (XSS), directory traversal.

From the course framework

LO 5.5.A Identify the application security principles of secure by design and security by default.

  • 5.5.A.1 Secure by design is an initiative that encourages companies to include security in all phases of product development including design. When organizations implement secure by design, security is a design principle not just a technical feature.
  • 5.5.A.2 Secure by design includes three design principles: - i. Companies should take ownership of customer security outcomes. Companies should build products that meet the security needs of their customers. - ii. Companies should embrace radical transparency and accountability. Sharing relevant security-related product news and updates quickly increases security for everyone. - iii. Companies should build organizational structure and leadership to implement secure by design. Companies need leaders who are focused on security and have a security-first posture.
  • 5.5.A.3 Secure by design includes the concept of secure by default, which is the idea that security features for software and devices should be enabled by default. Devices and software should be secure to use out of the box, with security features already enabled.

LO 5.5.B Explain how user input sanitization protects applications.

  • 5.5.B.1 When users enter input into an application, the application typically encases that input in special characters to process it. The characters that encase the user input are called control characters and include the single quote, the double quote, and the semicolon.
  • 5.5.B.2 When creating a program that takes user input, programmers should use a function to verify that user input meets their expected criteria and does not include any control characters that could be used to manipulate the system. This verification function can sanitize user input by removing potentially malicious characters, or it can give the user an error and force the user to provide different input. This can protect against many application attacks, including: - SQL injection attacks - XSS attacks - Directory traversal attacks