Convert Figma logo to code with AI

Netflix logosecurity_monkey

Security Monkey monitors AWS, GCP, OpenStack, and GitHub orgs for assets and their changes over time.

4,352
798
4,352
84

Top Related Projects

Cartography is a Python tool that consolidates infrastructure assets and the relationships between them in an intuitive graph view powered by a Neo4j database.

CloudMapper helps you analyze your Amazon Web Services (AWS) environments.

Cloudsplaining is an AWS IAM Security Assessment tool that identifies violations of least privilege and generates a risk-prioritized report.

Multi-Cloud Security Auditing Tool

Cloud Security Posture Management (CSPM)

6,861

Prevent cloud misconfigurations and find vulnerabilities during build-time in infrastructure as code, container images and open source packages with Checkov by Bridgecrew.

Quick Overview

Security Monkey is an open-source tool developed by Netflix to monitor and analyze the security of cloud environments, particularly AWS and GCP. It helps identify security risks, policy violations, and configuration changes across multiple accounts and services.

Pros

  • Comprehensive monitoring of cloud infrastructure security
  • Supports multiple cloud providers (AWS, GCP)
  • Customizable rules and alerts
  • Open-source with active community support

Cons

  • Complex setup and configuration process
  • Resource-intensive for large-scale deployments
  • Limited support for newer cloud services
  • Requires regular maintenance and updates

Code Examples

Security Monkey is not primarily a code library, but rather a standalone application. However, here are a few examples of how to interact with Security Monkey programmatically:

  1. Retrieving items from Security Monkey API:
import requests

api_url = "http://security_monkey_host:port/api/1/items"
response = requests.get(api_url, auth=('username', 'password'))
items = response.json()
  1. Creating a custom auditor:
from security_monkey.auditor import Auditor

class CustomAuditor(Auditor):
    def __init__(self, accounts=None, debug=False):
        super(CustomAuditor, self).__init__(accounts=accounts, debug=debug)

    def check_for_issue(self, item):
        if some_condition:
            self.add_issue(10, 'High', item, notes='Custom issue detected')
  1. Extending Security Monkey with a custom watcher:
from security_monkey.watcher import Watcher

class CustomWatcher(Watcher):
    index = 'custom'
    i_am_singular = 'Custom Resource'
    i_am_plural = 'Custom Resources'

    def __init__(self, accounts=None, debug=False):
        super(CustomWatcher, self).__init__(accounts=accounts, debug=debug)

    def slurp(self):
        # Implement custom logic to fetch and process resources
        pass

Getting Started

To set up Security Monkey:

  1. Clone the repository:

    git clone https://github.com/Netflix/security_monkey.git
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Configure the application:

    • Set up a database (PostgreSQL recommended)
    • Configure cloud provider credentials
    • Customize config.py with your settings
  4. Run the application:

    python manage.py run
    

For detailed instructions, refer to the official documentation in the repository.

Competitor Comparisons

Cartography is a Python tool that consolidates infrastructure assets and the relationships between them in an intuitive graph view powered by a Neo4j database.

Pros of Cartography

  • More comprehensive graph-based approach for visualizing cloud infrastructure relationships
  • Supports multiple cloud providers (AWS, GCP, Azure) and other services like Okta
  • Actively maintained with regular updates and contributions

Cons of Cartography

  • Steeper learning curve due to graph database concepts
  • May require more resources to run and maintain compared to Security Monkey
  • Less focused on specific security auditing features

Code Comparison

Security Monkey example (Python):

from security_monkey.decorators import record_exception
from security_monkey.watcher import Watcher

class SomeWatcher(Watcher):
    @record_exception()
    def slurp(self):
        # Implement cloud resource fetching logic

Cartography example (Python):

from cartography.intel.aws import ec2
from cartography.util import run_analysis_job

def sync(neo4j_session, boto3_session, regions, update_tag):
    ec2.sync(neo4j_session, boto3_session, regions, update_tag)
    run_analysis_job('aws_ec2_asset_exposure.json', neo4j_session, update_tag)

