IAM Session Duration: Tighten by Default
Default IAM role session is 1 hour. The case for shorter sessions and the case for longer ones.
Defaults
IAM session duration is the time window during which a credential issued by AssumeRole or similar STS operation remains valid. Short sessions limit the window during which a leaked credential can be abused; long sessions reduce re-authentication friction. The trade-off is real; choosing the right session duration is a per-role decision that depends on the role's purpose and risk profile.
What the duration defaults look like:
- Short: 15 minutes.: The shortest practical session. Credentials expire frequently; refreshing is part of the workflow. The exposure window if a credential leaks is bounded to 15 minutes; the practical attack value of a leaked credential is low.
- Long: 12 hours.: The maximum allowed for many roles. Sessions persist through a workday; less re-authentication; more exposure if a credential leaks. The trade-off favors convenience over containment.
- Frequent re-auth versus minimal credential exposure.: The choice is the trade-off between developer friction and security risk. The right answer varies by role; production roles favor security, automation roles favor uninterrupted operation.
- The tooling matters.: Tools like aws-vault, AWS SSO, and gimme-aws-creds make short sessions tolerable by automating the re-authentication. Without these tools, short sessions feel onerous; with them, short sessions are operationally invisible.
- Default is 1 hour.: AWS's default session duration is 1 hour. The default is reasonable for most cases; explicit configuration is appropriate for cases that need shorter or longer.
Defaults are the starting point. The actual configuration is per-role, based on the risk and operational profile.
Shorter when
Some roles warrant shorter sessions because the risk of credential leak outweighs the operational friction. Production access, high-privilege roles, and cross-account roles are the typical cases.
- Production access.: Production credentials should expire quickly. The blast radius of a compromised production credential is large; the exposure window should be small. 15 to 60 minute sessions are appropriate for production roles.
- High-stakes credentials should expire quickly.: Roles with broad permissions (admin roles, deployment roles, security operations roles) should have short sessions. The credential's value to an attacker is high; the window during which it is valid should be small.
- Cross-account roles.: Roles assumed across account boundaries are higher-risk because they cross trust boundaries. Short sessions limit the exposure if a cross-account credential leaks.
- Limited window of compromise.: The principle is that the session duration is the maximum window during which a leaked credential can be abused. Shorter sessions equal smaller windows. For high-risk roles, the small window matters.
- Tooled workflow makes it tolerable.: Short sessions are tolerable when the tooling automates refresh. The developer's workflow is unchanged; the security improvement is invisible to the workflow but visible in the audit trail.
The shorter-session pattern is the right default for sensitive roles. The friction is manageable with good tooling.
Longer when
Some workloads need longer sessions because re-authentication would interrupt work. Long-running automation, batch jobs, and integration patterns are typical cases.
- Long-running automation.: Batch jobs, ETL pipelines, and long-running deployments need credentials that persist through the operation. Re-authentication mid-job would interrupt or fail the job. Longer sessions match the operational pattern.
- Re-auth would interrupt work.: The friction of re-authentication is itself a cost. For workloads where the cost is significant (batch jobs, long-running tasks, monitored operations), longer sessions are justified.
- Still cap at 12 hours.: AWS allows session durations up to 12 hours for most roles. Beyond that requires explicit role configuration and is generally over-permissive. The 12-hour cap is the practical maximum for almost all use cases.
- Beyond 12 hours is over-permissive.: Workloads that need credentials valid for more than 12 hours should be rearchitected. Patterns like instance profiles (auto-rotated by AWS) or workload identity (issued at task start) replace the need for very long sessions.
- Audit the long sessions.: Long sessions warrant additional audit. CloudTrail data shows what the session did; the data is reviewed for anomalies. The longer the session, the more the audit matters.
IAM session duration is one of those small disciplines that compounds across the organization. Nova AI Ops integrates with IAM data, surfaces session duration patterns, and helps teams identify roles where the duration does not match the risk profile.