Should I use Cognito Identity pool for unauthenticated user to call API gateway

0

Hi So I am working on a "contact-us" form of a website for a company. Anyone can fill out the form and submit, which would call API gateway, which, through a lambda function, commit the message into dynamo db and also post it into AWS SQS. Due to the nature of the use case, an unauthenticated user can submit the form. So now, the choice that I am facing is, to whether use cognito identity pool for securing the API gateway call. As its unauthenticated user, exposing the identity pool ID and region on client side javascript is enough to give a malicious user access to the API. So should I even bother with authentication? What if I leave it unauthenticated and throttle the requests in API gateway? Are there any other options for securing the API? As I am new to AWS, any advice of yours would be appreciated. Thanks

1개 답변
0
수락된 답변

Hi.

Sounds like this is a classic case of an unauthenticated API. I wouldn't bother using an Identity Pool, as you say anyone could extract the information from you webpage and submit a massive amount of responses anyway. I would make sure to setup a rate limit and throttling to avoid an easy flooding. Make sure to use AWS WAF to block the most common attacks and set a rate limit. Make sure you setup CloudWatch alarms to detect a flood of responses, basically detecting a flooding attack. Create automation to "shut down" the API in case of the alarm going off. That is how I would solve it.

Hope that helps!

profile picture
전문가
답변함 10달 전
profile picture
전문가
검토됨 한 달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