-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/rack attack #252
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
Merged
Merged
Feature/rack attack #252
Conversation
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
Bumps [redis](https://github.com/redis/redis-rb) from 5.3.0 to 5.4.0. - [Changelog](https://github.com/redis/redis-rb/blob/master/CHANGELOG.md) - [Commits](redis/redis-rb@v5.3.0...v5.4.0) --- updated-dependencies: - dependency-name: redis dependency-version: 5.4.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [ed25519](https://github.com/RubyCrypto/ed25519) from 1.3.0 to 1.4.0. - [Changelog](https://github.com/RubyCrypto/ed25519/blob/main/CHANGES.md) - [Commits](RubyCrypto/ed25519@v1.3.0...v1.4.0) --- updated-dependencies: - dependency-name: ed25519 dependency-version: 1.4.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [solr_wrapper](https://github.com/cbeer/solr_wrapper) from 4.1.0 to 4.1.3. - [Commits](cbeer/solr_wrapper@v4.1.0...v4.1.3) --- updated-dependencies: - dependency-name: solr_wrapper dependency-version: 4.1.3 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [exception_notification](https://github.com/kmcphillips/exception_notification) from 4.5.0 to 5.0.0. - [Release notes](https://github.com/kmcphillips/exception_notification/releases) - [Changelog](https://github.com/kmcphillips/exception_notification/blob/main/CHANGELOG.rdoc) - [Commits](kmcphillips/exception_notification@v4.5.0...v5.0.0) --- updated-dependencies: - dependency-name: exception_notification dependency-version: 5.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]>
….4.0 Bump redis from 5.3.0 to 5.4.0
…-1.4.0 Bump ed25519 from 1.3.0 to 1.4.0
…apper-4.1.3 Bump solr_wrapper from 4.1.0 to 4.1.3
…on_notification-5.0.0 Bump exception_notification from 4.5.0 to 5.0.0
Bumps [kredis](https://github.com/rails/kredis) from 1.7.0 to 1.8.0. - [Release notes](https://github.com/rails/kredis/releases) - [Commits](rails/kredis@v1.7.0...v1.8.0) --- updated-dependencies: - dependency-name: kredis dependency-version: 1.8.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
…1.8.0 Bump kredis from 1.7.0 to 1.8.0
…covery into feature/rack-attack
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.
Summary
This PR adds request throttling and Redis-backed caching to the application using the
rack-attack
gem. It also updates cache configurations in both development and production environments to use Redis.Changes Included
rack-attack
to the Gemfile.:memory_store
to:redis_cache_store
in bothdevelopment.rb
andproduction.rb
.ENV["REDIS_URL"]
, with fallback toredis://localhost:6379/1
."geodiscovery"
namespace for Rails cachingFiles Modified
Gemfile
,Gemfile.lock
: Addedrack-attack
gem; retainedrack
at 3.1.14.config/environments/development.rb
: Updated cache store to use Redis.config/environments/production.rb
: Same as above.config/initializers/rack_attack.rb
: New initializer defining throttling rules and custom response.test/rack_attack_test.rb
to verify Rack::Attack throttling returns a 503 response after exceeding the request limit.Notes
Redis must be available in each environment, and
REDIS_URL
should be set accordingly.This lays the foundation for future bot mitigation and abuse protection strategies.