Browse the Repo

file-type-icon.circleci
file-type-icon_docs
file-type-iconcodegen
file-type-iconexamples
file-type-iconcloudtrail
file-type-iconcloudwatch-logs-metric-filters
file-type-iconcross-account-iam-roles
file-type-iconcustom-iam-entity
file-type-iconiam-groups
file-type-iconiam-password-policy
file-type-iconsaml-iam-roles
file-type-iconterraform
file-type-iconREADME.md
file-type-iconmain.tf
file-type-iconoutputs.tf
file-type-iconsaml-metadata.xml
file-type-iconvariables.tf
file-type-iconterragrunt
file-type-iconsecurityhub
file-type-iconmodules
file-type-iconrfcs
file-type-icontest
file-type-icon.gitignore
file-type-icon.pre-commit-config.yaml
file-type-iconCODEOWNERS
file-type-iconCONTRIBUTING.md
file-type-iconLICENSE.txt
file-type-iconREADME.adoc
file-type-iconsetup.cfg

Browse the Repo

file-type-icon.circleci
file-type-icon_docs
file-type-iconcodegen
file-type-iconexamples
file-type-iconcloudtrail
file-type-iconcloudwatch-logs-metric-filters
file-type-iconcross-account-iam-roles
file-type-iconcustom-iam-entity
file-type-iconiam-groups
file-type-iconiam-password-policy
file-type-iconsaml-iam-roles
file-type-iconterraform
file-type-iconREADME.md
file-type-iconmain.tf
file-type-iconoutputs.tf
file-type-iconsaml-metadata.xml
file-type-iconvariables.tf
file-type-iconterragrunt
file-type-iconsecurityhub
file-type-iconmodules
file-type-iconrfcs
file-type-icontest
file-type-icon.gitignore
file-type-icon.pre-commit-config.yaml
file-type-iconCODEOWNERS
file-type-iconCONTRIBUTING.md
file-type-iconLICENSE.txt
file-type-iconREADME.adoc
file-type-iconsetup.cfg
CIS Foundations Benchmark

CIS Foundations Benchmark

Modules and utilities certified by Gruntwork and CIS to comply with the CIS AWS Foundations Benchmark

Code Preview

Preview the Code

mobile file icon

README.md

down

SAML IAM roles Terraform wrapper example

This is an example of how to use the saml-iam-roles wrapper module to create IAM roles that users authenticated by a SAML Identity Provider (IdP) can assume to get access to this AWS account. If you're using Terragrunt, see the terragrunt example.

The saml-iam-roles wrapper module creates multiple IAM roles for use with SAML, as described in the core module documentation, with the exception that it does NOT create a full access role.

For example, a SAML-authenticated user might assume the allow-iam-admin-access-from-saml IAM Role, which grants iam:* access (the ability to manage IAM), or the allow-read-only-access-from-saml IAM Role, which grants read-only access to an AWS account. Ultimately, it will be up to the SAML IdP to assert which users can assume which IAM Roles in which AWS accounts.

Quick start

To try these templates out you must have Terraform installed:

  1. Open variables.tf, specify the environment variables mentioned at the top of the file, and customize variables as needed.
  2. Download SAML 2.0 Metadata from your IdP and copy its contents to saml-metadata.xml.
  3. Run terraform init to instruct Terraform to perform initialization steps.
  4. Run terraform apply to create the IAM Roles.
  5. This module will output the ARNs of these IAM Roles.

Questions? Ask away.

We're here to talk about our services, answer any questions, give advice, or just to chat.

Ready to hand off the Gruntwork?