How to stop hack/DOS attack on web API

后端 未结 6 1186
时光取名叫无心
时光取名叫无心 2021-01-30 03:15

My website has been experiencing a denial of service/hack attack for the last week. The attack is hitting our web API with randomly generated invalid API keys in a loop.

<
6条回答
  •  误落风尘
    2021-01-30 03:30

    If it's big enough you just can't stop it alone. You can do all the optimisation you want at the app level, but you'll still go down. In addition to app-level security for prevention (as in FSQ's answer) you should use proven solutions leaving the heavy lifting to professionals (if you are serious about your business). My advise is:

    1. Sign-up for CloudFlare or Incapsula. This is day to day for them.
    2. Consider using AWS API gateway as the second stage for your API requests. You'll enjoy filtering, throttling, security,auto-scaling and HA for your API at Amazon scale. Then you can forward the valid requests to your machines (in or outside amazon)

    Internet --> CloudFlare/Incapsula --> AWS API Gateway --> Your API Server

    0,02

    PS: I think this question belongs to Sec

提交回复
热议问题