Sobes.tech
Junior — Middle

What is your experience in implementing and managing multi-factor authentication in AWS projects?

sobes.tech AI

Answer from AI

Multi-factor authentication (MFA) in AWS is typically implemented to enhance security for account and resource access. The experience includes:

  • Enabling MFA for IAM users via the AWS Management Console or CLI.
  • Setting up virtual MFA devices (e.g., Google Authenticator) for users.
  • Applying IAM policies that require MFA for certain actions.
  • Using MFA tokens for programmatic access through AWS SDKs, adding temporary MFA sessions.

An example policy requiring MFA for resource deletion:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Deny",
      "Action": "ec2:TerminateInstances",
      "Resource": "*",
      "Condition": {
        "BoolIfExists": {"aws:MultiFactorAuthPresent": "false"}
      }
    }
  ]
}

This increases security by preventing unauthorized actions without the second factor.