Security for Engineers/API & Service Security

OWASP API Security Top 10

Broken object auth, broken authZ, excessive data exposure, rate limiting gaps, and mass assignment — mapped to REST/gRPC.

3/5Overview: 30m

OWASP API Top 10 — engineer map

RiskPlain languageFix
Broken object level AuthZIDORCheck resource ownership
Broken AuthZAdmin functions exposedRole + permission checks
Broken object property levelMass assignmentAllowlist fields on PATCH
Unrestricted resource consumptionNo rate limits429, quotas, pagination caps
Broken function level AuthZDELETE /admin openAuthZ on every route
Unrestricted access to sensitive flowNo MFA on password changeStep-up auth
SSRFServer fetches attacker URLURL validation, network policy
Security misconfigurationDebug on in prodHardening checklist
Improper inventoryShadow APIsGateway catalog
Unsafe consumption of APIsTrusting third-party JSONValidate external payloads

Excessive data exposure

Return only fields client needs. GET /user shouldn't include password_hash, internal flags.

GraphQL: field-level authZ on resolvers (Communication → GraphQL).

Rate limiting & abuse

Per IP, per API key, per user. Exponential backoff on 429.

Communication covers rate limit headers; Microservices → Gateway implements edge limits.

Webhook security

HMAC signature on raw body, timestamp replay window (Communication → Webhooks).

Error handling

Production errors: generic message + request_id. No stack traces, no SQL errors to client.

Log details server-side only (Observability → Logging — don't log secrets).

gRPC specifics

  • Metadata for auth tokens
  • Max message size limits
  • Reflection disabled in prod

Cross-reference: Databases → SQL — parameterized queries for injection; theory not repeated here.

Further Reading

Hands-On Tasks (Optional)

Security design drills — threat modeling, auth flows, and incident playbooks. Assumes Networking (TLS) fundamentals.

  • Security-review a REST endpoint

    POST /users with JSON body. Checklist: auth, validation, mass assignment, rate limit, error leakage, logging of PII.

    15m