Add docs for MFA

This commit is contained in:
Tuan Dang
2023-02-21 16:08:09 +07:00
parent 469d042f4b
commit 7cb6aee3f7
6 changed files with 38 additions and 5 deletions

View File

@@ -68,6 +68,15 @@ export const updateMyMfaEnabled = async (req: Request, res: Response) => {
try { try {
const { isMfaEnabled }: { isMfaEnabled: boolean } = req.body; const { isMfaEnabled }: { isMfaEnabled: boolean } = req.body;
req.user.isMfaEnabled = isMfaEnabled; req.user.isMfaEnabled = isMfaEnabled;
if (isMfaEnabled) {
// TODO: adapt this route/controller
// to work for different forms of MFA
req.user.mfaMethods = ['email'];
} else {
req.user.mfaMethods = [];
}
await req.user.save(); await req.user.save();
user = req.user; user = req.user;

View File

@@ -17,7 +17,8 @@ export interface IUser {
verifier?: string; verifier?: string;
refreshVersion?: number; refreshVersion?: number;
isMfaEnabled: boolean; isMfaEnabled: boolean;
seenIps: [string]; mfaMethods: boolean;
seenIps: [string]; // TODO 1: email for unseen IPs, TODO 2: move to a central alerting system
} }
const userSchema = new Schema<IUser>( const userSchema = new Schema<IUser>(
@@ -82,8 +83,14 @@ const userSchema = new Schema<IUser>(
type: Boolean, type: Boolean,
default: false default: false
}, },
seenIps: [String] mfaMethods: [{
}, type: String
}],
seenIps: {
type: [String],
default: []
}
},
{ {
timestamps: true timestamps: true
} }

View File

@@ -5,8 +5,6 @@ description: "How to sync your secrets among various 3rd-party services with Inf
Integrations allow environment variables to be synced across your entire infrastructure from local development to CI/CD and production. Integrations allow environment variables to be synced across your entire infrastructure from local development to CI/CD and production.
We're still relatively early with integrations. 6+ integrations are already avaiable but expect more coming very soon.
<Card title="View integrations" icon="link" href="/integrations/overview"> <Card title="View integrations" icon="link" href="/integrations/overview">
View all available integrations and their guides View all available integrations and their guides
</Card> </Card>

View File

@@ -0,0 +1,18 @@
---
title: "MFA"
description: "Secure your Infisical account with MFA"
---
MFA requires users to provide multiple forms of identification to access their account. Currently, this means logging in with your password and a 6-digit code sent to your email.
## Email 2FA
Check the box in Personal Settings > Two-factor Authentication to enable email-based 2FA.
![Email-based MFA](../../images/mfa-email.png)
<Note>
Infisical currently supports email-based 2FA. We're actively working on
building support for other forms of identification via SMS and Authenticator
App.
</Note>

BIN
docs/images/mfa-email.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 KiB

View File

@@ -98,6 +98,7 @@
"getting-started/dashboard/pit-recovery", "getting-started/dashboard/pit-recovery",
"getting-started/dashboard/secret-versioning", "getting-started/dashboard/secret-versioning",
"getting-started/dashboard/audit-logs", "getting-started/dashboard/audit-logs",
"getting-started/dashboard/mfa",
"getting-started/dashboard/token" "getting-started/dashboard/token"
] ]
}, },