Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Traefik/Finding Aids] Finding Aids Bot Wall #5911

Merged
merged 10 commits into from
Mar 7, 2025
Merged

Conversation

tpendragon
Copy link
Contributor

@tpendragon tpendragon commented Mar 7, 2025

This adds the bot wall to finding aids, via a few updates:

  1. Have a single file for all the site configs for staging/production to make it easier to add new sites.
  2. Creates a "redirect" middleware for finding aids to redirect requests from findingaids.princeton.edu/?f[]= to findingaids.princeton.edu/catalog?f[]= to let it be caught by the bot wall.
  3. Move finding aids & LAE to the high challenge bot wall, after looking at logs and noticing not many real people being inconvenienced, but the bot mitigation being significantly more effective.
  4. Add the princeton network as exempt - anyone at Princeton shouldn't have to hit the bot wall.

IMPORTANT NOTE: To make this work, @kayiwa had to allow access from the lib subnet to the finding aids machines.

@tpendragon tpendragon force-pushed the pulfalight_bot_wall branch 9 times, most recently from cb5dbf4 to 0bd9c47 Compare March 7, 2025 01:31
@tpendragon tpendragon marked this pull request as ready for review March 7, 2025 16:51
@tpendragon tpendragon changed the title Finding Aids Bot Wall [Traefik/Finding Aids] Finding Aids Bot Wall Mar 7, 2025
Copy link
Contributor

@acozine acozine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hooray for bot protection. Just one question, really.

- 128.112.200.245/32
- 128.112.201.34/32
# PUL Network, trust these.
- 128.112.0.0/16
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any way we can use the existing list of PUL IP ranges from the nginxplus role? I know these don't change often (maybe not ever) but I dislike having the same list in two places - double the maintenance, double the risk of drift.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good question! Hmm. Can you ticket that? We might be able to store the list of IPs as a nomad variable provisioned by ansible, but it'd take some figuring to see how to store an array there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@acozine I created this: #5912

- 128.112.200.245/32
- 128.112.201.34/32
# PUL Network, trust these.
- 128.112.0.0/16
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

@@ -0,0 +1,40 @@
http:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it!

@@ -37,7 +45,7 @@ server {
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_cache pulfalight-stagingcache;
proxy_cache pulfalight-prodcache;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, nice catch

Copy link
Member

@kayiwa kayiwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK! Thanks @tpendragon

@kayiwa kayiwa force-pushed the pulfalight_bot_wall branch from f97261d to a5fe62a Compare March 7, 2025 19:18
@kayiwa kayiwa merged commit 89d4123 into main Mar 7, 2025
68 checks passed
@kayiwa kayiwa deleted the pulfalight_bot_wall branch March 7, 2025 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants