My AWS CLI profile had expired, and the system demanded step-up authentication. Not a full re-login—just enough friction to remind me that trust in cloud environments should be earned, not assumed.
Step-up authentication with AWS CLI-style profiles brings a sharp balance between convenience and security. You get the speed of a short-lived session for daily work, layered with the power to escalate privileges on demand. Instead of carrying admin keys like a ticking time bomb, you swap into them only when needed.
The flow starts with multiple AWS CLI profiles configured in your ~/.aws/config file. A base profile handles routine reads and list calls. An elevated profile, linked with a secure MFA prompt, covers sensitive actions like deployments, IAM changes, or production writes. This segmentation makes role assumption a deliberate step, traced and auditable in CloudTrail.
A typical setup links your base profile to a role ARN in AWS IAM. Adding an mfa_serial parameter forces a token challenge before issuing temporary credentials. Switching profiles becomes a matter of running: