Authentication and Authorization Design — JWT and the Division of Responsibilities Across Layers
Explains the design of authentication and authorization in DDD and clean architecture. Covers the division of responsibilities where authentication and authorization live in the presentation layer and business rules in the domain layer, the structure of JWT, the implementation with Laravel × tymon/jwt-auth, access/refresh tokens, and role-based authorization.
Chapter 15: Designing an Authentication and Authorization System — Passwords, Sessions, MFA, and Audit Logs
This chapter covers, for junior engineers and from a database-design angle, the difference between authentication and authorization, password hashing (bcrypt/argon2), session management, multi-factor authentication (MFA / TOTP), account lockout (OWASP/NIST compliant), and audit logs.
Chapter 16: OAuth and OpenID Connect — Authentication Integration With External Services
This chapter covers, for junior engineers, OAuth 2.0's four roles, Authorization Code Flow + PKCE, OpenID Connect's ID Token (JWT), the modern standard following Implicit Flow's deprecation under RFC 9700, and DB design for social login.
IAM: Policy JSON Syntax and a Practical Approach to Terraform Execution Permissions
Learn the syntax and evaluation order of IAM policy JSON and the relationship between roles and trust policies, then create a dedicated IAM user and group for Terraform execution to move off administrator-equivalent credentials.
TLS と証明書 — 何を信じて暗号化しているか
TLS が保証する 3 つの性質のうち、証明書が担うのは相手の同一性であることを解説します。証明書チェーンの検証、中間証明書の配信責任、TLS 終端の位置が変えるもの、証明書エラーの読み分けを扱います。
Web アプリの主要な攻撃と対策
XSS・CSRF・SQL インジェクションを中心に、Web アプリの主要な攻撃を「成立条件」から整理し、その条件を崩す対策を導きます。エスケープとプレースホルダの違い、CSRF トークンと SameSite の関係、認可不備が最多である理由を扱います。
オリジンと CORS — ブラウザが何を境界にして遮るか
オリジンを scheme・host・port の 3 つ組として定義し、同一オリジンポリシーが遮るのは読み取りであって送信ではないことを解説します。プリフライトが飛ぶ条件、ワイルドカードと資格情報が併用できない理由、Vary の必要性を扱います。
クッキー — 誰が、いつ、どこへ自動で送るか
クッキーの属性を「どこへ送るか」「いつまで持つか」「誰が読めるか」の 3 つに整理し、スコープがオリジンと一致しないことから生じる事故を解説します。Domain がサブドメインへ広がること、SameSite の判定が site 単位であることを扱います。
文字コード — 文字とバイト列の対応
文字集合と符号化方式の違いを起点に、文字の数え方が 4 通りあること、同じ文字に見えて違うバイト列になる正規化、並べ替えと比較を決める照合順序、保存時にバイト数で効く上限、そして解釈の境目が複数あることが生む脆弱性を扱います。
認証と認可 — 誰かを確かめることと、何を許すこと
認証 (Authentication) と認可 (Authorization) の違いを、順序・失敗時のステータスコード・実装場所の観点から解説します。認証の 3 要素、セッションとトークンの持ち回り方、RBAC などの認可モデル、記述問題で答えるときの骨子を扱います。