Prowler

5.24.0 · active · verified Thu Apr 16

Prowler is an Open Source Cloud Security Platform that automates security and compliance across AWS, GCP, Azure, Kubernetes, Microsoft 365, GitHub, Infrastructure as Code, and MongoDB Atlas environments. It provides hundreds of ready-to-use security checks aligned with various compliance frameworks like CIS, NIST, PCI-DSS, SOC2, and AWS Well-Architected. Currently at version 5.24.0, Prowler has a regular release cadence, with minor versions released frequently, often weekly or bi-weekly, to introduce new features, checks, and bug fixes.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to run a basic Prowler AWS scan using Python's `subprocess` module. Prowler automatically uses configured cloud credentials (e.g., from AWS CLI, environment variables, or IAM roles). The example runs a specific check for brevity, but you can configure full scans or compliance frameworks using various CLI flags. Output is captured for programmatic access.

import subprocess
import os

# Ensure AWS credentials are configured (e.g., via AWS CLI or environment variables)
# Example: export AWS_ACCESS_KEY_ID='AKIA...'
#          export AWS_SECRET_ACCESS_KEY='...'
#          export AWS_SESSION_TOKEN='...'

print("Running a basic Prowler scan for AWS. This may take a while...")

try:
    # Run a basic AWS scan and output to the terminal
    # For a full scan, remove --checks CHECK_AWS_EC2_01. For specific frameworks, use --compliance.
    result = subprocess.run(
        ["prowler", "aws", "--checks", "CHECK_AWS_EC2_01", "--output-modes", "json", "text"],
        capture_output=True, text=True, check=True
    )
    print("Scan completed successfully.")
    print("--- Standard Output ---")
    print(result.stdout)
    if result.stderr:
        print("--- Standard Error ---")
        print(result.stderr)
except subprocess.CalledProcessError as e:
    print(f"An error occurred during the Prowler scan: {e}")
    print(f"Command: {e.cmd}")
    print(f"Return Code: {e.returncode}")
    print(f"Output: {e.stdout}")
    print(f"Error Output: {e.stderr}")
except FileNotFoundError:
    print("Error: 'prowler' command not found. Please ensure Prowler is installed and in your PATH.")

view raw JSON →