🔐

Cybersecurity Patterns

Security fundamentals—authentication, encryption, OWASP top 10, secure coding. 18 patterns for building secure applications.

18 patterns

Cybersecurity patterns protect your application and users from threats. These 18 patterns cover authentication (passwords, MFA, OAuth), authorization (RBAC, permissions), encryption (data at rest, in transit), input validation (prevent injection), session management, CSRF protection, secure headers, rate limiting, and audit logging. Security is not optional—build it in from day one. Follow OWASP guidelines and assume all input is malicious.

All Cybersecurity Patterns

OAuth

OAuth lets users log in with Google, GitHub, etc. instead of creating passwords. Learn when to use it, common mistakes, and how to implement OAuth securely.

oauthauthenticationthird-party-login

JWT (JSON Web Token)

JWT is a token format for secure API authentication. Learn when to use JWTs, common security mistakes, and how to implement them correctly.

jwtjson-web-tokenapi-authentication

MFA (Multi-Factor Authentication)

MFA adds a second layer of security beyond passwords (codes, biometrics, hardware keys). Learn when to require MFA, common mistakes, and implementation tips.

mfa2famulti-factor-authentication

RBAC (Role-Based Access Control)

RBAC assigns permissions based on user roles (Admin, Editor, Viewer). Learn when to use RBAC, common mistakes, and how to implement it for team collaboration.

rbacpermissionsroles

Input Sanitization

Input sanitization cleans user input to prevent XSS, SQL injection, and code injection. Learn when to sanitize, common mistakes, and best practices.

input-sanitizationvalidationxss-prevention

CORS (Cross-Origin Resource Sharing)

CORS controls which websites can access your API from the browser. Learn when to use CORS, common errors, and how to configure it securely.

corscross-originapi-security

Zero Trust

Zero Trust assumes every request is a threat until proven otherwise. Learn when to use Zero Trust, common mistakes, and how it differs from traditional security.

zero-trustsecurity-modelnetwork-security

CSP (Content Security Policy)

CSP is an HTTP header that blocks XSS attacks by controlling which scripts, styles, and resources can load. Learn how to configure CSP securely.

cspcontent-security-policyxss-prevention

XSS Prevention

XSS (Cross-Site Scripting) injects malicious scripts into your site. Learn how to prevent XSS with input sanitization, CSP, and secure templating.

xsscross-site-scriptingxss-prevention

Rate Limiting

Rate limiting restricts how many requests users can make to your API to prevent abuse, DDoS, and brute-force attacks. Learn how to implement it.

rate-limitingapi-securityddos-prevention

Encryption

Encryption scrambles data so only authorized parties can read it. Learn about encryption at rest, in transit, and how to implement it securely.

encryptionaestls

API Keys

API keys are secret tokens that authenticate API requests. Learn how to generate, store, and use API keys securely.

api-keysapi-authenticationapi-security

SSO (Single Sign-On)

SSO lets users log in once and access multiple apps. Learn when to implement SSO, common mistakes, and how it works with SAML and OAuth.

ssosingle-sign-onsaml

Session Management

Session management tracks logged-in users with cookies or tokens. Learn how to implement sessions securely and avoid common pitfalls.

session-managementcookiessession-tokens

SQL Injection Prevention

SQL injection injects malicious SQL into queries to steal or delete data. Learn how to prevent SQL injection with parameterized queries.

sql-injectionsql-securityparameterized-queries

CSRF Protection

CSRF tricks users into executing unwanted actions on sites they're logged into. Learn how to prevent CSRF with tokens and SameSite cookies.

csrfcross-site-request-forgerycsrf-token

Secure Headers

Secure headers protect against XSS, clickjacking, and other attacks. Learn which headers to set and why they matter.

secure-headershttp-headerssecurity-headers

Password Policies

Password policies enforce strong passwords and secure storage. Learn modern best practices for password requirements, hashing, and rotation.

password-policiespassword-securitybcrypt