Giter Club home page Giter Club logo

bakery's Introduction

Bakery and Burgers

Bakery is a centralised AWS identity and access management solution to avoid the duplication of user accounts/policies across multiple AWS accounts. In a nutshell, you just use one AWS account (called Bakery) for managing IAM users and assign right policies to gain access to other AWS account(s) which we call Burgers.

Terminologies

  • Bakery: An AWS Account to manage IAM Users and Groups.
  • Burger: An AWS Account where Bakery Users federate into.
  • AccessType: Level of access. Defaults are 'Admin', 'PowerUser', 'ReadOnly'.
  • Environment Groups:
    • These are AWS IAM Groups designated for each environment type. Defaults are 'Prod', 'NonProd', 'Mgmt' (aka Management)
    • Environment Groups use 'AccessType' for defining different level of access while forming IAM groups.

Key Concepts

  • IAM Users and IAM Groups are created ONLY in Bakery Account
  • IAM Users are members of IAM Groups created in same Bakery Account
  • Bakery Account manages various privileged access to Burger Accounts
  • IAM policies assigned to IAM Group grants AssumeRole access to associated Burger Role

Architectural overview

architecture

As mentioned in the diagram above

  • The NonProd Admin Group is a Bakery Environment Group. A Bakery Environment Group is composed of an IAM Group and a STS Policy that is assigned to the group. The STS Policy gives privilege to assume AdminRole.
  • In this example any member in NonProd Admin Group can assume AdminRole in any Burger Account that belongs to NonProd Environment Group.

How it works

Bakery and Burger implementation is nothing but a process of delegating right level of access across multiple AWS accounts as mentioned in this AWS documentation.

Below are a few key steps which explains the workflow of Bakery

  1. Firstly, a trust between two AWS accounts i.e. Bakery & Burgers is created. This process involves creation of IAM access policies & IAM roles.

trust

  1. IAM users get created in Bakery account with right level of access. The users can then download AWS access keys from Bakery account.

creds

  1. Using downloaded AWS credentials, IAM users can assume relevant role in Burger account.

assume role

Quickstart

  1. Modify configuration/config.yml by adding the data relevant to you. Refer to config README for more information.

  2. Setup Bakery AWS account

    1. Ensure your Bakery AWS account's credentials are within the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables
    2. Run the following commands from the root of the repo
    $ export bakery_cf_bucket=<Name of your S3 bucket>  # Must be already created in your Bakery Account
    
    $ make deploy-bakery-cf-in-docker

    This process will dynamically create CloudFormation templates and then deploy IAM groups along with policies using the newly created CloudFormation templates.

  3. Setup Burger AWS account

    The below steps need to be run for each Burger account you want to assume roles into.

    1. Ensure your Burger AWS account's credentials are within the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables
    2. Run following commands from the root of the repo
    $ export account_name=<Name of your burger account>  # E.g. TestAccount
    
    $ export aws_env=<Environment of your burger account>  # E.g. NonProd
    
    $ make deploy-burger-cf-in-docker

    This process will dynamically create a CloudFormation template and then deploy IAM roles using the newly created CloudFormation template.

  4. Create IAM Users in Bakery and grant appropriate access

    1. This is a manual process of creating IAM users in your Bakery AWS Account
    2. Once desired IAM users are created, you must associate them to designated Environment Groups so that they get appropriate access level while assuming a role into Burger AWS Accounts

Bakery Environment Groups

Bakery Environment Groups (or Environments) are AWS account groupings. We group accounts depending on workloads, security requirements or account classification. Each group will have AssumeRole access to Access Type Roles in Burger Accounts.

Default Bakery Environment Groups:

  • NonProd
  • Prod
  • Mgmt

Access Types

Access Types are types of access that a user can assume.

Default Access Types:

  • Admin
  • PowerUser
  • ReadOnly

CloudFormation Templates

Bakery

  • Has tmpl files which are used to create the CloudFormation templates using config.yml for the source information
  • bakery_stack is the main stack that calls bakery_account and bakery_env nested stacks mentioned below
  • bakery_account is a nested stack created by bakery_stack which creates AdminGroup and UserGroup for managing Bakery Account
  • bakery_env is a nested stack created by bakery_stack which creates IAM Groups and IAM Policies according to Bakery Environment Groups and Access Types.
    • IAM User that belongs to the IAM Group will have Access Type privileges to Burger Accounts in the Bakery Environment Groups

Burger

  • Has a tmpl file which is used to create the CloudFormation template using config.yml for the source information
  • burger_account stack is deployed to each Burger account you want to onboard. By default, it creates three IAM roles in Burger account, i.e. AdminRole, PowerUserRole and ReadOnlyRole.

Customizability and Scalability

We can scale the solution in three directions

  • Adding Bakery Environment Groups
  • Adding Burger Accounts
  • Adding Access Types

Check Admin Access

Please view README for for more information regarding Check Admin Access.

Utils

Please view README for command line helper tool to assume roles in burger accounts.

bakery's People

Contributors

bhushan8805 avatar shrutikembhavi 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  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar

bakery's Issues

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.