TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Help How Do You Mitigate a HTTP GET Flood DoS

2 点作者 jonathan-kosgei将近 7 年前
I run a small API that has a no sign-up required free tier.<p>This has been thoroughly abused over the past few weeks as I&#x27;ve been getting hundreds of millions of calls a day from countries all over the world in what I now believe is a DoS attack.<p>I&#x27;ve tried a few dozen things to try and stop it, including banning countries which has helped.<p>I&#x27;ve inspected the requests and they don&#x27;t have any bogus query params to break caching like in the examples I&#x27;ve seen. It&#x27;s just a simple GET to &#x2F; on the API with a number of headers set.<p>Does anyone know of any helpful way to mitigate this kind of attack?<p>Here&#x27;s a sample log event; {&#x27;type&#x27;: &#x27;REQUEST&#x27;, &#x27;resource&#x27;: &#x27;&#x2F;&#x27;, &#x27;path&#x27;: &#x27;&#x2F;&#x27;, &#x27;httpMethod&#x27;: &#x27;GET&#x27;, &#x27;headers&#x27;: {&#x27;accept-language&#x27;: &#x27;ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7&#x27;, &#x27;X-Forwarded-Proto&#x27;: &#x27;https&#x27;, &#x27;X-Forwarded-For&#x27;: &#x27;88.200.137.163&#x27;, &#x27;Host&#x27;: &#x27;myapi.co&#x27;, &#x27;X-Forwarded-Port&#x27;: &#x27;443&#x27;, &#x27;accept-encoding&#x27;: &#x27;gzip, deflate, br&#x27;, &#x27;X-Amzn-Trace-Id&#x27;: &#x27;Root=1-5b1e2ce9-f7f53b56b21b4ae4aca1c49e&#x27;, &#x27;accept&#x27;: &#x27;<i>&#x2F;</i>&#x27;, &#x27;user-agent&#x27;: &#x27;Mozilla&#x2F;5.0 (Windows NT 10.0; Win64; x64) AppleWebKit&#x2F;537.36 (KHTML, like Gecko) Chrome&#x2F;66.0.3359.181 Safari&#x2F;537.36&#x27;}, &#x27;queryStringParameters&#x27;: {}, &#x27;pathParameters&#x27;: {}, &#x27;stageVariables&#x27;: {}, &#x27;requestContext&#x27;: {&#x27;resourcePath&#x27;: &#x27;&#x2F;&#x27;, &#x27;httpMethod&#x27;: &#x27;GET&#x27;, &#x27;extendedRequestId&#x27;: &#x27;ITv0aHJuFiAFkmw=&#x27;, &#x27;requestTime&#x27;: &#x27;11&#x2F;Jun&#x2F;2018:08:03:53 +0000&#x27;, &#x27;path&#x27;: &#x27;&#x2F;&#x27;, &#x27;protocol&#x27;: &#x27;HTTP&#x2F;1.1&#x27;, &#x27;stage&#x27;: &#x27;published&#x27;, &#x27;requestTimeEpoch&#x27;: 1528704233073, &#x27;requestId&#x27;: &#x27;fb4b5e8f-6d4d-11e8-9fcb-4f9526203fa9&#x27;, &#x27;identity&#x27;: {&#x27;cognitoIdentityPoolId&#x27;: None, &#x27;accountId&#x27;: None, &#x27;cognitoIdentityId&#x27;: None, &#x27;caller&#x27;: None, &#x27;sourceIp&#x27;: &#x27;88.200.137.163&#x27;, &#x27;accessKey&#x27;: None, &#x27;cognitoAuthenticationType&#x27;: None, &#x27;cognitoAuthenticationProvider&#x27;: None, &#x27;userArn&#x27;: None, &#x27;userAgent&#x27;: &#x27;Mozilla&#x2F;5.0 (Windows NT 10.0; Win64; x64) AppleWebKit&#x2F;537.36 (KHTML, like Gecko) Chrome&#x2F;66.0.3359.181 Safari&#x2F;537.36&#x27;, &#x27;user&#x27;: None}}}

1 comment

cimmanom将近 7 年前
CDN or caching proxy?