Code Monkey home page Code Monkey logo

terraform-aws-enforce-mfa's Introduction

AWS MFA Terraform module

Terraform module to enforce MFA for AWS groups and users.

This module implements the instructions provided in the AWS Documentation: Enable Your Users to Configure Their Own Credentials and MFA Settings.

This version of the module uses terraform v0.12.x. If you want to use a previous version of terraform please use the release 1.0.0 of this module.

Usage

resource "aws_iam_group" "mfa_group" {
  name = "MFAGroup"
}

resource "aws_iam_user" "mfa_user" {
  name = "MFAUser"
}

module "aws-enforce-mfa" {
  source = "jeromegamez/enforce-mfa/aws"
  groups = [aws_iam_group.mfa_group.name]
  users  = [aws_iam_user.mfa_user.name]
}

Module input variables

  • groups Enforce MFA for the members in these groups (Default: [])
  • users Enforce MFA for these users (Default: [])
  • allow_password_change_without_mfa (Default: false)

License

MIT licensed. See LICENSE for full details.

terraform-aws-enforce-mfa's People

Contributors

ainestal avatar jeromegamez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

terraform-aws-enforce-mfa's Issues

Terraform access

Hi!

After i add the enforceMFA then i don't have access with terraform for adding or removing resources.

Error: reading IAM Group (MFAGroup): AccessDenied: User: arn:aws:iam::804545353:user/testuser is not authorized to perform: iam:GetGroup on resource: group MFAGroup with an explicit deny in an identity-based policy

How do i still enforceMFA for the user and also have programmatic access for creating and deleting resources?

Option to not enforce MFA for API calls

After trying the enforced policy there are lots of reports of users complaining about being unable to run automated tasks.

The current policies apply to all the AWS interactions needing to contain MFA. That also is true for all the API calls.

Changing all the automated tasks to be able to use MFA is difficult in most of the cases and impossible in some others, specially with 'machine' users.

A fix would be to change the following part of the policy:

condition {
  test     = "Bool"
  variable = "aws:MultiFactorAuthPresent"
  values   = [
    "false",
  ]
}

It would be nice to have a variable that enables/disables MFA for API calls.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.