All Projects → aws-samples → amazon-detective-multiaccount-scripts

aws-samples / amazon-detective-multiaccount-scripts

Licence: Apache-2.0 license
interact with Amazon Detective in multiple accounts and regions

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to amazon-detective-multiaccount-scripts

aws-cloudformation-resource-providers-cloudformation
The CloudFormation Resource Provider Package For AWS CloudFormation
Stars: ✭ 42 (+68%)
Mutual labels:  resources, aws-resources
aws-cloudformation-resource-providers-logs
The CloudFormation Resource Provider Package For Amazon CloudWatch Logs
Stars: ✭ 25 (+0%)
Mutual labels:  resources, aws-resources
free-node.js-learning-resources
A curated list of free resources to learn node.js
Stars: ✭ 70 (+180%)
Mutual labels:  resources
framestack
Tools, Frameworks & Libraries to help you build your projects ✨
Stars: ✭ 27 (+8%)
Mutual labels:  resources
awesome-metal
A collection of Metal and MetalKit projects and resources. Very much work in progress.
Stars: ✭ 152 (+508%)
Mutual labels:  resources
Web-Dev-Helper
Developer Helper where you can find all resources related to open source and software developer resources
Stars: ✭ 33 (+32%)
Mutual labels:  resources
FreeML
Data Science Resources (Mostly Free)
Stars: ✭ 55 (+120%)
Mutual labels:  resources
almanacs
A recipe for everything 🗒️
Stars: ✭ 47 (+88%)
Mutual labels:  resources
awesome-edtech-tools
An ongoing curated list with awesome tools and resources for instructional designers.
Stars: ✭ 135 (+440%)
Mutual labels:  resources
recommendations-for-engineers
All of my recommendations for aspiring engineers in a single place, coming from various areas of interest.
Stars: ✭ 81 (+224%)
Mutual labels:  resources
podcasting-resources
Resources and links related to podcasting. Created for W/S/C 2018 but can be forked/added to as time goes on.
Stars: ✭ 43 (+72%)
Mutual labels:  resources
nepali-devblogs
Collection of blogs/publications by Nepali devs.
Stars: ✭ 30 (+20%)
Mutual labels:  resources
PracticalMachineLearning
A collection of ML related stuff including notebooks, codes and a curated list of various useful resources such as books and softwares. Almost everything mentioned here is free (as speech not free food) or open-source.
Stars: ✭ 60 (+140%)
Mutual labels:  resources
members
Online portal for Code for Denver members
Stars: ✭ 15 (-40%)
Mutual labels:  resources
purebasic-archives
A collection of PureBASIC resources.
Stars: ✭ 23 (-8%)
Mutual labels:  resources
Quantum-Computing-Resources
This repository contains the best resources for learning practical quantum computing. This repository will be updated frequently.
Stars: ✭ 60 (+140%)
Mutual labels:  resources
Web-Development
Created this new Repository for Open Source Contribution for Beginners
Stars: ✭ 25 (+0%)
Mutual labels:  resources
website-development-questionnaire
Questions to ask your client before you start developing the website.
Stars: ✭ 28 (+12%)
Mutual labels:  resources
engineering-management
A list of resources about Software Engineering Management
Stars: ✭ 31 (+24%)
Mutual labels:  resources
urban-and-regional-planning-resources
Community list of data & technology resources concerning the built environment and communities. 🏙️🌳🚌🚦🗺️
Stars: ✭ 109 (+336%)
Mutual labels:  resources

amazon-detective-multiaccount-scripts

Amazon Detective provides a set of open-source Python scripts in this repository. The scripts require Python 3.

You can use these to perform the following tasks:

  • Enable Detective for an administrator account across Regions. When you enable Detective, you can assign tag values to assign to a new behavior graph.
  • Add member accounts to an administrator account's behavior graphs across Regions.
  • Optionally send invitation emails to the member accounts. You can also configure the request to not send invitation emails.
  • Remove member accounts from an administrator account's behavior graphs across Regions.
  • Disable Detective for an administrator account across Regions. When an administrator account disables Detective, the administrator account's behavior graph in each Region is disabled.

For more information on how to use these scripts, see Using the Amazon Detective Python scripts

Contributing to this project

Complete use case

The following is an example use case of adding multiple accounts in a graph.

  1. Create a .csv file of the AWS account ids.
    1. (Please check the format in section: Creating a .csv list of accounts to add or remove)
  2. Add the necessary permissions to each account.
    1. (Please check the complete setup in section: Required permissions for the scripts)
  3. Add the root module into PYTHONPATH.
    #For example: export PYTHONPATH=$PYTHONPATH:/my_folder/amazon-detective-multiaccount-scripts/src
    
    export PYTHONPATH=$PYTHONPATH:<absolute root module path> 
    
  4. Go to the root module, and run the python script and specify the .csv file. Make sure the role specified by --assume_role is the one created in Step 2.
    #For example:
    cd /my_folder/amazon-detective-multiaccount-scripts/src/amazon_detective_multiaccount_scripts
    python3 enableDetective.py --admin_account 111122223333 --assume_role ManageDetective --input_file inputFile.csv --tags Department=Finance --enabled_regions us-west-1
    
  5. Check results of the script in the terminal and/or AWS console.
    1. For example, for the command above, the terminal should have the following output: plot plot

Running tests

# Install requirements

pip3 install boto3 pytest

# In the tests/ directory...

# Add your root module into PYTHONPATH (if you haven't done this step) 
# eg: export PYTHONPATH=$PYTHONPATH:/my_folder/amazon-detective-multiaccount-scripts/src

export PYTHONPATH=$PYTHONPATH:<absolute root module path> 

# Run the test

pytest -s

FAQs

  1. If you experience the following error Message for opt-in regions while enabling detective in all regions:

    ERROR - error with region <region>: An error occurred (UnrecognizedClientException) when calling the ListGraphs operation: The security token included in the request is invalid

    Using the scripts in opt-in regions assumes you have your accounts/resources configured in that region, so please double-check your accounts' configuration.

    For further information, here is documentation on opt-in regions work: https://docs.aws.amazon.com/general/latest/gr/rande-manage.html.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].