GitHub:https://github.com/shieldfy/API-Security-Checklist/blob/master/README-zh.md
以下是当你在设计, 测试以及发布你的 API 的时候所需要核对的重要安全措施.
Basic Auth 使用标准的认证协议 (如 JWT, OAuth).Authentication, token generating, password storing 这些轮子, 使用标准的.Max Retry 和自动封禁功能.JWT Secret) 以增加暴力破解的难度.HS256 或 RS256).TTL, RTTL).redirect_uri, 只允许白名单的 URL.response_type=token).state 参数并填充随机的哈希数来防止跨站请求伪造(CSRF).HSTS 协议防止 SSLStrip 攻击.GET (读取), POST (创建), PUT (替换/更新) 以及 DELETE (删除记录), 如果请求的方法不适用于请求的资源则返回 405 Method Not Allowed.content-type 字段使用内容验证来只允许支持的格式 (如 application/xml, application/json 等等) 并在不满足条件的时候返回 406 Not Acceptable.content-type 的发布数据和你收到的一样 (如 application/x-www-form-urlencoded, multipart/form-data,application/json 等等).XSS, SQL-注入, 远程代码执行 等等).credentials, Passwords, security tokens, or API keys), 而是使用标准的认证请求头.Quota, Spike Arrest, Concurrent Rate Limit) 以及动态地部署 APIs resources./me/orders 替代 /user/654321/ordersUUID 代替自增长的 id.XXE 攻击.Billion Laughs/XML bomb.X-Content-Type-Options: nosniff 头.X-Frame-Options: deny 头.Content-Security-Policy: default-src 'none' 头.X-Powered-By, Server, X-AspNet-Version 等等.content-type, 如果你的类型是 application/json 那么你的 content-type 就是application/json.credentials, Passwords, security tokens.200 OK, 400 Bad Request, 401 Unauthorized, 405 Method Not Allowed 等等).