https://github.com/awslabs/aws-cloudsaga

AWS CloudSaga - Simulate security events in AWS

https://github.com/awslabs/aws-cloudsaga

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (6.8%) to scientific vocabulary

Keywords

aws blue-team incident-response-tooling purple-team red-teaming security security-audit
Last synced: 5 months ago · JSON representation

Repository

AWS CloudSaga - Simulate security events in AWS

Basic Info
  • Host: GitHub
  • Owner: awslabs
  • License: apache-2.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 171 MB
Statistics
  • Stars: 468
  • Watchers: 13
  • Forks: 35
  • Open Issues: 3
  • Releases: 2
Topics
aws blue-team incident-response-tooling purple-team red-teaming security security-audit
Created almost 4 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct Notice

README.md

AWS CloudSaga - Simulate security events in AWS

AWS CloudSaga is for customers to test security controls and alerts within their Amazon Web Services (AWS) environment, using generated alerts based on security events seen by the AWS Customer Incident Response Team (CIRT).

Use Case

Security controls and best practices are published for securing AWS accounts, however, customers look for mechanisms to test security and incident response within their AWS environments, in order to protect themselves against known security events.

AWS CloudSaga is for customers who want to test their environment against documented security events from the AWS CIRT. Using AWS CloudSaga, simple scenarios that mimic actual security events can be run against a customer's environment, testing the customer's response plans and defenses when these events occur, and improve defenses of their AWS environment from the results.

Usage

``` cloudsaga

 ___   ____    __    ____   _______.          
/   \  \   \  /  \  /   /  /       |         

/ ^ \ \ \/ \/ / | (----`
/ /\ \ \ / \ \
/ _
___ \ \ /\ / .----) |
// _\ _/ __/ |_____/

______ __ ______ __ __ _______ ______. __ _______ ___ / || | / __ \ | | | | | \ / | / \ / __| / \ | ,----'| | | | | | | | | | | .--. | | (----` / ^ \ | | _ / ^ \ | | | | | | | | | | | | | | | | \ \ / /\ \ | | | | / /\ \ | ----.|----.| --' | |--' | | '--' |.----) | / __ \ | || | / ___ \
___||_| _/ _/ |_/ |___/ // _\ _____| // _\

        Joshua "DozerCat" McKiddy - Team DragonCat - AWS
        Type -h for help.

usage: cloudsaga [-h] [--scenario SCENARIO] [--chapters] [--about ABOUT]

CloudSaga - Simulate security events based on previous Ziplines

optional arguments:
-h, --help           show this help message and exit
--scenario SCENARIO  Perform the scenario you want to run against your AWS
                    environment.
--chapters           List the available scenarios within CloudSaga. Use the
                    --about flag to read details about a specific scenario.
