简体   繁体   中英

Is there any way to Block request from Postman or other apps to call Restful API

Infra of system

Expected: I want to block requests, which is not from Server FE (domain.com)

Ex: Users make request from another apps such as Postman -> it will response 403, message access denied.

I used the rules of ALB, it works but users can cheat on Postman Also I use AWS WAF to detect request. But it's not work. Is there any way to block request from Postman or another apps? We can generate secret_key and check between Server FE and Server BE. But users can see it on Headers and simulator the headers on Postman and call API success.

Current Solution: I use Rule of Application Load Balancer to check Host and Origin. But users can add these params on Postman and request success. Rule ALB When I add Origin matching value (set on ALB) -> We can request successful

Postman success Postman denied

Users can cheat and call API success. Thanks for reading. Please help me give any solution for this one. Thanks a lot.

No. HTTP servers have no way to know what client is being used to make any HTTP request. Any HTTP client (Browsers, PostMan, curl , whatever) is capable of making exactly the same requests as each other.

The user-agent header is a superficial way to do this, but it's easy enough for PostMan or any other HTTP client to spoof the user-agent header to one that makes the request look like it is coming from a web browser agent.

You can only make it more challenging to do so. Some examples to thwart this behavior includes using tools like Google captcha or CloudFlare browser integrity check, but they're not bulletproof and ultimately aren't 100% effective at stopping people from using tools/automation to access your site in unintended ways. At the end of the day, you're limited to what can be done with HTTP, and PostMan can do everything at the HTTP layer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM