Giter Club home page Giter Club logo

cobra-tool's Introduction

๐Ÿš€ Cloud Offensive Breach and Risk Assessment (COBRA) Tool ๐Ÿ‘ฉโ€๐Ÿ’ป

License

Description

Cloud Offensive Breach and Risk Assessment (COBRA) is an open-source tool designed to empower users to simulate attacks within multi-cloud environments, offering a comprehensive evaluation of security controls. By automating the testing of various threat vectors including external and insider threats, lateral movement, and data exfiltration, COBRA enables organizations to gain insights into their security posture vulnerabilities. COBRA is designed to conduct simulated attacks to assess an organization's ability to detect and respond to security threats effectively.

It facilitates Proof of Concept (POC) evaluations, assesses security controls, measures maturity levels, and generates comprehensive reports, enabling organizations to enhance their cloud security resilience through lifelike threat scenarios.

COBRA Features

  1. Seamless Integration for POC and Tool Evaluation: COBRA provides seamless integration for Proof of Concept (POC) and tool evaluation purposes. Whether you're exploring new cloud-native applications or evaluating existing solutions, COBRA offers a user-friendly interface and flexible deployment options to facilitate effortless testing and assessment.

  2. Comprehensive Assessment of Cloud-Native Security Posture: Gain unparalleled insights into your organization's existing cloud-native security posture with COBRA. Our advanced assessment capabilities enable you to identify vulnerabilities, assess security controls, and pinpoint areas for improvement. By understanding your current security posture, you can proactively address gaps and strengthen your defenses against emerging threats.

  3. Benchmarking Against Industry Standards and Best Practices: COBRA enables you to benchmark your cloud security controls against industry standards and best practices. With our comprehensive benchmarking framework, you can compare your security posture against established benchmarks, identify areas of strength and weakness, and prioritize remediation efforts accordingly.

  4. Actionable Insights and Recommendations: COBRA goes beyond providing insights by providing a report delivering actionable recommendations tailored to your organization's specific needs. Whether it's optimizing security configurations, implementing additional controls, or enhancing incident response processes, COBRA equips you with the tools and guidance needed to bolster your cloud security defenses.

  5. Continuous Threat Simulation: COBRA offers a modular and templatized approach for users to easily integrate additional modules, allowing for continuous threat simulation and adaptability, by providing a flexible framework for adding modules, COBRA ensures that users can tailor their threat simulation capabilities according to evolving security needs, making it an ideal platform for continuous threat simulation.

Key Features

  • ๐Ÿค– Supports Multi-cloud AWS, Azure and GCP environment.
  • ๐Ÿ” Cloud Native Contextual based analysis.
  • ๐ŸŒ Seamless multi-cloud attack path simulation.
  • ๐Ÿ’ป Cloud based tool evaluation based on controls analysis.
  • ๐Ÿ“Š Generate report and provide check list to mitigate the risk

Prerequisites

  • Python 3.8+
  • pip3
  • Pulumi CLI Docs
  • Pulumi Account here
    • Create Pulumi Personal Access Token Docs
    • Use shell to login to Pulumi $pulumi login (Paste access token) Docs
  • AWS CLI installed
    • Will use the default profile credentials unless defined with the environment variables AWS_PROFILE and AWS_REGION
    • Must have the region defined.
  • Azure CLI
  • Google Cloud SDK

Installation

AWS Credentials

  1. Install the AWS CLI by following the instructions here.

  2. Configure your AWS credentials by running:

    aws configure

    You'll be prompted to enter your Access Key ID, Secret Access Key, and default region name.

Install COBRA Tool

python3 -m venv ./venv
source ./venv/bin/activate
pip install -r requirements.txt

Usage

python3 cobra.py -h
 ____ ___  ____  ____      _
 / ___/ _ \| __ )|  _ \    / \
| |  | | | |  _ \| |_) |  / _ \
| |__| |_| | |_) |  _ <  / ___ \
 \____\___/|____/|_| \_\/_/   \_\


usage: cobra.py [-h] [--simulation] [--scenario {scenario-1,scenario-2}] {aws,azure,gcp} {launch,status,destroy}

Terminal-based option tool

positional arguments:
  {aws,azure,gcp}       Cloud provider (aws, azure, gcp)
  {launch,status,destroy}
                        Action to perform (launch, status, destroy)

options:
  -h, --help            show this help message and exit
  --simulation          Enable simulation mode
  --scenario {scenario-1,scenario-2}
                        Scenario selection

