Spike in unwanted traffic
jacebot
HOBBYOP

9 months ago

Hello,

I have a huge spike in network egress usage due to unwanted bots trying to hammer away for wordpress exploits. Is there a way to prevent this through a custom htaccess file for my *packs ? Should I migrate my app to a Docker app? Should I try and prevent it at the app level? I am currently handling it as a 40x error.

Solved$10 Bounty

Pinned Solution

opqr
FREE

9 months ago

You'll have to use a WAF like Cloudflare or Fastly to block bad traffic before it hits your app. If you want more control, you can run a self-hosted reverse proxy on Railway to filter requests. Keep in mind, you’ll still be charged for CPU, RAM, and egress on the proxy instance, but it won’t strain your main app’s resources. Personally, I’d recommend going with a third-party option.

6 Replies

9 months ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open brody 9 months ago


jacebot
HOBBYOP

9 months ago

To avoid any additional unwanted comments or questions, I am not using wordpress. I am not currently using docker. I do not intend to switch to either.


lofimit
HOBBY

9 months ago

Well, you can save most of the Memory's usage by blocking those requests on the .htaccess (so you return nothing to them).
Example:
<IfModule mod_rewrite.c>

RewriteEngine On

RewriteCond %{REQUEST_URI} ^/wp- [NC]

RewriteRule .* - [F,L]

</IfModule>


lofimit

Well, you can save most of the Memory's usage by blocking those requests on the .htaccess (so you return nothing to them).Example:<IfModule mod_rewrite.c>RewriteEngine OnRewriteCond %{REQUEST_URI} ^/wp- [NC]RewriteRule .* - [F,L]</IfModule>

9 months ago

Neither Railway, nor the user is running an Apache web server.


opqr
FREE

9 months ago

You'll have to use a WAF like Cloudflare or Fastly to block bad traffic before it hits your app. If you want more control, you can run a self-hosted reverse proxy on Railway to filter requests. Keep in mind, you’ll still be charged for CPU, RAM, and egress on the proxy instance, but it won’t strain your main app’s resources. Personally, I’d recommend going with a third-party option.


brody

Neither Railway, nor the user is running an Apache web server.

lofimit
HOBBY

9 months ago

Oh, in that case the user could try to block certain User-Agents or block IPs (most of them are probably public proxies that are easily detected as Proxies), but anyways there isn't much you can do, the best option by far is obviously using a WAF like Cloudflare like @opqr said, but I believe if that was an option you would've already done it. Please let me know @jacebot if using a WAF is possible for you or not.


Status changed to Solved brody 9 months ago


jacebot
HOBBYOP

9 months ago

Thanks everyone so far for the suggestions. I was curious if there was a config setting at the nix pack or railpack level but some searching around turns up nothing related at the moment. I am still thinking of doing some further app level updates/hardening, but not sure if that helps in this case since the resource is still served / network utilized. Thanks!


Status changed to Awaiting Railway Response Railway 9 months ago


Status changed to Solved jacebot 9 months ago


Loading...