Skip to main content

Introduction

Prowler supports multiple output formats, allowing users to tailor findings presentation to their needs. Custom output formats are valuable when integrating Prowler with third-party tools, generating specialized reports, or adapting data for specific workflows. By defining a custom output format, users can refine how findings are structured, extracting and displaying only the most relevant information.
  • Output Organization in Prowler Prowler outputs are managed within the /lib/outputs directory. Each format—such as JSON, CSV, HTML, SARIF—is implemented as a Python class.
  • Outputs are generated based on scan findings, which are stored as structured dictionaries containing details such as:
    • Resource IDs
    • Severities
    • Descriptions
    • Other relevant metadata
  • Creation Guidelines Refer to the Prowler Developer Guide for insights into Prowler’s architecture and best practices for creating custom outputs.
  • Identify the most suitable integration method for the output being targeted.

Steps to Create a Custom Output Format

Schema

  • Output Class:
    • The class must inherit from Output. Review the Output Class.
    • Create a class that encapsulates the required attributes and methods for interacting with the target platform. Below the code for the CSV class is presented:
    CSV Class
    • Transform Method:
      • This method will transform the findings provided by Prowler to a specific format.

      Method Implementation

      The following example demonstrates the transform method for the CSV class:
      Transform
    • Batch Write Data To File Method:
      • This method will write the modeled object to a file.

      Method Implementation

      The following example demonstrates the batch_write_data_to_file method for the CSV class:
      Batch Write Data To File

Integrating the Custom Output Format into Prowler

Once the custom output format is created, it must be integrated into Prowler to ensure compatibility with the existing architecture.

Reviewing Current Supported Outputs

Before implementing the new output format, examine the usage of currently supported formats to understand their structure and integration approach. Example: CSV Output Creation in Prowler Below is an example of how Prowler generates and processes CSV output within its codebase:
CSV creation

Testing

  • Verify that Prowler’s findings are accurately typed in the desired output format.
  • Error Handling – Simulate edge cases to assess robustness and failure recovery mechanisms.

Documentation

  • Ensure the following elements are included:
    • Setup Instructions – List all necessary dependencies and installation steps.
    • Configuration details.
    • Example Use Cases – Provide practical scenarios demonstrating functionality.
    • Troubleshooting Guide – Document common issues and resolution steps.
  • Comprehensive and clear documentation improves maintainability and simplifies onboarding of new users.