Simulate AWS Scenario

python3 cobra.py aws launch --simulation
  ____ ___  ____  ____      _
 / ___/ _ \| __ )|  _ \    / \
| |  | | | |  _ \| |_) |  / _ \
| |__| |_| | |_) |  _ <  / ___ \
 \____\___/|____/|_| \_\/_/   \_\


Select Attack Scenario of aws:
1. Exploit Vulnerable Application, EC2 takeover, Credential Exfiltration & Anomalous Compute Provisioning
2. Rest API exploit - command injection, credential exfiltration from backend lambda and privilige escalation, rogue identity creation & persistence
Enter your choice:

Check Status

python3 cobra.py aws status

Destroy Simulation

python3 cobra.py aws destroy --scenario <scenario-1/scenario-2> 

Current Scenarios

  1. Exploit Vulnerable Application, EC2 takeover, Credential Exfiltration & Anomalous Compute Provisioning
  2. Rest API exploit - command injection, credential exfiltration from backend lambda and privilige escalation, rogue identity creation & persistence

To Do / In Roadmap

  1. Compromising a GKE Pod and accessing cluster secrets, taking over the cluster & escalating privileges at the Project level, possible project takeover.
  2. Azure App exploit on a function, data exfiltration from Blob storage & abusing function misconfigs to escalate privileges & leaving a backdoor IAM entity.
  3. Exploiting an App on VM, exfiltration of data from Cosmos DB & possible takeover of a resource group.
  4. More scenarios loading...

License

This project is licensed under the Apache Version 2.0, - see the LICENSE file for details

cobra-tool's People

Contributors

hkoushik avatar anandtiwarics avatar amit-schnitzer avatar sgordon46 avatar mdorn avatar

Stargazers

 avatar  avatar Sumit Verma avatar Tripp avatar llatorre avatar Sarah Gold avatar Larry Eichenbaum avatar Hogge Cybersecurity, LLC avatar Markus Gierlinger avatar Dan avatar Bert Vaerendonck avatar xrkk avatar  avatar Tomas Rzepka avatar Anirban Das avatar  avatar  avatar  avatar  avatar Roy Sam avatar Rafael  avatar  avatar

Watchers

Albert Estevez avatar  avatar Brian Torres-Gil avatar  avatar Roy Sam avatar Luigi Mori avatar  avatar  avatar  avatar

cobra-tool's Issues

Using Pulumi

I had a question around what else is needed to use Pulumi. It says to install, but are there any other requirements.

I'd suggest adding this to the README is something else is needed.

I'm getting an error when trying to run simulation 1
ModuleNotFoundError: No module named 'pulumi'

Anomalous ec2 instance doesn't get destroyed as part of the "python3 cobra.py aws destroy --scenario scenario-1" command

Describe the bug

During the installation, an ec2 machine gets deployed not using Pulumi but using the "aws ec2 run-instances..." command but when the environment gets destroyed, the above instance doesn't get destroyed and thus left running and unattended.
This is not efficient and might incur unneeded costs much after the environment is used.

Expected behavior

environment gets cleaned completely, restoring customer account similar to how it was before running the lab

Current behavior

ec2 machine is left running even after the lab is destroyed

Possible solution

Add a script to remove that instance when destroyed

Steps to reproduce

  1. Create the environment - "python3 cobra.py aws launch --simulation" choosing scenario1
  2. Wait until all 3 instances gets created (cobra-attacker, cobra-webserver and cobra-anomalous)
  3. Destroy the environment - "python3 cobra.py aws destroy --scenario scenario-1"
  4. Check the AWS account and you'll notice the anomalous instance still up and running even after it has been destroyed

Screenshots

Context

Your Environment

  • Version used:
  • Environment name and version (e.g. Chrome 59, node.js 5.4, python 3.7.3):
  • Operating System and version (desktop or mobile):
  • Link to your project:

Refactor scenarios

Is your feature request related to a problem?

Currently to create a new scenario, you need to duplicate an existing scenario folder and replace the relevant code with logic relating to your new scenario. Hundreds of lines of code remain the exact same.

Describe the solution you'd like

I would like to see the code refactored so that, for example, a contributor could simply subclass a base class and/or compose a configuration file that reuses code from a single module wherever possible. This will make it far easier and cleaner for contributors to add scenarios. It will also make test automation much easier, as the project matures.

Describe alternatives you've considered

Right now the only way i've really considered is to create a base class to inherit from (I'll add some more detail in the comments).

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.