Skip to content

Deploy RC 70 to int#2643

Merged
jgsmith-usds merged 17 commits intostages/intfrom
stages/rc-2018-11-08
Nov 5, 2018
Merged

Deploy RC 70 to int#2643
jgsmith-usds merged 17 commits intostages/intfrom
stages/rc-2018-11-08

Conversation

@jgsmith-usds
Copy link
Contributor

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

  • When adding a new controller that requires the user to be fully
    authenticated, make sure to add before_action :confirm_two_factor_authenticated
    as 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

  • The changes are compatible with data that was encrypted with the old code.

Routes

  • GET requests are not vulnerable to CSRF attacks (i.e. they don't change
    state or result in destructive behavior).

Session

  • When adding user data to the session, use the user_session helper
    instead of the session helper so the data does not persist beyond the user's
    session.

Testing

  • Tests added for this feature/bug
  • Prefer feature/integration specs over controller specs
  • When adding code that reads data, write tests for nil values, empty strings,
    and invalid inputs.

jmhooper and others added 15 commits October 24, 2018 12:11
**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.
@jgsmith-usds jgsmith-usds changed the base branch from master to stages/int November 5, 2018 15:35
**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.
@jgsmith-usds jgsmith-usds requested a review from stevegsa November 5, 2018 19:05
**Why**:
Now we send a text when a user generates a new personal key.
Copy link
Contributor

@stevegsa stevegsa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jgsmith-usds jgsmith-usds merged commit b98cac7 into stages/int Nov 5, 2018
@mitchellhenke mitchellhenke deleted the stages/rc-2018-11-08 branch December 28, 2021 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants