Securing APIs Print

  • backenddevelopment, backend, security, guide, howto, solution, zillionkinghost, hosting
  • 0

Protecting endpoints.

WHAT TO REQUIRE

Encryption, on every request Authentication, on everything not deliberately public Authorisation, checked per record

WHAT THE COMMONEST SERIOUS FAULT IS

Authentication without authorisation.

WHAT THAT LOOKS LIKE

A valid token used to request another user's records, by changing an identifier.

WHAT PREVENTS IT

Verifying entitlement to the specific record, on every request.

WHAT AUTHENTICATION APPROACHES EXIST

Tokens issued on sign-in API keys, for machine consumers Delegated authorisation, for third-party access

WHAT TO CONFIGURE ON TOKENS

Short lifetimes A refresh mechanism Revocation

WHAT TO IMPLEMENT

Rate limiting, per consumer Request size limits Validation of every input

WHY RATE LIMITING

It prevents both abuse and accidental overload from a defective client.

WHAT TO RETURN WHEN LIMITED

A clear status, and when to retry.

WHAT TO LOG

Authentication and authorisation failures, which indicate probing.

WHAT NOT TO EXPOSE

Internal identifiers that reveal volume Detailed errors Endpoints not intended for public use


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot