Conversation
Why these changes are being introduced: We need a preliminary solution to manage bot traffic in production. Relevant ticket(s): - https://mitlibraries.atlassian.net/browse/USE-410 How this addresses that need: - Implements a Bot Detector service that uses Crawler Detect to identify bots to refer to Cloudflare Turnstile. - Implements a Turnstile Controller (and view) to manage routing for verification challenges. Side effects of this change: - I chose not to pass the `remoteip` param to CloudFlare, because I wanted to avoid potentially passing a non-bot user's IP to a third party. - I had some uncertainty about logging, particularly around failed CrawlerDetect evaluations. It seems like it *might* be useful to send those to Sentry, but I was wary of doing so until we learn how much noise they introduce. - The new form may need additional styling. For now, I just added our button styles.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why these changes are being introduced:
We need a preliminary solution to manage bot traffic in production.
Relevant ticket(s):
How this addresses that need:
Side effects of this change:
remoteipparam to CloudFlare, because Iwanted to avoid potentially passing a non-bot user's IP to a third
party.
CrawlerDetect evaluations. It seems like it might be useful to send
those to Sentry, but I was wary of doing so until we learn how much
noise they introduce.
button styles.
Developer
Accessibility
New ENV
Approval beyond code review
Additional context needed to review
This adds the
crawler_detectgem.The best way to see the bot detection page is to flip the boolean in
BotDetector#should_challenge?locally. However, the challenge will only render for registered domains in our CloudFlare account.Code Reviewer
Code
added technical debt.
Documentation
(not just this pull request message).
Testing