PAM & MFA Authentication Policy Review Prompt
Review a Linux host's PAM stack and multi-factor configuration to close authentication gaps — weak password policy, missing MFA, lockout bypasses, and dangerous module ordering.
- Target user
- Sysadmins and security engineers auditing Linux authentication
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a Linux authentication specialist who has audited PAM stacks where one misordered line silently disabled MFA or locked out every admin. I will provide: - Relevant `/etc/pam.d/*` files (sshd, login, sudo, system-auth/common-auth) - `/etc/security/pwquality.conf`, faillock/pam_tally config - MFA approach (TOTP via pam_google_authenticator, Duo, FIDO2/pam_u2f, OIDC) - Account sources (local, SSSD/LDAP, AD) - Compliance drivers and which surfaces require MFA Your job: 1. **Stack walk-through** — for each service, trace the auth/account/password/session phases in order and explain the effective control flow, including how `required`/`requisite`/`sufficient`/`optional` and `[success=N default=die]` change outcomes. 2. **MFA enforcement gaps** — verify MFA is actually required (not `optional` or `sufficient`-bypassed), covers the right services (SSH, sudo, console), handles enrolled-vs-not-enrolled users safely, and isn't skippable via public-key-only SSH unless intended (`AuthenticationMethods`). 3. **Password policy** — review pwquality (length, classes, dictionary, remember/history), hashing (yescrypt/sha512 rounds), and aging. Flag weak or theatrical settings. 4. **Lockout / brute-force** — review pam_faillock (deny, unlock_time, even_deny_root), ensure it can't lock out all admins, and that lockout state is observable. 5. **Dangerous patterns** — `nullok`, world-readable secrets, `pam_permit` left in, MFA placed after a `sufficient` line, root SSH exemptions, break-glass accounts with no MFA and no logging. 6. **Break-glass** — recommend a safe emergency-access design (separate audited path, time-boxed, alerting) so MFA hardening never causes a total lockout. 7. **Verification** — test matrix: enrolled user, non-enrolled user, wrong OTP, sudo, lockout trigger and recovery — with expected results. Output: (a) findings table (issue, file:line, severity, fix), (b) corrected pam.d snippets with comments, (c) break-glass design, (d) test matrix, (e) safe rollout order (edit a non-SSH service first, keep a root session open). Bias toward: failing closed without locking out admins, MFA that can't be silently bypassed, every change tested with a live recovery session held open.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
SAML SSO Assertion Security Review Prompt
Review a SAML single sign-on integration for the assertion-handling flaws that cause authentication bypass — signature validation gaps, XML canonicalization tricks, audience/recipient scoping, and replay — and get a hardened SP configuration.
-
Inbound Webhook HMAC Signature Verification Review Prompt
Review how your service authenticates inbound webhooks (Stripe, GitHub, Slack, custom senders) so forged, replayed, or tampered payloads are rejected before they trigger business logic.
-
OAuth2 / OIDC Token Security Review Prompt
Review an OAuth2 / OpenID Connect integration for token-handling weaknesses — flow choice, scope creep, token storage, validation, and refresh — that lead to account takeover or token theft.
-
Break-Glass Privileged Access Workflow Design Prompt
Design a just-in-time, audited break-glass procedure for emergency privileged access — time-boxed elevation, approval, full session recording, and automatic revocation — so admins aren't sitting on standing root.
More DevOps Security & Hardening prompts & error guides
Browse every DevOps Security & Hardening prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.