--about ABOUT        Read about a specific scenario (e.g. --about
                    <scenario>. For a list of available scenarios, use the
                    --chapters flag.

```

Prerequesites

Permissions

The following permissions are needed within AWS IAM for CloudSaga to run: * For imds-reveal: "ec2:DescribeInstances" * For network-changes: "ec2:DescribeInstances", "ec2:RunInstances", "ec2:CreateVpc", "ec2:DescribeVpcs", "ec2:CreateSecurityGroup" * For mining-bitcoin: "ec2:DescribeInstances", "ec2:RunInstances" * For iam-credentials: "iam:GenerateCredentialReport", "iam:GetCredentialReport" * For public-resources: "rds:DescribeDBInstances", "rds:CreateDBInstance", "rds:DeleteDBInstance", "s3:ListBuckets", "s3:CreateBucket", "s3:PutPublicAccessBlock", "s3:DeletePublicAccessBlock"

Specific Scenario Details

IMDS Reveal Scenario: This scenario is based on a server-side request forgery attack. EC2 instances using IMDS version 1 are more likely to be subject to this kind of software flaw, and if EC2 Role credentials are present, those credentials can be used in AWS. Bitcoin Mining Scenario: This scenario simulates the creation of Bitcoin mining instances. Attackers attempt to create Bitcoin mining instances using Amazon EC2, in order to leverage legitimate AWS customer's resources for their own purposes. Network Changes Scenario: This scenario simulates the creation and modification of network resources within AWS. This includes creating Amazon VPCs, as well as modifications to Security Groups, for the purposes of compromising resources within the AWS account. IAM Credentials Scenario: This scenario attempts to grab the IAM credential report within the AWS account. Publicly Accessible Resources Scenario: This scenario is for creating then checking for publicly accessible resources within an AWS account.

Running the Code

The code in it's current form can be ran inside the following: * AWS CloudShell (preferred) * Locally (with IAM credentials, not preferred)

Prerequisites

The following prerequisites are required to use AWS CloudSaga * Python 3.7 or later * boto3 1.21.7 or later * pip3 (for installation of AWS CloudSaga)

Installing the code

Installation of the code is done via pip3: pip3 install cloudsaga

Step-by-Step Instructions (for running in AWS CloudShell)

  1. Log into the AWS Console of the account you want to run AWS CloudSaga.
  2. Click on the icon for AWS Cloudshell next to the search bar.
    • Ensure that you're in a region where AWS CloudShell is currently available.
  3. Once the session begins, install AWS CloudSaga via pip3: pip3 install cloudsaga
  4. Once installed, run the following command to review the help page for AWS CloudSaga. cloudsaga -h
  5. Review the scenarios, select the one that you want to run for generating your security event for testing.

Logging

A log file containing the detailed output of actions will be placed in the root directory of AWS CloudSaga. The format of the file will be cloudsagatimestamphere.log

Sample output within the log file: 2022-02-22 01:20:47,826 - INFO - --Checking instances in AWS region me-south-1-- 2022-02-22 01:20:47,826 - INFO - DescribeInstances API Call in AWS region me-south-1-- 2022-02-22 01:20:48,712 - INFO - You cannot perform lookup of IMDS versions in this region. Error message below: 2022-02-22 01:20:48,712 - ERROR - An error occurred (AuthFailure) when calling the DescribeInstances operation: AWS was not able to validate the provided access credentials 2022-02-22 01:20:48,713 - INFO - --Checking instances in AWS region sa-east-1-- 2022-02-22 01:20:48,713 - INFO - DescribeInstances API Call in AWS region sa-east-1-- 2022-02-22 01:20:49,525 - INFO - --Checking instances in AWS region us-east-1-- 2022-02-22 01:20:49,525 - INFO - DescribeInstances API Call in AWS region us-east-1-- 2022-02-22 01:20:49,876 - INFO - --Checking instances in AWS region us-east-2-- 2022-02-22 01:20:49,876 - INFO - DescribeInstances API Call in AWS region us-east-2-- 2022-02-22 01:20:50,192 - INFO - --Checking instances in AWS region us-west-1-- 2022-02-22 01:20:50,192 - INFO - DescribeInstances API Call in AWS region us-west-1-- 2022-02-22 01:20:50,444 - INFO - --Checking instances in AWS region us-west-2-- 2022-02-22 01:20:50,445 - INFO - DescribeInstances API Call in AWS region us-west-2-- 2022-02-22 01:20:50,610 - INFO - Instance ID i-99999999999999999 is using IMDSv1, where no authentication header is required to access the IMDS service.

Cleaning Up

Once the logs have been enabled, you can safely remove any of the downloaded files from AWS CloudShell. * Note: The log file containing the detailed output of actions will be in the root directory of AWS CloudSaga. If you want to retain this, please download this to a safe place, either locally or to an Amazon S3 bucket, for your records. For information on how to download files from AWS CloudShell sessions, refer to the following link.

Feedback

Please use the Issues section to submit any feedback, such as features or recommendations, as well as any bugs that are encountered.

Security

See CONTRIBUTING for more information.

License

This project is licensed under the Apache-2.0 License.

Owner

  • Name: Amazon Web Services - Labs
  • Login: awslabs
  • Kind: organization
  • Location: Seattle, WA

AWS Labs

GitHub Events

Total
  • Watch event: 19
  • Delete event: 1
  • Issue comment event: 2
  • Push event: 297
  • Pull request event: 2
  • Fork event: 4
  • Create event: 1
Last Year
  • Watch event: 19
  • Delete event: 1
  • Issue comment event: 2
  • Push event: 297
  • Pull request event: 2
  • Fork event: 4
  • Create event: 1

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 32
  • Total Committers: 6
  • Avg Commits per committer: 5.333
  • Development Distribution Score (DDS): 0.344
Past Year
  • Commits: 3
  • Committers: 2
  • Avg Commits per committer: 1.5
  • Development Distribution Score (DDS): 0.333
Top Committers
Name Email Commits
Joshua McKiddy j****y@a****m 21
Jason H 9****i@u****m 4
Mark Beacom 7****m@u****m 3
Cydney Stude 7****e@u****m 2
Amazon GitHub Automation 5****o@u****m 1
Joshua McKiddy 4****u@u****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 3
  • Total pull requests: 11
  • Average time to close issues: about 20 hours
  • Average time to close pull requests: 4 months
  • Total issue authors: 3
  • Total pull request authors: 5
  • Average comments per issue: 2.33
  • Average comments per pull request: 0.18
  • Merged pull requests: 8
  • Bot issues: 0
  • Bot pull requests: 5
Past Year
  • Issues: 0
  • Pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 2
Top Authors
Issue Authors
  • kclinden (1)
  • Ameurdx (1)
  • mbeacom (1)
Pull Request Authors
  • dependabot[bot] (5)
  • mbeacom (3)
  • hackersifu (1)
  • cydneystude (1)
  • kihakuni (1)
Top Labels
Issue Labels
enhancement (1)
Pull Request Labels
dependencies (5) documentation (3) enhancement (3)

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 28 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 1
    (may contain duplicates)
  • Total versions: 3
  • Total maintainers: 1
pypi.org: cloudsaga

AWS CloudSaga is a tool to test security controls and alerts within their Amazon Web Services (AWS) environment

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 28 Last month
Rankings
Stargazers count: 3.3%
Dependent packages count: 7.4%
Forks count: 7.5%
Average: 15.7%
Dependent repos count: 22.2%
Downloads: 37.9%
Maintainers (1)
Last synced: 6 months ago
conda-forge.org: cloudsaga
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Stargazers count: 19.8%
Dependent repos count: 34.0%
Average: 35.1%
Forks count: 35.4%
Dependent packages count: 51.2%
Last synced: 6 months ago

Dependencies

.github/workflows/github-repo-stats.yml actions
  • jgehrcke/github-repo-stats RELEASE composite
.github/workflows/publish.yml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
poetry.lock pypi
  • boto3 1.21.7
  • botocore 1.24.7
  • jmespath 0.10.0
  • python-dateutil 2.8.2
  • s3transfer 0.5.2
  • six 1.16.0
  • urllib3 1.26.8
pyproject.toml pypi
  • boto3 ^1.21.7
  • python ^3.7