feat(CKV_AWS_341): ensure IAM role max session duration does not exceed 1 hour#7522
Open
Sage-Canty wants to merge 1 commit intobridgecrewio:mainfrom
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #7521
What
Adds a new Terraform check
CKV_AWS_341foraws_iam_roleresources.Check: Ensure IAM role max session duration does not exceed 1 hour (3600 seconds)
AWS allows
max_session_durationup to 43200 seconds (12 hours). Roles with elevated session durations extend the blast radius of a compromised credential. CIS AWS Foundations Benchmark recommends keeping this at or below 3600 seconds.Logic
max_session_durationnot set (defaults to 3600) or <= 3600max_session_duration> 3600Files changed
checkov/terraform/checks/resource/aws/IAMRoleMaxSessionDuration.py— check implementationtests/terraform/checks/resource/aws/test_IAMRoleMaxSessionDuration.py— 6 unit tests, all passingTests
6 passed, 1 warning in 3.62s