Both projects aim to improve cloud security, but Cartography offers a more holistic view of infrastructure relationships across multiple providers. Security Monkey focuses more on specific security auditing tasks for AWS. Cartography's graph-based approach provides powerful visualization capabilities, while Security Monkey may be easier to set up for simpler use cases.

CloudMapper helps you analyze your Amazon Web Services (AWS) environments.

Pros of CloudMapper

  • Lightweight and easy to set up, with minimal dependencies
  • Provides visual network diagrams of AWS environments
  • Supports multiple AWS accounts and regions simultaneously

Cons of CloudMapper

  • Limited to AWS, while Security Monkey supports multiple cloud providers
  • Lacks continuous monitoring and alerting capabilities
  • Does not offer policy enforcement or compliance checking features

Code Comparison

CloudMapper:

def parse_arguments():
    parser = argparse.ArgumentParser(description="CloudMapper")
    parser.add_argument("--config", help="Config file name", default="config.json")
    parser.add_argument("--account", help="Account to collect from")
    return parser.parse_args()

Security Monkey:

def __init__(self, account=None, debug=False):
    self.account_manager = account_registry.get(account)
    self.debug = debug
    self.interval = self.config.get('interval', 15)
    self.max_items = self.config.get('max_items', 1000)

Both projects use Python and handle AWS account configurations, but CloudMapper focuses on parsing command-line arguments for account selection, while Security Monkey initializes account management and configuration settings within its class structure.

CloudMapper is more suitable for quick, visual AWS infrastructure analysis, while Security Monkey offers comprehensive, multi-cloud security monitoring and compliance features. The choice between them depends on specific use cases and organizational requirements.

Cloudsplaining is an AWS IAM Security Assessment tool that identifies violations of least privilege and generates a risk-prioritized report.

Pros of Cloudsplaining

  • Focused specifically on AWS IAM policy analysis, providing deeper insights into IAM-related security issues
  • Generates HTML reports for easy sharing and visualization of results
  • Lightweight and easy to set up, with minimal dependencies

Cons of Cloudsplaining

  • Limited to AWS IAM analysis, while Security Monkey covers multiple cloud providers and services
  • Lacks continuous monitoring capabilities offered by Security Monkey
  • Does not provide a web interface for real-time monitoring and alerting

Code Comparison

Security Monkey example (Python):

from security_monkey.decorators import record_exception
from security_monkey.watcher import Watcher

class IAMRoleWatcher(Watcher):
    def __init__(self, accounts=None, debug=False):
        super(IAMRoleWatcher, self).__init__(accounts=accounts, debug=debug)
        self.honor_ephemerals = True
        self.ephemeral_paths = ["Arn"]

Cloudsplaining example (Python):

from cloudsplaining.scan.policy_document import PolicyDocument

policy = PolicyDocument(policy_dict)
results = policy.analyze_policy_vector()
print(results.findings)

Both tools focus on cloud security, but Cloudsplaining specializes in AWS IAM policy analysis, while Security Monkey offers broader cloud service monitoring across multiple providers. Cloudsplaining provides more detailed IAM insights, while Security Monkey offers continuous monitoring and a web interface for real-time alerts.

Multi-Cloud Security Auditing Tool

Pros of ScoutSuite

  • Multi-cloud support: Covers AWS, Azure, GCP, and more
  • Faster scanning and reporting due to its lightweight design
  • More frequent updates and active community contributions

Cons of ScoutSuite

  • Less granular control over security rules compared to Security Monkey
  • Lacks some advanced features like change monitoring and alerting
  • May require more manual configuration for complex environments

Code Comparison

Security Monkey (Python):

def check_internet_accessible(self, item):
    if item.config.get('NetworkInterfaces', [{}])[0].get('Association', {}).get('PublicIp'):
        self.add_issue(10, 'Internet Accessible', item, notes='Instance has a public IP')

ScoutSuite (Python):

def _check_internet_accessible(self, instance):
    for eni in instance['NetworkInterfaces']:
        if eni.get('Association', {}).get('PublicIp'):
            return True
    return False

Both tools use similar approaches to check for internet-accessible resources, but ScoutSuite's implementation is slightly more concise and focused on a single check, while Security Monkey's includes issue reporting within the function.

