هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
$ مستخدم عادي# بصلاحية root (أو مع sudo)
المهارات في هذا الفصل
- Security engineering — P972–P981
The attack surface in three tiers
Name the control at every tier, or the tier is only a drawing.
Most attack surface maps are a list of hosts. A useful one has three tiers and a named control at each, because the control is the only part you can change.
- Client: CSP + SRI, Cookie flags, Frame options
- Edge: DNSSEC + CAA, WAF + rate limit, HSTS + TLS 1.3
- Origin: Server-side authZ, Parameterised SQL, Signed object URLs
Full note: P972 — The attack surface in three tiers
Threat modelling in one hour
The model is the actions it produced, not the diagram.
A one-hour threat model is not a smaller version of a two-week one. It is a different output: five actions with names on them, and a written list of what you decided not to fix.
- Scope one service: One service, its data, its entry points, and the people who can say yes.
- Draw the boundary: A one-page flow diagram where every crossing is named and questioned.
- Ask STRIDE: Element by element, the letters that apply, written as actor, action, asset.
- Act with a name: A decision, an owner and a date per threat; accepted risks carry a name.
Full note: P973 — Threat modelling in one hour
Five controls that stop most breaches
Five controls, boring, run every week.
Most breaches are not clever. They are a known vulnerability on an internet-facing box, a password with no second factor, an admin account everyone shares, a backup that was online when the ransomware arrived, and nobody watching the login page.
- Patch what the internet can reach; most breaches start with a known CVE that had a fix.
- MFA on every admin path: console, VPN, CI, and the database console.
- No shared admin account and no standing root.
- Backups offline, and a restore you have actually tested.
Full note: P974 — Five controls that stop most breaches
Six gates between design and deploy
Each gate answers one question, and the pipeline enforces the answer.
The secure SDLC is not a tool purchase. It is six points where a change can be stopped, each with one question attached.
- Design: Data flow drawn, STRIDE pass, trust boundaries named.
- Build: Dependencies pinned and hashed; an SBOM per artefact.
- Test: Unit tests, SAST on the diff, DAST on the preview.
- Gate: Policy as code: no critical open, provenance verified.
Full note: P975 — Six gates between design and deploy
Secrets management
Store, inject, rotate, revoke - skip the fourth and the first three are decoration.
Every secrets programme is four verbs, and most teams only do the first.
- Store once: One store per environment, encrypted at rest, with a named owner and a rotation method.
- Inject late: A file at run time, from a workload that proved its identity with OIDC.
- Rotate on a clock: A schedule for time and an event for people, rehearsed in staging.
- Revoke to prove it: Leases by prefix, keys to Inactive, sessions killed, and a list of what is left.
Full note: P976 — Secrets management
CVE response in four numbers
Rank by exploitation, patch inside the window, verify with evidence, report on one page.
Four numbers decide how a CVE gets handled, and none of them is the headline score.
- 9.0 - the CVSS critical floor. It ranks the queue; it never proves exploitation.
- 0 or 1 - on the KEV list or not. That one flag outranks the score.
- 7 days - the patch window you set for critical, counted from publication.
- 1 page - asset, CVE, action, evidence and the risk you accepted.
Full note: P977 — CVE response in four numbers
Anatomy of an SBOM line
Five fields, one component, or the line is only a label.
An SBOM is only useful if each line names one component exactly. Five fields do that, and each one fails in its own way.
- Name: How the registry spells it. Names collide across ecosystems.
- Version: The exact version shipped, never a range and never latest.
- Licence: The declared licence. It is declared, so it can be wrong.
- Hash: The digest of the artefact. Without it the SBOM is a list of names.
Full note: P978 — Anatomy of an SBOM line
Incident response
Declare early, contain wide, rebuild clean, review with names.
An incident response playbook is four phases and one habit: writing things down while they happen.
- Declare: One commander, one channel, one timeline, and a severity said out loud.
- Contain: Capture first, isolate at the network, disable the credential, block the path.
- Eradicate: Rebuild from a known-good image, patch the entry point, rotate everything.
- Review: A timeline from logs and a short list of dated actions with names.
Full note: P979 — Incident response
Least privilege in five checks
Permissions granted on request, reviewed on a clock, revoked on exit.
Least privilege is not a permission matrix. It is a set of habits that decide what a compromised account can reach.
- Every human role starts with no standing access and has to ask for it.
- Permissions are granted to a role, never to a named person.
- Production write needs a session and a ticket, not a group.
- Unused grants expire, and somebody reviews them.
Full note: P980 — Least privilege in five checks
Supply chain gates in four blocks
Pin, build, scan, verify, and fail the pipeline on the fourth step.
Supply chain security is twenty commands in four blocks, and most teams run two of them.
- Lock and pin:
npm ci --ignore-scripts - Build:
docker buildx build --sbom=true . - Scan:
trivy image --severity CRITICAL $IMG - Verify:
cosign verify --key cosign.pub $IMG
Full note: P981 — Supply chain gates in four blocks