feat(prowler-docker): Run Prowler docker with AWS SSO #5867
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
This pull request addresses the issues encountered when running Prowler in a Docker container. Specifically, it fixes the incorrect usage of output flags that led to ambiguous option errors and enhances the script by adding a local web server to host the Prowler dashboard for easier access and monitoring.
Description
Fixed Output Flags: Corrected the Prowler Docker command by separating output formats into individual -M flags (html, csv, json-ocsf) to eliminate ambiguity and ensure proper report generation.
Output Directory and Filename: Replaced the ambiguous --output flag with --output-directory and --output-filename to clearly specify where and how the reports are saved.
Local Web Server Integration: Added functionality to start a Python-based local HTTP server that hosts the Prowler dashboard at http://localhost:8000, allowing users to access the reports via a web browser.
Browser Automation: Implemented automatic opening of the generated HTML report in the default web browser after the script execution for immediate review.
Environment Variable Handling: Ensured that AWS credentials are correctly exported and passed to the Docker container by properly quoting variables, preventing potential issues with paths containing spaces or special characters.
Dependencies:
Python 3: Required for running the local HTTP server.
jq: Utilized for parsing JSON responses from AWS CLI commands.
Checklist
Are there new checks included in this PR? Yes
If so, do we need to update permissions for the provider? Please review this carefully.
Review if the code is being covered by tests.
Review if code is being documented following this specification Google Python Style Guide
Review if backport is needed.
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.