Cloud Security Posture Management (CSPM)

Pros of CloudSploit

  • Supports multiple cloud providers (AWS, Azure, GCP, Oracle)
  • Actively maintained with regular updates
  • Extensive plugin architecture for easy customization

Cons of CloudSploit

  • Less comprehensive AWS coverage compared to Security Monkey
  • Lacks some advanced features like change monitoring and alerting

Code Comparison

Security Monkey (Python):

def check_internet_accessible(self, elb):
    for listener in elb.get('ListenerDescriptions', []):
        if listener['Listener']['Protocol'] in ['HTTP', 'HTTPS']:
            return True
    return False

CloudSploit (JavaScript):

const checkInternetAccessible = (elb) => {
    return elb.ListenerDescriptions.some(listener => 
        ['HTTP', 'HTTPS'].includes(listener.Listener.Protocol));
};

Both projects aim to improve cloud security, but they differ in approach and scope. Security Monkey focuses primarily on AWS and offers more in-depth monitoring and alerting capabilities. CloudSploit provides broader multi-cloud support with a plugin-based architecture, making it more flexible for organizations using multiple cloud providers. The code comparison shows similar logic implemented in different languages, reflecting the projects' respective technology stacks.

6,861

Prevent cloud misconfigurations and find vulnerabilities during build-time in infrastructure as code, container images and open source packages with Checkov by Bridgecrew.

Pros of Checkov

  • Broader coverage of cloud providers and infrastructure-as-code tools (AWS, Azure, GCP, Kubernetes, Terraform, CloudFormation, etc.)
  • Faster scanning and analysis due to its static code analysis approach
  • Easier integration with CI/CD pipelines and developer workflows

Cons of Checkov

  • Less focus on real-time monitoring and continuous assessment of cloud environments
  • May require more manual configuration for custom policies and rules
  • Lacks some advanced features like change tracking and alerting found in Security Monkey

Code Comparison

Security Monkey (Python):

def check_internet_accessible(self, item):
    if item.config.get('Scheme', None) == 'internet-facing':
        self.add_issue(10, 'Internet Accessible', item, notes='ELB is internet-facing')

Checkov (Python):

def check(self, conf):
    if 'scheme' in conf.keys():
        if conf['scheme'][0] == 'internet-facing':
            return CheckResult.FAILED
    return CheckResult.PASSED

Both tools use Python for policy checks, but Checkov's approach is more modular and easier to extend. Security Monkey's checks are often more tightly coupled with AWS-specific concepts, while Checkov's checks are designed to be more generic and applicable across different cloud providers and IaC tools.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

NOTE: Security Monkey is in maintenance mode and will be end-of-life in 2020.

Security Monkey

Security Monkey Logo 2017

Security Monkey monitors your AWS and GCP accounts for policy changes and alerts on insecure configurations. Support is available for OpenStack public and private clouds. Security Monkey can also watch and monitor your GitHub organizations, teams, and repositories.

It provides a single UI to browse and search through all of your accounts, regions, and cloud services. The monkey remembers previous states and can show you exactly what changed, and when.

Security Monkey can be extended with custom account types, custom watchers, custom auditors, and custom alerters.

It works on CPython 2.7. It is known to work on Ubuntu Linux and OS X.

Gitter chat

Develop BranchMaster Branch
Build StatusBuild Status
Coverage StatusCoverage Status

Special Note:

Netflix's support for Security Monkey has been reduced for minor bug fixes only. That being said, we are happy to accept and merge pull-requests that fix bugs and add new features as appropriate.

🚨⚠️🥁🎺 PLEASE READ: BREAKING CHANGES FOR 1.0 🎺🥁⚠️🚨

If you are upgrading to 1.0 for the first time, please review the Quickstart and the Autostarting documents as there is a new deployment pattern for Security Monkey. Also, new IAM permissions have been added.

Project resources

Instance Diagram

The components that make up Security Monkey are as follows (not AWS specific): diagram

Access Diagram

Security Monkey accesses accounts to scan via credentials it is provided ("Role Assumption" where available). diagram