Web API Security
Web API Security
SECURE
YOUR
WEB API
Aram Tchekrekjian @AramT87
Introduction
Web API Security is a crucial
topic that you need to be
properly aware of
@AramT87
API Key Authentication
This is the minimum level of security you
can put for your API.
@AramT87
Rotate API Keys
API Keys should have expiry and should
be renewed every once and while.
@AramT87
JWT Authentication
with Refresh Tokens
@AramT87
OAuth 2.0 and OpenID
Connect
OAuth 2.0 is an authorization
protocol which defines how tokens
are transferred and how the
different clients would request them
@AramT87
OAuth 2.0 and OpenID
Connect
JWT are stateless since the authorization
server won't maintain state of the token and
the resource can verify the authenticity of
the JWT from its embedded digital signature
@AramT87
Apply Server Side
Validations
@AramT87
Force HTTPS
Having your
requests/responses transferred
over plain HTTP would expose
your and customers' data to
loads of troubles
An attacker would be
monitoring the network (via
different network monitoring
tools) of a user and will start
sniffing the requests/responses,
and since your site is using plain
HTTP, then everything will be
clearly visible for the attacker (
personal information, credit
card data ...etc.)
@AramT87
Use a Valid and Strong
SSL/TLS Certificate
Your website as well as your Web API should
always use an SSL/TLS certificate that is valid
and strong
@AramT87
Implement Rate Limiter
A rate limiter’s function is to throttle
the requests to your APIs for a
specified number of requests within a
specified time or duration.
https://github.com/OWASP/wstg
@AramT87
Apply Captcha at your
Frontend
Having a captcha can greatly
reduce the number of
fraudulent and bot requests to
your APIs
@AramT87
Store your Passwords
Hashed ...but
Only using Cryptographically
Secure Hashing Functions
Aram Tchekrekjian
AramT87
CodingSonata.com/newsletters