Skip to content

LG-726 Confirm before removing security key#2617

Merged
stevegsa merged 9 commits intomasterfrom
stevegsa-confirm-before-removing-fido-key
Nov 5, 2018
Merged

LG-726 Confirm before removing security key#2617
stevegsa merged 9 commits intomasterfrom
stevegsa-confirm-before-removing-fido-key

Conversation

@stevegsa
Copy link
Contributor

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.

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.

@stevegsa
Copy link
Contributor Author

stevegsa commented Oct 23, 2018

Last 2FA option disables link to remove security key:

screen shot 2018-11-02 at 10 19 05 am

2 or more 2FA options enable link to remove security key:

screen shot 2018-11-02 at 10 19 51 am

Modal:
screen shot 2018-11-02 at 10 45 21 am

Key removed:
screen shot 2018-11-02 at 10 27 50 am

@clantosswett
Copy link

  • I thought we weren't using the term "hardware security key" and were instead going with "security key"

  • I don't really know the reasoning behind having the button say "remove" vs. "delete" since that is the language that is used throughout the whole process.

  • Don't love having a single bullet point on the "Are you sure you want to delete your security key." Seems like that should just be formatted as a block of text. Also, we use the term "security key" on this page, hence the inconsistencies.

@rtwell
Copy link

rtwell commented Oct 24, 2018

image

@stevegsa
Copy link
Contributor Author

stevegsa commented Oct 25, 2018

Screenshots and verbiage revised. Please review.

@stevegsa stevegsa force-pushed the stevegsa-confirm-before-removing-fido-key branch 2 times, most recently from abb0df2 to fb6b232 Compare October 25, 2018 05:56
@stevegsa stevegsa force-pushed the stevegsa-confirm-before-removing-fido-key branch from d4930a8 to 1eb3620 Compare November 1, 2018 20:20
@monfresh
Copy link
Contributor

monfresh commented Nov 1, 2018

I'm testing this locally now, and after I add my first security key, I see a link that says "yes, remove key". Is that expected?

screen shot 2018-11-01 at 7 30 19 pm

@stevegsa
Copy link
Contributor Author

stevegsa commented Nov 2, 2018

@monfresh great catch!

@stevegsa stevegsa force-pushed the stevegsa-confirm-before-removing-fido-key branch from 0a2ddd5 to 13a2186 Compare November 2, 2018 02:27
@stevegsa
Copy link
Contributor Author

stevegsa commented Nov 2, 2018

Screenshots have been updated again...

@rtwell
Copy link

rtwell commented Nov 2, 2018

any chance we can get a lil' more white space between the first button and the last sentence? see my comp for reference! thx!

@stevegsa stevegsa force-pushed the stevegsa-confirm-before-removing-fido-key branch from d5f4e11 to 3d9869f Compare November 2, 2018 20:56
@stevegsa stevegsa force-pushed the stevegsa-confirm-before-removing-fido-key branch from eaae1d4 to 9ae2e16 Compare November 4, 2018 18:16
**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.
@stevegsa stevegsa force-pushed the stevegsa-confirm-before-removing-fido-key branch from 9ae2e16 to a9c4566 Compare November 4, 2018 18:18
Copy link
Contributor

@monfresh monfresh left a comment

Choose a reason for hiding this comment

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

LGTM

@stevegsa stevegsa merged commit 49d2b9c into master Nov 5, 2018
@amathews-fs amathews-fs deleted the stevegsa-confirm-before-removing-fido-key branch January 7, 2021 18:45
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.

4 participants