stackbook.io
🔍
← Back to Syllabus
Day 13Level 1 — Synthesis

Security Basics: Identity, Access, and Data

Learn: 40 minMap: 25 minDesign: 45 min

Core Concepts (5)

  • 1.Authentication proves who you are; authorization decides what you may do
  • 2.Grant least privilege by default
  • 3.Encrypt data in transit and at rest
  • 4.Never trust input; validate at every boundary
  • 5.Threat modelling asks what can go wrong before it does

Map to Your Experience

Think of the most sensitive data your system holds. Who can read it today, and how would you know if someone who should not did?

Design Brief: Threat-Model a Notes App

Learn

Security is not a feature added at the end. It is a set of decisions made throughout design, and like other architecture decisions, the costly ones are hard to fix later.

Start with two terms often confused. Authentication answers who are you? Typical methods are passwords with a second factor, or signing in through a trusted identity provider. Authorization answers what are you allowed to do? A logged-in user can edit their own notes but not someone else's. Many real breaches are authorization failures, where the system checked identity but forgot to check permission on a specific record.

The principle of least privilege says every user, service, and process should have only the access it needs, no more. A reporting job needs read access, so do not give it write. This limits the damage when, not if, a credential leaks.

Protect data in two states. In transit, it travels over the network, and TLS encrypts it so that eavesdroppers see nothing useful. At rest, it sits on disk, and encryption there protects against stolen disks or backups. Store passwords as salted hashes produced by a slow algorithm such as bcrypt or argon2, never in plain text. Keep secrets such as API keys out of source code.

Treat all input as hostile. Validate and sanitise what crosses a boundary, use parameterised queries to prevent SQL injection, and escape output to prevent cross-site scripting. Add rate limiting to slow down guessing and abuse.

A lightweight way to apply all this is threat modelling. Draw the system, mark where data crosses trust boundaries, then ask four questions: what are we protecting, what can go wrong, what will we do about it, and did we do a good job? Even a thirty-minute session finds problems that no scanner will.

Map

For a notes app, name one asset, one attacker, and one attack path. For example, a stranger guessing share links. Then name a control that would make that path harder.

Design

Threat-model a notes app that supports sharing by link. Draw the components, mark trust boundaries, list five threats such as link guessing or stolen sessions, and give a concrete control for each. Specify how passwords are stored and how share links expire. State one control you chose not to adopt and why.

Requirements

  • •List assets and trust boundaries
  • •Identify 5 threats
  • •Give a control for each

Constraints

  • •Users can share notes by link
  • •Passwords must never be stored in plain text

Must Cover

assetsthreatscontrols

Trade-off Axis

security vs usability

Competencies Advanced

security compliance → L1security compliance → L2

Ready to Design?

Open this day in the Design Studio. The studio follows this track: its days, concepts, patterns and trade-offs are loaded, and you keep one design across the whole track.

Open in Studio →