Coder Social home page Coder Social logo

kloia / ctower Goto Github PK

View Code? Open in Web Editor NEW
28.0 4.0 0.0 36 KB

ctower is a CLI application for managing GuardRail Controls across Organizational Units on AWS Control Tower.

License: Apache License 2.0

Python 100.00%
aws awsorganizations boto3 botocore cli control-tower organizational-units pypi-package python3

ctower's Introduction

ctower

ctower is a CLI application for managing GuardRail Controls across Organizational Units on AWS Control Tower.

Installation

pip3 install ctower

Basic Usage

# export your aws cli profile and region
export AWS_REGION=eu-west-1
export AWS_PROFILE=default

# list organizational units in your AWS Organization
ctower ls organizational-units

# List all available GuardRail Controls
ctower ls controls all

# List enabled controls for an organizational unit
ctower ls enabled-controls -ou <organizational-unit-name>

# Apply a singular GuardRail Control to an organizational unit
ctower apply control --to-organizational-unit <ou-name> --control-id <control-id>

# Apply `Strongly Recommended` GuardRail Controls to specified Organizational Unit  
ctower apply strongly-recommended -ou <organizational-unit-name>


# Remove a GuardRail Control from an organizational unit
ctower remove control --to-organizational-unit <ou-name> --control-id <control-id>

# Sync(mirror) `--from-organizational-unit` controls to `--to-organizational-unit`
 ctower sync --from-organizational-unit <ou-from> --to-organizational-unit <ou-to>

Package Management with Poetry

Publishing to PyPI

# get and set the PYPI_USERNAME, PYPI_PASSWORD
poetry publish --build --username $PYPI_USERNAME --password $PYPI_PASSWORD

Generating CLI Documentation

# generate CLI application documentation
poetry shell
typer ctower.main utils docs --name ctower --output CLI-README.md

CLI Documentation

ctower

Usage:

$ ctower [OPTIONS] COMMAND [ARGS]...

Options:

  • --install-completion: Install completion for the current shell.
  • --show-completion: Show completion for the current shell, to copy it or customize the installation.
  • --help: Show this message and exit.

Commands:

  • apply
  • ls
  • remove
  • sync

ctower apply

Usage:

$ ctower apply [OPTIONS] COMMAND [ARGS]...

Options:

  • --help: Show this message and exit.

Commands:

  • control
  • strongly-recommended

ctower apply control

Usage:

$ ctower apply control [OPTIONS]

Options:

  • -ou, --organizational-unit TEXT: ID or Name of Organizational Unit to get the controls from. [required]
  • -cid, --control-id TEXT: Control Identifier. Try: ls controls all command [required]
  • --help: Show this message and exit.

ctower apply strongly-recommended

Usage:

$ ctower apply strongly-recommended [OPTIONS]

Options:

  • -ou, --organizational-unit TEXT: ID or Name of Organizational Unit to apply GuardRail controls. Try: ls organizational-units command [required]
  • --help: Show this message and exit.

ctower ls

Usage:

$ ctower ls [OPTIONS] COMMAND [ARGS]...

Options:

  • --help: Show this message and exit.

Commands:

  • controls
  • enabled-controls
  • organizational-units

ctower ls controls

Usage:

$ ctower ls controls [OPTIONS] COMMAND [ARGS]...

Options:

  • --help: Show this message and exit.

Commands:

  • all
  • data-residency
  • elective
  • strongly-recommended
ctower ls controls all

Usage:

$ ctower ls controls all [OPTIONS]

Options:

  • --help: Show this message and exit.
ctower ls controls data-residency

Usage:

$ ctower ls controls data-residency [OPTIONS]

Options:

  • --help: Show this message and exit.
ctower ls controls elective

Usage:

$ ctower ls controls elective [OPTIONS]

Options:

  • --help: Show this message and exit.
ctower ls controls strongly-recommended

Usage:

$ ctower ls controls strongly-recommended [OPTIONS]

Options:

  • --help: Show this message and exit.

ctower ls enabled-controls

Usage:

$ ctower ls enabled-controls [OPTIONS]

Options:

  • -ou, --organizational-unit TEXT: ID or Name of Organizational Unit to list its enabled controls. Try: ls organizational-units command [required]
  • --help: Show this message and exit.

ctower ls organizational-units

Usage:

$ ctower ls organizational-units [OPTIONS]

Options:

  • --help: Show this message and exit.

ctower remove

Usage:

$ ctower remove [OPTIONS] COMMAND [ARGS]...

Options:

  • --help: Show this message and exit.

ctower sync

Usage:

$ ctower sync [OPTIONS]

Options:

  • -fou, --from-organizational-unit TEXT: ID or Name of Organizational Unit to get the controls from. [required]
  • -tou, --to-organizational-unit TEXT: ID or Name of Organizational Unit to apply GuardRail controls to. [required]
  • --help: Show this message and exit.

Screenshots:

  • List Organizational Units for current Organization

image

* List available GuardRails Controls

image

* List enabled GuardRails for Organizational Unit

image

* Apply a GuardRail Control to Organizational Unit

image

* Remove a GuardRail Control from Organizational Unit

image

* Mirror Controls from OU to another OU

image

ctower's People

Contributors

deryadorian avatar halil9 avatar oguzhan-yilmaz 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

Watchers

 avatar  avatar  avatar  avatar

ctower's Issues

Feature Request: Controls as array

Hi folks,

I'm interested in keeping a list of controls in a file and then passing these to ctower, rather than executing a CLI command with a long list of CLID's - is this possible please?

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.