Commit graph

141 commits

Author SHA1 Message Date
Santiago Bartesaghi
1dba6ec133
Remove CodeClimate (#693) 2025-08-30 12:45:02 -04:00
fynsta
0fbc9a1c46
Track state is also stored in cache (#658) 2024-05-09 14:35:32 -03:00
Sebastian Cohnen
d7a7a8bda5
readme: Clarify AS::Notification.subscribe arguments (#654)
* fix AS::Notification.subscribe arguments in README.md

* event_id -> instrumenter_id
2024-03-09 21:48:11 -03:00
Nate Berkopec
a6bbbdc779
Add note about cache stores and in-memory caches.
This was part of the "lessons learned" from Bannerbear's DDoS attack: https://www.bannerbear.com/blog/how-to-survive-a-ddos-attack/
2022-12-16 15:22:34 +09:00
Adrian CB
8313e38df3 fix(documentation): Updating README with non-deprecated configuration. 2022-03-08 16:58:58 +11:00
Gonzalo
8bf9d4efad
refactor: attempt to make method name more self explanatory and clear 2022-01-29 15:06:13 -03:00
Johnathan Lyman
4e90859a37
Update README to mention .clear_configuration
Adds a line to the Test case isolation section about `.clear_configuration`.
2022-01-17 12:25:43 -08:00
Andrew Baber
78bc155ac9 docs: update link to rack spec in README 2021-11-19 12:34:50 -05:00
Gonzalo
1a872aa24c
docs: update CI badge 2021-07-21 19:16:32 -03:00
Gonzalo
17b7368a95
docs: attempt to avoid README version confusion 2021-06-15 12:29:14 -03:00
Gonzalo Rodriguez
1cb24da681
Merge pull request #512 from joevandyk/patch-1
Fix speling in README
2020-12-26 00:12:36 -03:00
Gonzalo
26476670f4
docs: update repo references after move to rack org 2020-12-25 23:51:59 -03:00
Joe Van Dyk
7b3376021b
Fix speling in README 2020-12-24 12:58:47 -08:00
Eliot Sykes
03926e0b75
Mitigate login throttle bypasses in docs
This commit mitigates rate limit bypasses in the configuration
docs by normalizing the email throttle key. (The normalization process
used is the same as used by the Clearance gem.)

---

Often an authentication process normalizes email addresses and usernames
before look up, say by downcasing and removing any whitespace.

Throttles that do not perform the same normalization are vulnerable
to rate limit bypasses.

For example, an attacker can bypass a vulnerable throttle by using
unlimited case and whitespace variants for the same email address:

- Variant 1: `victim@example.org`
- Variant 2: `victim@example. org` (one whitespace)
- Variant 3: `victim@example.  org` (two whitespaces)
- Variant 4: `ViCtIm@eXaMpLe.org`
- etc, etc.

All of these variants resolve to the same email address, but allow
an attacker to bypass a vulnerable throttle. To mitigate, the email
throttle key should be normalized using the same logic the
authentication process uses for normalizing emails.
2020-07-28 11:33:52 +01:00
Tristan Toye
f92889b360
Clarify Calling HTTP_APIKey header in example (#488)
* Clarify Calling HTTP_ header in example

In trying to track down a bug here turns out I was trying to reference the wrong header shown in the readme. 

Printing our `request.env` it becomes clear this is just the full request object:

```
{"rack.version"=>[1, 3],
 "rack.errors"=>#<IO:<STDERR>>,
 "rack.multithread"=>true,
 "rack.multiprocess"=>false,
 "rack.run_once"=>false,
 "SCRIPT_NAME"=>"",
 "QUERY_STRING"=>"",
 "SERVER_PROTOCOL"=>"HTTP/1.1",
 "SERVER_SOFTWARE"=>"puma 4.3.5 Mysterious Traveller",
 "GATEWAY_INTERFACE"=>"CGI/1.2",
 "REQUEST_METHOD"=>"POST",
 "REQUEST_PATH"=>"/api/v1/....",
 "REQUEST_URI"=>"/api/v1/...",
 "HTTP_VERSION"=>"HTTP/1.1",
 "HTTP_HOST"=>"example.com",
 "HTTP_APIKEY"=>"secret_key",
 "CONTENT_TYPE"=>"application/json",
 "HTTP_USER_AGENT"=>"PostmanRuntime/7.25.0",
 "HTTP_ACCEPT"=>"*/*",
 "HTTP_CACHE_CONTROL"=>"no-cache",
...
```

* Update README.md
2020-06-07 13:11:30 -03:00
Ryan Laughlin
029b5481fe Consolidate #testing section of README 2020-05-18 17:41:58 -04:00
Gonzalo Rodriguez
fe5deb9093
Merge branch '6-stable' 2020-04-26 13:09:29 -03:00
Gonzalo Rodriguez
35e4983400
doc: add Testing section to the README 2020-04-26 13:09:13 -03:00
Nikolay Rys
f79759717a Feature proposal: Request instead of Env in callbacks (#419)
feat: allow easy access to the request object in the callbacks
2019-12-17 14:44:08 -03:00
Lukas Spieß
58b4042e35
Use gender-neutral pronoun in Readme 2019-12-12 18:13:13 +01:00
fatkodima
2527b37221 Auto include middleware for older railses 2019-10-31 14:35:29 +02:00
fatkodima
a34c187dda Allow to configure Retry-After header for default throttled_response handler 2019-10-17 00:26:13 +03:00
Gonzalo Rodriguez
1167c65ba6
Don't autoplug middleware for untested rails versions 2019-10-12 18:10:10 -03:00
Gonzalo Rodriguez
2d1de4ac62
docs: add note about README contents gotcha 2019-10-11 16:00:01 -03:00
fatkodima
f22b24cbc5 Do not auto-plug for rails < 5 2019-10-08 13:08:07 +03:00
fatkodima
b512e05786 Auto plug middleware for simpler installation 2019-10-08 12:29:25 +03:00
Gonzalo Rodriguez
f86632f386
docs: add gitter chat badge 2019-08-01 14:23:30 -03:00
Gonzalo Rodriguez
58ba650e6b
feat: provide discriminator in throttle_data 2019-07-10 17:21:48 -03:00
Lucas Mansur
93fa023322 Use namespaced event 2019-05-23 19:01:50 -03:00
Gonzalo Rodriguez
6c6dfb06e3
feat: match ActiveSupport Instrumentation event name format spec 2019-02-24 20:19:38 -03:00
Gonzalo Rodriguez
ef7fe67b5e
docs: fix typo 2018-10-30 10:27:46 -03:00
Leo Arnold
b0da52a1bd Move Wiki examples into version control. Closes #324 2018-10-28 19:21:43 +01:00
Leo Arnold
95d536414a Add table of contents to README. Closes #335 2018-10-08 18:15:07 +02:00
Gonzalo Rodriguez
ef21932760
Update README: Mailing list no longer user 2018-09-03 18:35:08 -03:00
Kurtis Rainbolt-Greene
ea58ccbb6a
Forgot to match the header 2018-08-16 10:32:02 -07:00
Kurtis Rainbolt-Greene
3e5a4607cd
Prefer to not use X- style headers for clarity
The IETF decided the X- style custom headers have caused more headache than the value: https://tools.ietf.org/html/rfc6648 so this tool (which is very popular and much loved) shouldn't suggest using an old style.
2018-08-16 08:11:30 -07:00
Carlos Contreras
711ba9bf99 Fix copy on safelist description 2018-07-31 15:38:16 -05:00
Gonzalo Rodriguez
73bc739d5a
Merge remote-tracking branch 'doliveirakn/master' 2018-06-29 11:17:19 -03:00
Gonzalo Rodriguez
8802ebfbaf
Merge branch '255-correct-object-for-instrumentation' 2018-06-28 16:40:08 -03:00
Spencer Norman
f56967f923 fixed spelling issue, returna to return (#334)
* fixed spelling issue, returna to returns

* fixed the spelling properly this time, returns to return
2018-04-06 10:19:53 -03:00
Gonzalo Rodriguez
2d6ad830ac
docs: provide some advice for users willing to contribute to the project 2018-03-30 15:29:16 -03:00
Koen Rouwhorst
0457bf22f9 Updated all non-secure HTTP URLs to HTTPS. 2018-03-29 18:41:40 +02:00
Gonzalo Rodriguez
4c1aa8b312
[Fixes #318] Attempt to improve README a bit (#323)
* docs: Improve Getting Started section

* docs: Following Getting Started show Usage to the README reader

* docs: Move the configuration tip to the Usage section

* docs: Move the cache store configuration comment to Usage

* docs: Clarify Responses title

* docs: allow2ban also uses the cache store

* docs: Improve Usage docs for blocking, safelisting and throttling

* docs: Don't give the impression that the gem is not being maintained when it actually is

* docs: Be a bit more clear about cache store in README

* docs: Attempt to be a bit more concise in the README intro

* docs: Clarify sentence
2018-03-29 11:42:27 -03:00
Domenoth
5004b04ac7 Change object type yielded to ActiveSupport::Subscribers
https://github.com/kickstarter/rack-attack/issues/255

Change the object type from instances of type Rack::Attack::Request to
instances of type Hash. (`req` becomes `request: req`).
2018-03-21 11:32:09 -07:00
Gonzalo Rodriguez
43eec3ab78
Merge pull request #248 from amirshadaab/add-requires-to-README
add require lines in README.md file
2018-03-12 11:47:50 -03:00
Amir Shadaab Mohammed
83ac0f7b0d add require lines in README.md file 2018-03-09 15:04:27 -06:00
Gonzalo Rodriguez
71c10d1ebe
Merge pull request #279 from tjnet/surpress_rubocop_complains_about_initalizer_file_name
fix rubocop complains about initializer file name (use snake_case)
2018-03-07 20:27:41 -03:00
Alex Taylor
993d724b64
Mention 'match_discriminator' in README.md 2018-03-05 17:21:36 -08:00
Kyle d'Oliveira
9dbece5272 Add an reader for the epoch_time variable in the cache so that it can also be returned in the data from the throttle.
This is allows access to the same time that the cache uses for the count. This can be important for clients that want to provide rate limit information for well-behaved clients
2018-02-15 14:45:35 -08:00
jun_tanaka555
70a4c1f933 fix rubocop complains about initializer file name 2018-02-04 16:18:54 +09:00