π AWS IAM Security Configuration
When someone logs into AWS, their browser sends credentials over the internet, AWS checks them, and grants access if they're valid. Weak or stolen credentials mean an attacker can log in from anywhere.
That is why AWS provides two essential defense mechanisms:
Strong Password Policy
Multi-Factor Authentication (MFA)
Letβs implement both β step by step.
π Step 1: Set a Password Policy
In the console: IAM β Account settings β find the password policy β Edit
You can start from AWS's default policy or build your own.
Minimum password length
Uppercase letters
Lowercase letters
Numbers
Symbols (
@ # $ %)
Force passwords to expire on a schedule (e.g. every 90 days)
Require an admin reset once expired, or let users reset their own
Block reuse of the current password β or any past password β so rotation can't just cycle through the same few
That covers layer one.
π Step 2: Enable MFA on the Root Account
The root account has unrestricted access β if it's compromised, someone can delete resources, change billing, remove users, or take down production. That's why MFA on root matters more than anywhere else.
To enable it (as root): click your account name (top right) β Security credentials β Multi-Factor Authentication β Assign MFA device.
MFA options:
Virtual MFA (recommended) β an app like Google Authenticator, Authy, or Twilio Authenticator.
Setup β choose "Authenticator App" β scan the QR code AWS shows you β the app generates a 6-digit code that refreshes every 30 seconds β enter two codes in a row β done. One app can hold codes for multiple accounts.
U2F security key β a physical USB/NFC device like a YubiKey. Plug it in or tap it at login. One key can serve multiple IAM users.
Hardware TOTP token β a small physical device that generates codes without needing a phone. Common in strict corporate environments.
<div class="infographic-mfaflow">
<style>
.infographic-mfaflow {
--ink: #1a1a1a;
--ink-soft: #5c5c5c;
--paper: #ffffff;
--paper-alt: #f6f4ef;
--accent: #2563eb;
--accent-soft:#e3ebfd;
--line: #ddd6c9;
--ok: #1e8e5a;
--ok-soft: #e2f6ec;
--display-font: Georgia, 'Iowan Old Style', serif;
--mono-font: 'SF Mono', Menlo, Consolas, monospace;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
color: var(--ink);
background: var(--paper);
padding: 2rem 1.25rem 2.5rem;
max-width: 980px;
margin: 0 auto;
border-radius: 14px;
box-sizing: border-box;
}
.infographic-mfaflow[data-theme="dark"] {
--ink: #e8e6e1;
--ink-soft: #9a968c;
--paper: #121212;
--paper-alt: #1e1e26;
--accent: #6f9bff;
--accent-soft:#1c2740;
--line: #2c313d;
--ok: #4fbf87;
--ok-soft: #143024;
}
.infographic-mfaflow * { box-sizing: border-box; }
.mf-eyebrow { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase;
color: var(--ink-soft); margin: 0 0 0.35rem; text-align: center; }
.mf-title { font-family: var(--display-font); font-size: 1.5rem; margin: 0 0 0.4rem; line-height: 1.2;
text-align: center; }
.mf-sub { color: var(--ink-soft); font-size: 0.88rem; margin: 0 auto 2rem; max-width: 50ch; text-align: center; }
.mf-flow { display: flex; gap: 0; align-items: stretch; }
@media (max-width: 760px) { .mf-flow { flex-direction: column; } }
.mf-step { flex: 1 1 0; background: var(--paper-alt); border: 1px solid var(--line);
padding: 1.1rem 1rem; position: relative; cursor: pointer; text-align: center;
border-radius: 10px; margin-right: 1.9rem; transition: border-color 0.15s; }
.mf-flow > .mf-step:last-child { margin-right: 0; }
.mf-step::after { content: "β"; position: absolute; right: -1.6rem; top: 50%;
transform: translateY(-50%); color: var(--line); font-size: 1.4rem; }
.mf-flow > .mf-step:last-child::after { content: none; }
.mf-step.is-open { border-color: var(--accent); }
.mf-step .num { font-family: var(--mono-font); color: var(--accent); font-size: 0.8rem; font-weight: 700; }
.mf-step .icon { font-size: 1.7rem; margin: 0.35rem 0; }
.mf-step .lbl { font-size: 0.8rem; font-weight: 700; line-height: 1.25; }
.mf-step .step-detail { display: none; margin-top: 0.55rem; font-size: 0.74rem; color: var(--ink-soft);
line-height: 1.35; }
.mf-step.is-open .step-detail { display: block; }
@media (max-width: 760px) {
.mf-step { margin-right: 0; margin-bottom: 2.1rem; }
.mf-step::after { content: "β"; right: 50%; top: auto; bottom: -1.75rem; transform: translateX(50%); }
.mf-flow > .mf-step:last-child { margin-bottom: 0; }
}
.mf-result { display: flex; justify-content: center; margin-top: 1.75rem; }
.mf-result-badge { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 0.95rem;
padding: 0.5rem 1.1rem; border-radius: 999px; border: 1.5px solid var(--ok); color: var(--ok);
background: var(--ok-soft); }
@media (prefers-reduced-motion: reduce) {
.infographic-mfaflow * { transition-duration: 0.001ms !important; }
}
</style>
<p class="mf-eyebrow">AWS IAM</p>
<h2 class="mf-title">π Logging in with MFA</h2>
<p class="mf-sub">Tap a step to see what happens there.</p>
<div class="mf-flow">
<div class="mf-step" data-s="1">
<div class="num">1</div>
<div class="icon">π</div>
<div class="lbl">Password</div>
<div class="step-detail">You enter your username and password.</div>
</div>
<div class="mf-step" data-s="2">
<div class="num">2</div>
<div class="icon">β
</div>
<div class="lbl">Verified</div>
<div class="step-detail">AWS checks the password β correct so far.</div>
</div>
<div class="mf-step" data-s="3">
<div class="num">3</div>
<div class="icon">π±</div>
<div class="lbl">MFA code asked</div>
<div class="step-detail">AWS asks for a second factor before going further.</div>
</div>
<div class="mf-step" data-s="4">
<div class="num">4</div>
<div class="icon">π’</div>
<div class="lbl">Code entered</div>
<div class="step-detail">You open your authenticator app and type the 6-digit code.</div>
</div>
<div class="mf-step" data-s="5">
<div class="num">5</div>
<div class="icon">π</div>
<div class="lbl">Access granted</div>
<div class="step-detail">Both checks passed β you're in.</div>
</div>
</div>
<div class="mf-result">
<span class="mf-result-badge">β Two checks, not one</span>
</div>
<script>
(function () {
const wrapper = document.currentScript.closest('.infographic-mfaflow')
|| document.querySelector('.infographic-mfaflow');
const bodyAttr = document.body.getAttribute('data-darkmode');
let dark;
if (bodyAttr === 'true') { dark = true; }
else if (bodyAttr === 'false') { dark = false; }
else {
const match = document.cookie.match(/(?:^|;\s*)darkMode=([^;]+)/);
dark = match ? match[1] === 'true' : false;
}
if (dark) wrapper.setAttribute('data-theme', 'dark');
wrapper.querySelectorAll('.mf-step').forEach(step => {
step.addEventListener('click', () => {
const wasOpen = step.classList.contains('is-open');
wrapper.querySelectorAll('.mf-step').forEach(s => s.classList.remove('is-open'));
if (!wasOpen) step.classList.add('is-open');
});
});
})();
</script>
</div>.demo {
font-family: system-ui, sans-serif;
padding: 16px;
}
.demo h1 {
color: #2563eb;
margin: 0 0 8px;
}
.demo p {
color: #4b5563;
margin: 0;
}document.querySelector('.demo h1')?.addEventListener('click', () => {
alert('Hello from live preview!');
});β οΈ One warning: if you lose your MFA device, you can get locked out, and recovery isn't simple. Keep a backup device, store it safely, and consider registering more than one.