I have a mobile application where users give advertise, other users view and accept it. Recently, I began to notice that bots started to give their own advertisements. I have moderators but there a so much advertisements that it is impossible to check everything (another challenge, is that bargain happens instantly, in realtime). It is classical REST API. I googled a lot and to my surprise can't find any open source solution that protects from illegal bot activities. How do you tackle such cases? Is it possible to eliminate it at all or I can only make their life more difficult taking some measures?
How to tackle bots in REST APIs
2.2k Views Asked by Olav At
2
There are 2 best solutions below
Related Questions in ANDROID
- Delay in loading Html Page(WebView) from assets folder in real android device
- MPAndroidChart method setWordWrapEnabled() not found
- Designing a 'new post' android activity
- Android :EditText inside ListView always update first item in the listview
- Android: Transferring Data via ContentIntent
- Wrong xml being inflated android
- AsyncTask Class
- Unable to receive extras in Android Intent
- Website zoomed out on Android default browser
- Square FloatingActionButton with Android Design Library
- Google Maps API Re-size
- Push toolbar content below statusbar
- Android FragmentPagerAdapter Circular listview
- Layout not shifting up when keyboard is open
- auDIO_OUTPUT_FLAG_FAST denied by client can't connect to localhost
Related Questions in IOS
- Overlapping UICollectionView in storyboard
- Cannot pod spec lint because of undeclared type errors
- Is the transactionReceipt data present in dataWithContentsOfURL?
- UIWebView Screen Fitting Issue
- ZXingObjC encoding issues
- iOS: None of the valid provisioning profiles allowed the specific entitlements
- How to hide "Now playing url" in control center
- CloudKit: Preventing Duplicate Records
- Slow performance on ipad erasing image
- Swift code with multiple NSDateFormatter - optimization
- iOS 8.3 Safari crashes on input type=file
- TTTTimeIntervalFormatter always returns strings in English
- How do I add multiple in app purchases in Swift Spritekit?
- Setup code for xibs in iOS. -awakFromNb:
- iOS Voice Over only reads out the title of any alert views
Related Questions in BOTS
- C++ IRC Bot Buffer Error
- Python AttributeError: 'str' object has no attribute 'append' (Specific)
- Problems creating a polling system for a twitch bot
- A good estimate as to how many visitors are bots
- Creating a custom bot rather than using Hubot with Firebase
- Change audio output
- I want to create a bot that can open my bluestacks app player , then install apps to open various apps and then finally close bluestacks .
- Bamboo and xCode Bot solution
- Identify sending user, Python IRC
- How to block "bot*" bot via .htaccess
- Xcode Server Simulator Times Out Waiting 120 Seconds
- Python (2.7.10): Key Error: 'id'
- How can I get these Perl scripts to delay?
- addition with python into a .txt file
- How do I add variable `XP` to `userData.XP` for my Discord.js bot?
Related Questions in MOBILE-SECURITY
- Android : Failed to attach: unable to connect to remote frida-server: closed
- Pdf report issue on mobSF
- In flutter, which is more secure using platform functions/ dependency or dart dependency?
- How to secure captured or downloaded media files in react native application
- Frida: Change value of method calling enum
- Risks in shortcutting OAuth/OIDC?
- Why does Apple recommend to store passwords, secrets, and keys in iOS Keychain when apps are sandboxed?
- Can we retrieve the iphone user pass code on a jailbroken device?
- Block a URL in a WebView on Android
- Android App Root detection method was bypassed by focusing specifically on the rootbeer library being used
- Trying to call different class's variable but java reflection does not work
- Where can I securely store audio in flutter so that I can use it again later?
- Publish the APK in Google play store with "V4" signature
- Prevent/disable 3rd party keyboards for WkWebView web views
- What would happen if my iOS distribution certificate is compromised?
Related Questions in API-SECURITY
- Spring Boot API how to validate NONCE value sent in request header to avoid replay attacks
- Client side securing token vulnerability circular dilemma
- API resource security with Asgardeo scope in Ballerina
- Secure API without a user registration - php/Laravel
- Secure API Call in React JS
- Use OAuth2.0 Resource Owner Password credentials to access a secured API
- How to prevent attackers from using my password reset mechanism to email bomb people?
- How to secure API behind Kong Gateway for both pubic and internal traffic
- Is it enough to use JWT when there is only one user role for API-Security?
- Does it make sense to have an API key for accessing my API on my frontend?
- How to protect my RESR Api calls in Flutter?
- SubscriptionKeyInvalid in Azure API Management for an endpoint in a product that does not require subscription?
- Is code injection possible in R via functions that read CSVs or parse JSON from the web?
- Rest API authorization in microservice when you have 1000's of APIs
- Best practices to follow when building API service to be used by customers
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
OPEN SOURCE BOT DETECTION
If you search Github for
bot detectionyou will land on this page https://github.com/topics/bot-detection?q=bot+detection&unscoped_q=bot+detection, that at this moment contains 7 results, that aren't very relevant, but if you remove the query string, and use https://github.com/topics/bot-detection you get 36 results, where some may be relevant depending on your backend language. You can also search using the termsbrowser detection,crawler detection,device detection, etc.Some of this repos rely on the
user-agentand/or in the IP address to detect the bot, and this approach is easily bypassed, because theuser-agentheader is easy to spoof and nowadays the attackers are using bot farms to rotate the ips, thus making it very hard to block them.But should you use one of this repos? Why not, it's one more layer of defense, and at least you block the less sophisticated bots that don't run from a bot farm.
The Difference Between WHO and WHAT is Accessing the API Server
Before we dive in how you can tackle the problem I want to first clear a misconception that is usual among developers of any seniority level, the difference between Who vs What is accessing the API server.
I recommend you to read the article Why Does Your Mobile App Need An Api Key? where I go in detail about the difference between Who and What is accessing your API server, but for your convenience I will extract here the main takes from it:
So I want you to think about the Who as the user your API server will be able to Authenticate and Authorize access to the data, and think about the What as the software making that request in behalf of the user, that in your case are the bots.
THE API SERVER DEFENSES
You can make the life of an attacker harder by applying defense in depth, by adding as many layers of defense as you can afford, and is required by law for your use case.
WAF - Web Application Firewall:
The effectiveness, against APIs is weak, because it was designed more specifically for web apps that don't rely on API's, but still able to offer some degree of protection.
UBA - User Behavior Analytics:
A good example of a UBA solution is Recaptcha by Google, specially the reCAPTCHA V3:
When you use recaptcha V3 in a mobile app your API server can then verify the score for that request, but bear in mind that it only makes it more difficult to bypass, because if you search Google for bypass recaptcha V3 you will see a lot of solutions being offered as a service for attackers.
Lock the API server to the mobile app
It's possible for the API server to have a high degree of confidence that the request is indeed from your mobile app, and not from a bot by using the Mobile App Attestation concept, and I invite you to read my reply to the question How to secure an API REST for mobile app?, specifically the section A Possible Better Solution.
DO YOU WANT TO GO THE EXTRA MILE?
In any response to a security question I always like to reference the amazing work from the OWASP foundation.
For Mobile Apps
OWASP Mobile Security Project - Top 10 risks
OWASP - Mobile Security Testing Guide:
For APIS
OWASP API Security Top 10