Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(prowler-docker): Run Prowler docker with AWS SSO #5867

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Twodragon0
Copy link

@Twodragon0 Twodragon0 commented Nov 22, 2024

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.

@Twodragon0 Twodragon0 requested review from a team as code owners November 22, 2024 15:51
@jfagoagas jfagoagas changed the title aws-sso-docker.sh feat(prowler-docker): Run Prowler docker with AWS SSO Nov 25, 2024
Copy link
Member

@jfagoagas jfagoagas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @Twodragon0, could you please move the folder util/aws-sso-docker to contrib/aws-sso-docker since this is the place where we store all the scripts and contributions to run Prowler.

Thanks for contributing to Prowler 🚀

@jfagoagas jfagoagas self-requested a review November 26, 2024 07:30
Copy link
Member

@jfagoagas jfagoagas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I misclicked the button, I wanted to request changes -> #5867 (review)

@jfagoagas jfagoagas self-assigned this Nov 26, 2024
Copy link

codecov bot commented Nov 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.91%. Comparing base (26a9748) to head (ed0c02b).
Report is 613 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5867      +/-   ##
==========================================
+ Coverage   89.84%   89.91%   +0.07%     
==========================================
  Files        1139     1141       +2     
  Lines       35483    35503      +20     
==========================================
+ Hits        31878    31923      +45     
+ Misses       3605     3580      -25     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Author

@Twodragon0 Twodragon0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your comment.
modify location ( util/ -> contrib/ )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants