shieldfy / API-Security-Checklist
- вторник, 11 июля 2017 г. в 03:12:43
Checklist of the most important security countermeasures when designing, testing, and releasing your API
(中文版请戳这:中文版)
Checklist of the most important security countermeasures when designing, testing, and releasing your API.
Basic Auth
Use standard authentication (e.g. JWT, OAuth).Authentication
, token generating
, password storing
use the standards.JWT Secret
) to make brute forcing token very hard.HS256
or RS256
).TTL
, RTTL
) as short as possible.redirect_uri
on server side to allow only whitelisted URLs.response_type=token
).state
parameter with a random hash to prevent CSRF on OAuth authentication process.HSTS
header with SSL to avoid SSL Strip attack.GET (read)
, POST (create)
, PUT (replace/update)
and DELETE (to delete a record)
.content-type
on request Accept header ( Content Negotiation ) to allow only your supported format (e.g. application/xml
, application/json
... etc) and respond with 406 Not Acceptable
response if not matched.content-type
of posted data as you accept (e.g. application/x-www-form-urlencoded
, multipart/form-data ,application/json
... etc ).XSS
, SQL-Injection
, Remote Code Execution
... etc).credentials
, Passwords
, security tokens
, or API keys
) in the URL, but use standard Authorization header./me/orders
instead of /user/654321/orders
UUID
instead.XXE
(XML external entity attack).Billion Laughs/XML bomb
via exponential entity expansion attack.X-Content-Type-Options: nosniff
header.X-Frame-Options: deny
header.Content-Security-Policy: default-src 'none'
header.X-Powered-By
, Server
, X-AspNet-Version
etc.content-type
for your response , if you return application/json
then your response content-type
is application/json
.credentials
, Passwords
, security tokens
.200 OK
, 400 Bad Request
, 401 Unauthorized
, 405 Method Not Allowed
... etc).Feel free to contribute , fork -> edit -> submit pull request. For any questions drop us an email at team@shieldfy.io.