Open to everyone Reading, lesson 57 of 100, 2 min read
Secure development
Security built in, not bolted on
A secure development lifecycle (SDLC) adds security activities to each stage of building software, so problems are found when they are cheap to fix.
| Stage | Security activity |
|---|---|
| Requirements | Write down security needs: who may do what, what data is sensitive, which laws apply |
| Design | Threat modelling: draw how data flows and ask what could go wrong at each step |
| Build | Secure coding standards, code review, safe libraries, no secrets in code |
| Test | Automated security tests, dependency scanning, manual testing of risky features |
| Release | Hardened configuration, secrets in a vault, signed releases |
| Operate | Patching, monitoring, an easy way for outsiders to report vulnerabilities |
Threat modelling with STRIDE
A popular way to brainstorm threats:
| Letter | Threat | Breaks |
|---|---|---|
| S | Spoofing (pretending to be someone) | Authenticity |
| T | Tampering (changing data) | Integrity |
| R | Repudiation (denying an action) | Non-repudiation |
| I | Information disclosure | Confidentiality |
| D | Denial of service | Availability |
| E | Elevation of privilege (gaining more rights) | Authorisation |
Testing tools
- SAST (static analysis): reads source code looking for risky patterns.
- DAST (dynamic analysis): tests the running application from outside.
- Dependency scanning (SCA): lists the libraries you use and warns about known vulnerabilities in them.
- Secret scanning: finds passwords and keys accidentally committed to code.
Supply chain
Modern applications use hundreds of open-source packages. An attacker who poisons one popular package reaches every application that uses it. Pin versions, review updates, use trusted registries and keep a software bill of materials (SBOM): a list of every component you ship.
Note
Notice how many of these practices appear in the platform you are using: tests, static analysis, dependency checks and signed, checksummed releases.