Merged
Conversation
**Why**: The analytics controller is meant to function as an general controller for capture anayltics for the frontend. Prior to this commit it was primarily handling the platform authenticator analytics event. **How**: This commit makes the controller more general so that it communicates that it should be built out to handle more events and moves the platform auth event into a namespace so that the API can be extended to include more events. Additionally, care was given to make sure that the current implementation is supported so that we don't drop events while running instances running this code alongside instances running the new code.
**Why**: We were seeing `NoMethodErrors` on `email` in production
pointing at this code in the `FormPasswordValidator`:
```ruby
def password_score
@password_score = ZXCVBN_TESTER.test(
password,
ForbiddenPasswords.new(user.email_address.email).call
)
end
```
When the reset password controller cannot find a user for a given
password reset token, it initializes an empty user with an error.
Once we added the `#email_address` method this started causing problems
because the nil user does not have an email.
This commit fixes the bug and also changes the form to differentiate
between invalid and expired tokens so the user sees the right error
message if their token is invalid.
* convert color variables to six characters * disable codeclimate hexlength check
**Why**: So we can start tracking the IAL and AAL of SPs in the database and build policies around them.
**Why**: Now that users can remove their phone configuration, we need a way for piv/cac users to continue to an SP without having to set up another phone. **How**: Check for multiple MFA configurations and let users select from any of the options rather than forcing a phone.
**Why**: When the feature flag is enabled the analytics endpoint tries to authenticate a logged in user by redirecting the XHR request to 2FA and automatically sends an sms (a second time) **How**: Since the endpoint will be a generic endpoint to collect analytics it should not be require authentication. Put in a simple check to see if we have a user before logging the platform authenticator analytics.
**Why**: So the page doesn't continually refresh. **How**: Before checking for webauthn support and routing to an error page check if we are already on the error page.
**Why**: We'd like to support multiple email addresses. **How**: Go from an implicit "first" email_address record to an explicit first of email_addresses. Where we need to send email to confirmed accounts, we iterate over all confirmed email address records as preparation for adding multiple email addresses in the future.
* LG-766 Require MFA after 12 hours for IAL2 and AAL2 **Why**: The NIST standards require that MFA be expired after 12 hours. This commit checks the MFA status during the handoff to the SP and requires the user to re-auth if their device was remembered and their cookie is older than 12 hours. **How**: When a user is MFAed by remember device, flag the session. Before redirecting to a service provider, check or whether remember device was used, and if so, if it has expired for the current sp's configuration. If it has, redirect to the 2FA controller. Also, it is necessary to prevent the 2FA controller from redirecting if the user is logged in when the remember device cookie is invalid per the current SP's configuration.
**Why**: To make it easier to query if any particular users have used their personal key to sign in, and to add an event to the user's account page for visibility.
**Why**: So agencies can interface to our SAML implementation out of the box and not have to customize code to our specific SAML implementation. **How**: Update nameformat to be 'urn:oasis:names:tc:SAML:2.0:attrname-format:basic' (simple string value) when we send back a UUID or email.
**Why**: We want the user to see in their history when hardware security keys are added and removed. Also, I updated the analytics attributes to show the user's current count for each MFA type so we can see which MFA configurations they ended up with.
**Why**: To get a better sense of how many users use the remember me feature.
**Why**: So the user can confirm they want to remove their security key or choose to cancel. **How**: If their security key is their last 2FA option disable the delete link. If they have another 2FA option allow them to delete by first showing a modal. This modal will allow them to proceed or cancel and return to the account page.
**Why**: So that users will know when their personal key is being used to sign in and be aware of any suspicious activity around their personal key.
**Why**: Now we send a text when a user generates a new personal key.
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
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.
Hi! Before submitting your PR for review, and/or before merging it, please
go through the checklists below. These represent the more critical elements
of our code quality guidelines. The rest of the list can be found in
CONTRIBUTING.md
Controllers
authenticated, make sure to add
before_action :confirm_two_factor_authenticatedas the first callback.
Database
Unsafe migrations are implemented over several PRs and over several
deploys to avoid production errors. The strong_migrations gem
will warn you about unsafe migrations and has great step-by-step instructions
for various scenarios.
Indexes were added if necessary. This article provides a good overview
of indexes in Rails.
Verified that the changes don't affect other apps (such as the dashboard)
When relevant, a rake task is created to populate the necessary DB columns
in the various environments right before deploying, taking into account the users
who might not have interacted with this column yet (such as users who have not
set a password yet)
Migrations against existing tables have been tested against a copy of the
production database. See LG-228 Make migrations safer and more resilient #2127 for an example when a migration caused deployment
issues. In that case, all the migration did was add a new column and an index to
the Users table, which might seem innocuous.
Encryption
Routes
state or result in destructive behavior).
Session
user_sessionhelperinstead of the
sessionhelper so the data does not persist beyond the user'ssession.
Testing
and invalid inputs.