🚀 Submit a Challenge — SecDim AppSec Village CTF at DEF CON 34 and Win a ROG Xbox Ally

Defensive Programming 2nd Core Principle

1h 15mBeginnerSecure Design

The second defensive programming principle addresses a wide spread issue in programs where concepts are loosely modelled. This problem is a root cause for many insecure decisions. In this course, we formalise the problem into a number of anti patterns, then learn how to systematically address them using three implementation techniques.

Topics

  1. Anti patterns

    Lesson15m

    It is important to consider selecting the appropriate data types to represent values in programming as these may lead to security vulnerabilities and complications in validation logic.

  2. Principle

    Lesson15m

    Data models must accurately represent business logic, making illegal states unrepresentable.

  3. First Implementation Technique

    Lesson15m

    We will explore how to make unsafe states unrepresentable and ensure immutability.

  4. Second Implementation Technique

    Lesson15m

    We will explore what are Domain Primitives and how they help reducing many unsafe states in a program.

  5. Third Implementation Technique

    Lesson15m

    We will explore another way of making unsafe states unrepresentable, leading to more robust and safe code, eliminating possible inconsistencies and guiding the handling of all possible states.