Outputs, Reporting, and Muting
Overview
The result pipeline centers on prowler/…/finding.py: Finding.generate_output() turns a provider-specific Check_Report into the normalized Finding model that every renderer and integration consumes. It first applies fill_common_finding_data() from prowler/…/common.py for timestamp, status, muted flag, resource details, resource metadata, and normalized tags, then fills provider-specific account/resource fields for AWS, Azure, GCP, Kubernetes, GitHub, M365, IaC, image, and other providers. It also resolves compliance mappings with get_check_compliance() from prowler/…/compliance_check.py when the check did not already attach check_output.compliance, carries structured Check_Report.raw into Finding.raw, and creates a stable uid from provider, check, account, region, and resource name. API-stored findings are rehydrated through Finding.transform_api_finding(), which rebuilds CheckMetadata, resource tags, and provider fields from database resource rows while caching parsed resource metadata.
Console reporting is split from file rendering. prowler/…/outputs.py prints per-finding verbose lines through report()/stdout_report(), sorting by provider-relevant fields and coloring muted rows orange via set_report_color(). The same file aggregates pass/fail/muted/resource counts and severity buckets in extract_findings_statistics(). prowler/…/summary_table.py renders the final overview table, chooses the audited entity label per provider, counts muted findings separately, and prints the paths for enabled file outputs. prowler/…/banner.py and prowler/…/logger.py shape CLI/log output around scans: banners include static Prowler Cloud hand-off links unless PROWLER_NO_PROMOTIONS disables them, and logging can emit human or JSON-formatted records to stderr/file depending on configuration.
File outputs are subclasses or equivalents of prowler/…/output.py. Output.__init__() optionally transforms findings immediately and opens an append-mode file descriptor via open_file() from prowler/…/utils.py; concrete writers keep _data until batch_write_data_to_file() flushes it. prowler/…/csv.py writes semicolon-delimited rows with flattened lists/dicts and protects spreadsheet consumers by passing every cell through sanitize_csv_value() from prowler/…/utils.py. prowler/…/html.py builds an interactive table, escapes finding fields, strips unsafe non-HTTP(S) links, renders selected markdown safely, writes provider assessment summaries in the header, and can add a static Cloud CTA for OSS CLI reports. prowler/…/asff.py emits AWS Security Finding Format JSON, skipping MANUAL findings and mapping muted findings to ASFF WARNING because Security Hub has no MUTED compliance status. prowler/…/ocsf.py emits OCSF Detection Finding events with resource/cloud/account data, status Suppressed for muted findings, serialized resource metadata, MITRE ATT&CK enrichment loaded from provider compliance catalogs, and a per-provider/account scan UUID. prowler/…/sarif.py targets GitHub Code Scanning and intentionally includes only unmuted FAIL findings, deduplicating rules by check ID and using IaC raw["resource_line_range"] for file regions.
Compliance outputs have two paths. Legacy framework-specific writers inherit ComplianceOutput from prowler/…/compliance_output.py and transform findings into Pydantic row models under framework directories such as prowler/lib/outputs/compliance/cis/ and prowler/lib/outputs/compliance/prowler_threatscore/; legacy console tables are routed by display_compliance_table() in prowler/…/compliance.py to CIS, ENS, MITRE, ThreatScore, generic, or provider-specific table functions. Universal frameworks use process_universal_compliance_frameworks() to create both UniversalComplianceOutput (prowler/…/universal_output.py) and OCSFComplianceOutput (prowler/…/ocsf_compliance.py). These writers are streaming-aware: the first batch emits manual requirements, later batches append only new finding rows, and is_last controls JSON array finalization/file closure. Universal table rendering in prowler/…/universal_table.py supports grouped, split, and weighted-score displays while applying ConfigRequirements overrides before status counting.
Muting is applied before rendering and is represented two ways. prowler/…/mutelist.py loads YAML under the Mutelist key, validates the Accounts -> Checks -> Regions/Resources/Tags/Exceptions schema, and matches findings with regex-like wildcard support. Mutelist.mute_finding() preserves the original status in finding.raw["status"], sets finding.status = Status.MUTED, and sets finding.muted = True; many output paths instead receive findings whose original PASS/FAIL status remains but whose muted flag is true. Reviewers therefore need to check both Finding.status and Finding.muted: console/HTML/OCSF/ASFF/SARIF each interpret the combination differently.
Result enrichment helpers live alongside the formatters. prowler/…/models.py defines data-driven emerging-threat signatures, regex/version constraints, network exposure metadata, and ThreatMatch; prowler/…/catalog.py loads built-in and tenant-supplied signatures, replaces built-ins by ID, limits regex runtime, ranks publisher-verified matches before name-only matches, and formats matches for finding payloads. prowler/…/timeline.py and prowler/…/models.py define the provider-agnostic interface/model for resource event timelines that can be attached or queried by provider implementations. prowler/…/vulnerability_references.py normalizes vulnerability URLs for image/package findings, preferring cve.org or GitHub advisories and stripping Aqua references. prowler/…/utils.py also owns Kingfisher secret scanning helpers, timestamp conversion, file opening, hashing, nested-attribute reads, and ANSI stripping used across output generation.
External result delivery is under prowler/lib/outputs/jira/, prowler/lib/outputs/slack/, and prowler/…/ingestion.py. Jira supports OAuth and Basic Auth, validates domains for the Basic Auth tenant lookup, uses request timeouts, converts markdown to Atlassian Document Format, classifies issue creation into immutable typed outcomes (prowler/…/models.py), can search by delivery-attempt labels for ambiguous sends, and creates issues from findings or grouped finding data. Slack posts an aggregate scan summary from the same statistics keys produced by extract_findings_statistics(), currently with provider identity/logo handling for AWS, GCP, and Azure. OCSF ingestion uploads an OCSF JSON file to the Prowler Cloud ingestion endpoint using an API key, native trust store plus Requests CA roots, no redirects, and JSON:API headers.
Network/output safety helpers are intentionally close to this pipeline. prowler/…/ssrf.py validates outbound URLs/hosts for connection tests, rejecting non-public IPs unless PROWLER_ALLOWED_PRIVATE_NETWORKS allowlists ranges or PROWLER_SKIP_OUTBOUND_HOST_CHECK opts the process out. prowler/…/resource_limit.py does not limit findings directly; it resolves and applies resource-scan limits before checks produce reports, which indirectly bounds output volume without truncating per-resource findings.
Coupling
- If a provider's
Check_Reportfields change, updateFinding.generate_output()in prowler/…/finding.py and the stdout/summary branches in prowler/…/outputs.py and prowler/…/summary_table.py; renderers assume normalizedaccount_uid,region,resource_uid,resource_name,metadata, andcomplianceare already present. - If muting semantics change in prowler/…/mutelist.py, verify prowler/…/asff.py, prowler/…/ocsf.py, prowler/…/sarif.py, prowler/…/html.py, prowler/…/outputs.py, and compliance table/output code. Some paths look at
finding.muted, whilemute_finding()can also changefinding.statustoStatus.MUTED. - If compliance framework JSON/schema fields change, verify
get_check_compliance()in prowler/…/compliance_check.py, legacy model classes under prowler/…/models.py, universal dynamic columns in prowler/…/universal_output.py, universal OCSF attribute filtering in prowler/…/ocsf_compliance.py, and console table grouping in prowler/…/universal_table.py. - If output filenames or mode names change, update prowler/…/summary_table.py and compliance table functions; these print concrete output paths independently of the writer classes.
- If
Finding.rawis reused for new structured data, check SARIF IaC handling in prowler/…/sarif.py, mutelist's original-status preservation in prowler/…/mutelist.py, OCSF unmapped fields in prowler/…/ocsf.py, and tests such as tests/…/finding_test.py. - If resource metadata can contain new non-JSON objects, update both serializers:
OCSF._sanitize_resource_data()in prowler/…/ocsf.py and_sanitize_resource_data()in prowler/…/ocsf_compliance.py. - If Jira delivery semantics change, keep prowler/…/jira.py and immutable result dataclasses in prowler/…/models.py aligned; callers rely on
JiraCreationResult.__bool__()meaning confirmed creation only, not retryable or uncertain delivery. - If outbound destination validation is added to an integration, use prowler/…/ssrf.py consistently and decide whether the CLI or hosted worker owns the SSRF boundary;
PROWLER_SKIP_OUTBOUND_HOST_CHECKdeliberately changes behavior.
Risks
- prowler/…/ocsf.py and prowler/…/ocsf_compliance.py manually stream JSON arrays by writing commas and truncating the last comma. If
close_file/from_cli/is_lastis wrong, the file can remain an unterminated array; tests/…/ocsf_test.py includes an ENOSPC propagation test showing I/O failure here must be visible to callers. - prowler/…/mutelist.py uses regex search after replacing
*with.*for accounts/checks/regions/resources/tags. A broad or malformed pattern can mute more findings than intended; because renderers may suppress muted failures (prowler/…/sarif.py) or downgrade them (prowler/…/asff.py), mutelist changes can hide actionable results. - prowler/…/finding.py constructs
Finding.uidfrom mutable display fields such asresource_nameand provider-specific region/location. Changing that format affects downstream deduplication, OCSFfinding_info.uid, SARIF rule locations, and Jira labels built from finding identity. - prowler/…/html.py loads third-party CSS/JS from CDNs and renders markdown-derived content. It escapes fields and strips unsafe links, but changes to
process_markdown()or_safe_url()can reintroduce scriptable or non-HTTP(S) links into reports.