Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

2FA login #166

Open
ARMmaster17 opened this issue Feb 25, 2022 · 1 comment
Open

2FA login #166

ARMmaster17 opened this issue Feb 25, 2022 · 1 comment
Labels
Backend Changes are expected to be made to the service, repository, or controller level of Java source files blocked This issue is blocked by a pending PR or another issue that must be resolved first. enhancement New feature or request Frontend Changes are expected to be made to HTML/JS/CSS files and the related controllers. stretch Ideas that are not completely neccesary for an MVP, but can be done for fun/learning.
Milestone

Comments

@ARMmaster17
Copy link
Member

ARMmaster17 commented Feb 25, 2022

Summary

This is the last big feature for HIPAA compliance (besides out-of-budget items like WAFs and DB-auditing). Updates to HIPAA regulations around 2019 state that applications with access to medical records need to be secured behind two-factor authentication. This is not strictly required for patient accounts, but admins and doctors are required to have this security feature in new software products after 2019 (IIRC there is also a short grace period for software from before this time).

In the past year, the NIST has made strong recommendations not to use 2FA SMS as this can easily be circumvented in a targeted "sim-swap" attack. Email auth is also generally frowned upon as targeted attacks against individuals typically go for email accounts first. The best NIST recommendation within our budget and time constraints is to use TOTP codes. If a website has ever made you scan a QR code, and then use codes from that app to log in, you were using a TOTP code.

Implementation

There are two ways to go about this. The first is considered a standard practice, but would be harder to implement. The second may be confusing for some users, but would still satisfy HIPAA regulations.

  1. Require a TOTP code as part of the login process. May be difficult to implement because of how we are using spring-security, but is the most secure method.
  2. Require a TOTP code whenever accessing a page that contains PHI/PII (such as the records page, when starting a call with a patient, or viewing a detailed list of appointments). Easier to implement, but far less secure and may be confusing for some users.

There are standard TOTP Java libraries, and it would not be smart at all to roll our own custom solution here. There are also front-end JS frameworks for generating a QR code from a registration token. Once a consensus is reached on which of the two paths we will take from above, then we can decide on implementation steps.

This issue will also need to be treated as an epic, and individual tasks will be dispersed from this one (i.e. one person is probably not going to be assigned to implement this in one big PR).

@ARMmaster17 ARMmaster17 added enhancement New feature or request proposal This is a proposal of an idea, and needs further discussion before starting work on it. Frontend Changes are expected to be made to HTML/JS/CSS files and the related controllers. Backend Changes are expected to be made to the service, repository, or controller level of Java source files labels Feb 25, 2022
@ARMmaster17 ARMmaster17 added this to the Sprint 2 milestone Feb 25, 2022
@ARMmaster17 ARMmaster17 moved this to Committed in Kanban Board Feb 25, 2022
@ARMmaster17 ARMmaster17 added stretch Ideas that are not completely neccesary for an MVP, but can be done for fun/learning. and removed proposal This is a proposal of an idea, and needs further discussion before starting work on it. labels Feb 28, 2022
@ARMmaster17 ARMmaster17 modified the milestones: Sprint 2, Sprint 3 Mar 14, 2022
@ARMmaster17
Copy link
Member Author

ARMmaster17 commented Mar 29, 2022

This library looks like it does what we need it to do https://github.com/j256/two-factor-auth Note that using this library directly like how the example shows is a HIPAA/NIST violation. Unfortunately because installing a service like Hashicorp Vault is out of scope for this project, we're going to have to store the base32 secret in the database. We should at least encrypt the string if possible once the MVP is proven to work.

@ARMmaster17 ARMmaster17 added the blocked This issue is blocked by a pending PR or another issue that must be resolved first. label Mar 29, 2022
@ARMmaster17 ARMmaster17 modified the milestones: Sprint 3, Sprint 4 Apr 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Backend Changes are expected to be made to the service, repository, or controller level of Java source files blocked This issue is blocked by a pending PR or another issue that must be resolved first. enhancement New feature or request Frontend Changes are expected to be made to HTML/JS/CSS files and the related controllers. stretch Ideas that are not completely neccesary for an MVP, but can be done for fun/learning.
Projects
Status: Committed
Development

No branches or pull requests

1 participant