-
Notifications
You must be signed in to change notification settings - Fork 26
LG-10115 - Document IdV rate limiting #471
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
Changes from 23 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
a201f62
First pass at IdV rate limiting documentation.
jmax-gsa 0779ce0
Started adding images
jmax-gsa 9e6b8a5
Fix image
jmax-gsa 522ca59
Fix image again.
jmax-gsa c36b2e4
Updated screenshots.
jmax-gsa a1c8947
Added Yaml front matter
jmax-gsa bc86ceb
Fixed incorrect image file name.
jmax-gsa 9f5c3f6
Debugging build failure
jmax-gsa 525339f
Fix image links
jmax-gsa 862e92f
Fix broken image.
jmax-gsa e44d904
Spelling.
jmax-gsa d9c2e1d
Spelling
jmax-gsa ad5c822
Update _articles/identity-proofing-rate-limiting.md
jmax-gsa db7017d
Update _articles/identity-proofing-rate-limiting.md
jmax-gsa 71d09fd
Update _articles/identity-proofing-rate-limiting.md
jmax-gsa 080a814
Re-categorize article, and chane 'IdV' to 'Identity Verificication'
jmax-gsa b734216
Improved triggering section for document authentication.
jmax-gsa 371a7f1
Added more explanation about document authentication rate limiter.
jmax-gsa 22af780
Use "verify by mail" instead of GPO
jmax-gsa b433791
Review comments.
jmax-gsa 89860b8
Review comments
jmax-gsa a6a732b
Overhauled OTP section.
jmax-gsa 08dcbb0
Re-arranged sections
jmax-gsa eca35b8
Verify Info screenshot
jmax-gsa 45fac99
Update _articles/identity-proofing-rate-limiting.md
jmax-gsa 735b3c9
Update _articles/identity-proofing-rate-limiting.md
jmax-gsa 9c0819d
Update _articles/identity-proofing-rate-limiting.md
jmax-gsa 00d178d
Update _articles/identity-proofing-rate-limiting.md
jmax-gsa d3bbbce
Update _articles/identity-proofing-rate-limiting.md
jmax-gsa 52f952d
Update _articles/identity-proofing-rate-limiting.md
jmax-gsa 465af2f
Update _articles/identity-proofing-rate-limiting.md
jmax-gsa 9571144
Update _articles/identity-proofing-rate-limiting.md
jmax-gsa 3a7756c
Update _articles/identity-proofing-rate-limiting.md
jmax-gsa 8d9be2e
Review comments.
jmax-gsa 246faa0
Removed cSpell header
jmax-gsa de28098
Split "how to fail" instructions out to their own section.
jmax-gsa 5fa5746
So many review comments.
jmax-gsa 13cf349
Review comment.
jmax-gsa 1596717
Review comments
jmax-gsa 88643c2
Fixed screenshot
jmax-gsa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,284 @@ | ||
| --- | ||
| title: "Identity Verification Rate Limiting" | ||
| description: "An overview of the rate limits which apply to identity verification" | ||
| layout: article | ||
| category: AppDev | ||
| subcategory: Architecture | ||
| cSpell: ignore Hubspot | ||
| --- | ||
|
|
||
| This page lists the rate limits relating to identity verification, and provides details | ||
| about each of them. | ||
|
|
||
| The following identity verification related rate limits exist: | ||
|
|
||
| - [Hybrid Handoff](#hybrid-handoff-rate-limiter) | ||
| - [Document Capture](#document-capture-rate-limiter) | ||
| - [Verify Info](#verify-info-rate-limiter) | ||
| - [Social Security Number](#social-security-number-verification-rate-limiter) | ||
| - [Address Verification](#address-verification-rate-limiter) | ||
| - [One time password entry](#one-time-password-entry-rate-limiter) | ||
| - [Verify by USPS mail](#verify-by-usps-mail-rate-limiter) | ||
|
|
||
| # Rate Limit Details | ||
| ## Hybrid handoff rate limiter | ||
| ### Description | ||
| This is the rate limiter for hybrid handoff, where we allow the user | ||
| to upload their ID documents from their phone. It is referred to in code via | ||
| `:idv_send_link` and the `RateLimiter` class. | ||
|
|
||
| By default, the user is allowed 5 attempts in 10 minutes. | ||
|
|
||
| ### Settings | ||
| `idv_send_link_max_attempts` - The maximum number of times that a user | ||
| can attempt to upload their ID documents from their phone within the | ||
| specified time window. Default: 5 attempts | ||
|
|
||
| `idv_send_link_attempt_window_in_minutes` - The length of time to | ||
| consider when determining whether a user is rate-limited. Default: 10 | ||
| minutes | ||
|
|
||
| ### How to trigger | ||
| Enter identity verification, and select hybrid handoff ('Use your | ||
| phone to take photos'). Click `Back` on the next screen and return to | ||
| 'How would you like to add your ID?'. Repeat until you become rate | ||
|
jmax-gsa marked this conversation as resolved.
Outdated
|
||
| limited. | ||
| ### UI effects | ||
| The user will be presented with a flash error message every time they | ||
| attempt to enter hybrid handoff. | ||
|
|
||
|  | ||
|
|
||
| ## Document capture rate limiter | ||
| ### Description | ||
| This is the rate-limit for the user's attempts to upload their ID | ||
| documents from either their computer or phone. It is referred to in | ||
| code via `:idv_doc_auth` and the `RateLimiter` class. | ||
|
|
||
| By default, the user is allowed 5 attempts within 6 hours. | ||
|
|
||
| Retrying with a different file after a failure and canceling out of | ||
| identity verification completely and then trying again both count | ||
| against this rate limiter. The user gets 5 attempts to upload | ||
| satisfactory images in 6 hours total, through any path. | ||
|
jmax-gsa marked this conversation as resolved.
Outdated
|
||
|
|
||
| ### Config Settings | ||
| - `doc_auth_max_attempts` - The maximum number of times the user can | ||
| attempt to upload their documents within the specified time | ||
| window. Default: 5 tries | ||
|
|
||
| - `doc_auth_attempts_window_in_minutes` - The length of time to | ||
| consider when determining whether a user is rate-limited. Default: 6 | ||
| hours. | ||
|
|
||
| ### How to trigger | ||
| Repeatedly fail doc auth (5 times). This can be done by using a | ||
| suitable `.yml` file rather than an image file during image | ||
| upload. | ||
|
|
||
| Use the same file for front and back images, but you must alternate | ||
| between two files on successive attempts. The UI will not let you try | ||
| twice in a row with the same file. | ||
|
|
||
| A pair of suitable files is: | ||
|
|
||
| ``` | ||
| image_metrics: | ||
| back: | ||
| HorizontalResolution: 100 | ||
| ``` | ||
|
|
||
| ``` | ||
| failed_alerts: | ||
| - name: Document Classification | ||
| result: Attention | ||
| ``` | ||
|
|
||
| [More about Yaml files for testing and development](https://developers.login.gov/testing/#testing-identity-proofing) | ||
|
|
||
|
|
||
| ### UI effects | ||
|
|
||
| After failing for the final time, the user will be redirected to a | ||
| rate limited screen. Any attempt to re-enter identity verification will also | ||
| redirect there. | ||
|
|
||
|  | ||
|
|
||
| ## Verify info rate limiter | ||
| ### Description | ||
| This is the rate-limit for verifying the user's information against | ||
|
jmax-gsa marked this conversation as resolved.
Outdated
|
||
| our external vendors. It is referred to in code via `:idv_resolution` | ||
| and the `RateLimiter` class. | ||
|
|
||
| By default, the user is allowed 5 attempts in 6 hours. | ||
|
|
||
|
|
||
|
soniaconnolly marked this conversation as resolved.
|
||
|
|
||
|
|
||
| ## Social security number verification rate limiter | ||
| ### Description | ||
| This is the rate limiter for SSN verification. It is referred to in | ||
| code via `:proof_ssn` and the `RateLimiter` class. | ||
|
|
||
| By default, an SSN is allowed 10 attempts in 60 minutes, across any | ||
| number of users. The discriminator for this rate limiter is the SSN, | ||
| not the user id. | ||
|
|
||
| ### Settings | ||
| - `proof_ssn_max_attempts` - The maximum number of times that a user | ||
| can attempt to verify their social security number within the | ||
|
jmax-gsa marked this conversation as resolved.
Outdated
|
||
| specified window. The default value for this is 10. | ||
|
|
||
| - `proof_ssn_max_attempt_window_in_minutes` - The length of time to | ||
| consider when determining whether a user is rate-limited. The default | ||
|
jmax-gsa marked this conversation as resolved.
Outdated
|
||
| value for this is 60 minutes. | ||
|
|
||
| ### How to trigger | ||
| This rate limiter is checked at the verify info step. The limit for it | ||
| is set to double the resolution rate-limiter, so it takes three users | ||
| (with a common SSN) to trigger the SSN rate limit. | ||
|
|
||
| Choose a bogus SSN (one that does not begin with 900 or 666). Create | ||
|
jmax-gsa marked this conversation as resolved.
Outdated
|
||
| a new user, and attempt identity verification with the user. The | ||
| verify info step will fail with this SSN. Repeat until rate limited. | ||
| (At this point, you are rate limited by the resolution rate limiter, | ||
| not the SSN rate limiter.) | ||
|
jmax-gsa marked this conversation as resolved.
Outdated
|
||
|
|
||
| Create a second user, and repeat the process with the same SSN. | ||
|
|
||
| Create a third user, using the same SSN, and this time, you will see | ||
| the SSN rate limit at the verify info step. | ||
|
jmax-gsa marked this conversation as resolved.
Outdated
|
||
|
|
||
| The SSN rate limit error page can be distinguished from the resolution | ||
| rate limit error page by the fact that the SSN timeout is 1 hour, | ||
| whereas the resolution limiter has a timeout of 6 hours. | ||
|
|
||
| ### UI effects | ||
| After attempting verify info, the third user will be redirected to the | ||
| identity verification rate limited screen. Any further attempts to | ||
| verify info with the offending SSN, for any user, will also redirect | ||
|
jmax-gsa marked this conversation as resolved.
Outdated
|
||
| here. | ||
|
|
||
| Unlike the other rate limiters, this one only takes effect when the | ||
| SSN has been entered during a session. | ||
|
|
||
|  | ||
| ## Address verification rate limiter | ||
| ### Description | ||
| This is the rate limiter for the address verification step. It is referred to in | ||
|
jmax-gsa marked this conversation as resolved.
Outdated
|
||
| code via `:proof_address` and the `RateLimiter` class. | ||
|
|
||
| By default, the user is allowed 5 attempts in 6 hours. | ||
|
|
||
| ### Config Settings | ||
| - `proof_address_max_attempts` - The maximum number of times that a | ||
| user can attempt to verify their address within the specified | ||
| window. Default: 5 times | ||
|
|
||
| - `proof_address_max_attempt_window_in_minutes` - The length of time | ||
| to consider when determining whether a user is rate-limited. Default: | ||
| 6 hours | ||
|
|
||
| ### How to trigger | ||
|
|
||
| Enter identity verification. When you reach the phone number step, use | ||
| phone number 703-555-5555. Identity verification will fail. Retry, | ||
| using the same phone number, until you are rate-limited. Ignore the | ||
| message about using a different phone number. | ||
|
|
||
| ### UI effects | ||
|
|
||
| The user will be redirected to a screen informing them that they are | ||
| rate-limited. Any further attempt to proof their address before the | ||
| rate limit expires will also be directed to this screen. | ||
|
jmax-gsa marked this conversation as resolved.
Outdated
|
||
|
|
||
|  | ||
|
|
||
| ## One time password entry rate limiter | ||
|
|
||
| ### Description | ||
| During the phone confirmation step, the user must enter a one-time | ||
| code sent to their phone. This is the rate limiter for requesting | ||
| one-time codes. | ||
|
|
||
| When the user is entering a one-time code, rate limiting is | ||
| handled by code which is common to both OTP entry during | ||
| identity verification _and_ during user login. | ||
|
|
||
| The actual rate limit count is stored on the `User` class. Most of the | ||
| code is in the `UserOtpMethods` concern, with a small bit of it still | ||
| in `User`. | ||
|
|
||
| By default, the user is allowed to request 10 one-time passwords | ||
| within 10 minutes. | ||
|
|
||
| If the user requests more than 10, they are blocked from further | ||
| access, and must wait 10 minutes before we allow them to continue. | ||
|
jmax-gsa marked this conversation as resolved.
Outdated
|
||
|
|
||
| ### Settings | ||
| `:login_otp_confirmation_max_attempts` - The maximum number of OTP | ||
| requests entry attempts that the user is allowed before their account | ||
| is temporarily locked. Default: 10 tries. | ||
|
|
||
| `:lockout_period_in_minutes` - The length of time that a use must wait | ||
| after being locked out for too many OTP requests before they are | ||
| allowed to try again. Default: 10 minutes. | ||
|
|
||
| ### How to trigger | ||
| Enter identity verification and proceed through the 'Verify your phone | ||
| number' screen. After pressing the 'Send code' button, you will be on | ||
| the 'Enter your one-time code' screen. Press the 'Send another code | ||
| button' repeatedly, until you are rate limited. | ||
|
|
||
| ### UI effects | ||
| On any attempt to access the site, the user will be redirected to a | ||
| rate-limited page, until the rate limit expires. | ||
|
jmax-gsa marked this conversation as resolved.
Outdated
|
||
|
|
||
| [Rate Limited]({{site.baseurl}}/images/otp-limited.png) | ||
| ## Verify by USPS mail rate limiter | ||
| ### Description | ||
| This is the rate limiter for a user's requests for USPS paper (also | ||
| sometimes called GPO) letters. This is a completely independent set | ||
| of rate limiting code, in the `GpoMail` class, which implements two | ||
| rate limits. | ||
|
|
||
| - First, a user is not allowed more than a certain number of letter | ||
| requests within a time window (this is similar to the other rate | ||
| limiters described here). | ||
|
|
||
| - Second, there is a minimum wait period after requesting a letter | ||
| before a user is allowed to request another. | ||
|
|
||
| By default, a user is allowed to request 4 verify by mail letters | ||
| within 30 days, and must wait 24 hours after requesting a letter | ||
| before they are allowed to request another. | ||
|
|
||
| (n.b. - there is an override for this in `application.yml` if the | ||
| RUBY_ENV environment variable is set to `test`. In that case, users | ||
| are restricted to 2 letters per 30 day window; the delay is still 24 | ||
| hours. This setting is used by the automated test suite in CI and | ||
| also for local development. It makes the tests simpler to have a | ||
| lower rate-limiting threshold.) | ||
|
|
||
| ### Settings | ||
| `max_mail_events` - The maximum number of times that a user may | ||
| request a Verify by Mail letter within the specified time window. | ||
|
|
||
| `max_mail_events_window_in_days` - The length of time to consider when | ||
| determining whether the user has requested too many Verify by Mail letters | ||
| recently. | ||
|
|
||
| `minimum_wait_before_another_usps_letter_in_hours` - The minimum | ||
| amount of time that a user must wait, after requesting a Verify by Mail letter, | ||
| before requesting another letter. | ||
|
|
||
| ### How to trigger | ||
| Enter identity verification and select "Verify by Mail". Request a | ||
| letter; you are now rate-limited. | ||
| ### UI effects | ||
| On the screen to enter their verification code, the user is not presented with the | ||
| option to request another letter. | ||
|
jmax-gsa marked this conversation as resolved.
Outdated
|
||
|
|
||
| [Rate limited]({{site.baseurl}}/images/gpo_letter_request_rate_limited.png) | ||
|
|
||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
Uh oh!
There was an error while loading. Please reload this page.