Coder Social home page Coder Social logo

paulxu / mamip Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zoph-io/mamip

0.0 0.0 0.0 7.09 MB

[MAMIP] Monitor AWS Managed IAM Policies Changes

Home Page: https://bio.link/zoph

License: GNU General Public License v3.0

Shell 18.56% Python 41.42% Makefile 12.05% HCL 26.89% Dockerfile 1.08%

mamip's Introduction

๐Ÿ“ข [MAMIP] Monitor AWS Managed IAM Policies

[Prod] MAMIP - GitHub Actions

Thanks to @0xdabbad00 for the original idea, this repo automates the retrieval of new AWS Managed IAM Policies making it easier to monitor and get alerted when changes occur.

โœ‹ Usage

3๏ธโƒฃ Three options to get notifications

  1. Follow the Twitter Account or on Mastodon.

Mamip Twitter Screenshot

  1. Activate Releases Only Notification feature of Github

setup

  1. Subscribe to the Github RSS Feed (master branch)

โœ… Policy Validation

I'm using AWS Access Analyzer Policy Validation. You can check findings in the findings folder.

๐Ÿ‘ด Deprecated Policies

Some AWS Managed Policies are now deprecated since they first appeared in this repository. Policy validation only takes place on actual AWS-managed policies.

๐Ÿค How it works behind the scene

AWS Managed Policies are acquired as follows:

aws iam list-policies --scope AWS > list-policies.json
cat list-policies.json \
  | jq -cr '.Policies[] | select(.Arn | contains("iam::aws"))|.Arn +" "+ .DefaultVersionId+" "+.PolicyName' \
  | xargs -n3 sh -c 'aws iam get-policy-version --policy-arn $1 --version-id $2 > "policies/$3"' sh

This command does the following:

  • Gets the list of all IAM Policies in the AWS account
  • Finds the ones with an ARN containing iam::aws, so that only the AWS managed policies are grabbed.
  • Gets the ARN, current version id, and policy name (needed so we don't have a slash as the ARN does for writing a file)
  • Calls aws iam get-policy-version with those values, and writes the output to a file using the policy name.

โš™๏ธ Automation Details

  • Infrastructure is deployed using Terraform:
    • ECS + Fargate
  • Clone this repository
  • Run the magic (previously mentioned command)
  • If changes are detected:
    • Commit changes
    • Push + Create Release
    • Send SQS message to qTweet

๐Ÿ• Schedule

๐Ÿ“ Architecture Design

Schema ECS Fargate

mamip's People

Contributors

0xdabbad00 avatar z0ph avatar

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.