Streamlit/dashboard interface
Overview
The local dashboard is implemented with Dash rather than Streamlit. Its process entrypoint is dashboard/__main__.py, which prints the Prowler dashboard banner, installs the ready-message hook from dashboard/…/startup.py, creates a dash.Dash(..., use_pages=True) app, and hosts dash.page_container inside a custom left sidebar shell. The CLI parser in dashboard/…/arguments.py only registers the dashboard subcommand; runtime output paths are fixed in dashboard/config.py to os.getcwd()/output for findings CSVs and os.getcwd()/output/compliance for compliance CSVs.
Routing is split between local functional pages and gated Prowler Cloud informational pages. dashboard/__main__.py links / to Overview and /compliance to Compliance, then builds the remaining sidebar sections from CLOUD_FEATURES_BY_SLUG in dashboard/…/cloud.py. The active nav state is driven by Dash Pages' internal _pages_location callback, not a separate dcc.Location, because all /cloud/* pages share the same component tree. dashboard/…/cloud.py registers one Dash page per feature under /cloud/<slug> and renders only static upsell or hand-off content: CTAs point to external Prowler Cloud/pricing/docs URLs and never include local account, file, or finding data. The same module also builds the compact compliance hand-off card that dashboard/…/layouts.py appends to the Compliance page.
dashboard/…/overview.py reads semicolon-delimited CSV files from folder_path_overview at module import, keeps only files with more than one row and a CHECK_ID column, and normalizes several older/newer output schemas before rendering. It maps v3-style columns such as ASSESSMENT_START_TIME, ACCOUNT_ID, RESOURCE_ID, and FINDING_UNIQUE_ID into the dashboard's working TIMESTAMP, ACCOUNT_UID, RESOURCE_UID, and FINDING_UID columns. The Overview callback filters this in-memory DataFrame by assessment date, account/subscription/project/cluster, region/location/namespace, severity, service, provider, status, category, provider cards, and search text. It then renders status and severity charts, a seven-day security posture line chart, provider summary cards from dashboard/…/cards.py, downloadable CSV/XLSX exports, and collapsible finding rows whose detail pane displays description, resource/finding/check identifiers, risk, notes, provider, remediation text/URL, and scan day.
dashboard/…/compliance.py reads semicolon-delimited compliance CSVs from folder_path_compliance, deriving the selectable framework names from filenames and splitting CIS reports into Level 1 and Level 2 dropdown choices. The Compliance callback reloads the selected CSV files, normalizes provider-specific scope columns (PROJECTID, SUBSCRIPTIONID, SUBSCRIPTION, Kubernetes CONTEXT/NAMESPACE, M365 TENANTID, Oracle TENANCYID, and generic positional columns between DESCRIPTION and ASSESSMENTDATE), filters by account, region, and latest-per-account-per-day assessment date, and then dispatches table rendering by importing dashboard.compliance.<framework>. If that exact renderer module is absent, _dispatch_compliance_renderer falls back to dashboard/…/generic.py; other import/runtime errors are intentionally surfaced. Before rendering, duplicate compliance rows are dropped on CHECKID, STATUS, optional MUTED, RESOURCEID, and STATUSEXTENDED.
The many dashboard/…/*.py files are thin framework adapters: each selects the columns expected for that framework and calls a formatter in dashboard/common_methods.py. Those shared formatters build nested Bootstrap accordions with static Plotly pass/fail bars and innermost dash_table.DataTable rows for CHECKID, STATUS, REGION, ACCOUNTID, and RESOURCEID. dashboard/…/generic.py supports dynamic or unknown compliance schemas by discovering REQUIREMENTS_ATTRIBUTES_* columns at runtime, preferring REQUIREMENTS_ATTRIBUTES_SECTION, and otherwise grouping by the first discovered attribute column or flat by REQUIREMENTS_ID. Prowler ThreatScore has extra handling in dashboard/…/compliance.py to compute pillar score percentages from REQUIREMENTS_ATTRIBUTES_LEVELOFRISK and optional REQUIREMENTS_ATTRIBUTES_WEIGHT, excluding muted findings from score calculations.
Shared UI helpers live under dashboard/lib/: dropdowns.py centralizes the Dash component IDs used by callbacks, layouts.py defines the Overview and Compliance page skeletons, cards.py computes provider-level counts, and startup.py formats the post-bind server URL announcement and suppresses Dash's duplicate pre-bind running line. Styling is asset-driven: dashboard/…/input.css is the Tailwind input for dashboard/table/accordion utilities, dashboard/tailwind.config.js defines the prowler-* color/font/shadow tokens used in class names, dashboard/…/output.css is the built CSS, and dashboard/…/cloud-pages.css contains self-contained sidebar and /cloud/* page styles. Static images under dashboard/assets/images/providers, dashboard/assets/images/icons, and dashboard/assets/images/cloud/screenshots are referenced directly by Dash as /assets/... paths.
Tests under tests/dashboard/ cover the dashboard-specific contracts that tend to regress: startup URL formatting and hook idempotency (tests/…/startup_test.py), Cloud page copy/links/assets/sidebar ordering (tests/…/cloud_pages_test.py), compliance renderer dispatch/dedup behavior (tests/…/compliance_dispatch_test.py), generic compliance rendering (tests/…/generic_test.py), generic scope column normalization (tests/…/scope_columns_test.py), and arbitrary requirement ID rendering in dashboard/common_methods.py (tests/…/common_methods_test.py).
Coupling
- If any Overview CSV column names emitted by Prowler change, update dashboard/…/overview.py and the matching detail row fields in
generate_table; the callback assumes columns such asCHECK_ID,PROVIDER,TIMESTAMP/ASSESSMENT_START_TIME,ACCOUNT_UID/ACCOUNT_ID,SERVICE_NAME,SEVERITY,STATUS, andFINDING_UIDexist after normalization. - If a dropdown ID or component ID changes in dashboard/…/dropdowns.py or dashboard/…/layouts.py, update the callback Inputs/Outputs in dashboard/…/overview.py and dashboard/…/compliance.py in the same change; Dash will fail callback registration or silently stop updating the affected filter/card/table.
- If a new compliance framework filename is introduced without a matching dashboard/…/<framework>.py, verify dashboard/…/generic.py can render its
REQUIREMENTS_ID,STATUS,CHECKID, scope, resource, andREQUIREMENTS_ATTRIBUTES_*columns; unknown schemas fall back to the generic renderer rather than a framework-specific adapter. - If compliance CSV scope columns change for a provider, update
_ensure_scope_columnsand the provider-specific renames in dashboard/…/compliance.py; account and region filters depend on normalizedACCOUNTIDandREGIONbeing present before filtering and rendering. - If dashboard/…/cloud.py feature slugs, routes, or labels change, update the
GATED_GROUPSslugs in dashboard/__main__.py and the asset paths underdashboard/assets/images/icons/cloudordashboard/assets/images/cloud/screenshots; the sidebar indexesCLOUD_FEATURES_BY_SLUGby slug and will raise on a missing key. - If Tailwind class names or Prowler color tokens change in page/layout code, rebuild or update dashboard/…/output.css from dashboard/…/input.css and dashboard/tailwind.config.js; Dash serves the prebuilt assets and will not compile Tailwind at runtime.
Risks
- dashboard/…/overview.py and dashboard/…/compliance.py load CSV data at module import into global
data/csv_files. If scan output files are added, removed, or rewritten after the Dash process starts, the dashboard can show stale results until restart. - dashboard/common_methods.py has both version-aware sorters (
version_tupleused by CIS-style renderers) and the generic lexicographic renderer. If an arbitrary requirement ID such asAC-2(1)is routed into a formatter that callsversion_tuple, rendering can raise while building accordions; tests/…/generic_test.py and tests/…/common_methods_test.py guard the generic path specifically. - dashboard/…/compliance.py filters selected compliance files by substring matching
analytics_input in file. If two framework/provider names overlap in filenames, the callback can concatenate unintended CSVs and display mixed compliance data.