Skip to content

Conversation

HugoPBrito
Copy link
Member

Context

Some changes were needed to match new metadata specification while preserving compatibility with old metadata and output formats.

Description

CSV

  • Add the column at the end of AdditionalURLs
  • Update the tests with the new field format and add AdditionalURLs
  • Replace RelatedURL with the Hub URL

OCSF

  • Update the tests with the new field format
  • detection_finding.remediation.references points to the check URL in Prowler Hub

HTML

  • Update the tests with the new field format

ASFF

  • Update the tests with the new field format and add AdditionalURLs

Steps to review

Execute 2 scans with all output formats (one with old metadata and other with new metadata) and ensure all are generated as expected.

Checklist

API

  • Verify if API specs need to be regenerated.
  • Check if version updates are required (e.g., specs, Poetry, etc.).
  • Ensure new entries are added to CHANGELOG.md, if applicable.

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@HugoPBrito HugoPBrito requested review from a team as code owners September 5, 2025 10:24
@github-actions github-actions bot added output/csv Issues/PRs related with the CSV output format output/ocsf Issues/PRs related with the OCSF output format output/asff Issues/PRs related with the ASFF output format output/html Issues/PRs related with the HTML output format integration/security-hub Issues/PRs related with the AWS Security Hub integration labels Sep 5, 2025
Copy link
Contributor

github-actions bot commented Sep 5, 2025

✅ All necessary CHANGELOG.md files have been updated. Great job! 🎉

Copy link

codecov bot commented Sep 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.60%. Comparing base (1a2bf46) to head (faeb740).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8651      +/-   ##
==========================================
- Coverage   75.75%   75.60%   -0.15%     
==========================================
  Files          72       72              
  Lines        4851     4928      +77     
==========================================
+ Hits         3675     3726      +51     
- Misses       1176     1202      +26     
Flag Coverage Δ
prowler 75.60% <100.00%> (-0.15%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
prowler 75.60% <100.00%> (-0.15%) ⬇️
api ∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

That's great 👏

Out of curiosity, why there are no changes in asff.py and html.py? Probably I'm missing something.

Comment on lines +81 to +83
finding_dict["ADDITIONAL_URLS"] = unroll_list(
finding.metadata.AdditionalURLs
)
Copy link
Member

Choose a reason for hiding this comment

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

This needs to be the very last column, not to break automations reading CSV columns.

@@ -163,6 +159,7 @@ def transform(self, findings: List[Finding]) -> None:
"categories": finding.metadata.Categories,
"depends_on": finding.metadata.DependsOn,
"related_to": finding.metadata.RelatedTo,
"additional_urls": finding.metadata.AdditionalURLs,
Copy link
Member

Choose a reason for hiding this comment

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

Review if the OCSF documentation needs to be updated too.

@@ -14,6 +14,7 @@ All notable changes to the **Prowler SDK** are documented in this file.
- `--excluded-checks-file` flag [(#8301)](https://github.com/prowler-cloud/prowler/pull/8301)

### Changed
- Outputs content for new Metadata fields [(#8651)](https://github.com/prowler-cloud/prowler/pull/8651)
Copy link
Member

Choose a reason for hiding this comment

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

I'd add a new line in Added saying: "Support for AdditionalURLs in outputs"

@@ -36,6 +36,7 @@ def generate_finding_output(
depends_on: list[str] = ["test-dependency"],
related_to: list[str] = ["test-related-to"],
notes: str = "test-notes",
additional_urls: list[str] = ["test-url"],
Copy link
Member

Choose a reason for hiding this comment

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

Add a valid URL, is better then to test and validate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration/security-hub Issues/PRs related with the AWS Security Hub integration output/asff Issues/PRs related with the ASFF output format output/csv Issues/PRs related with the CSV output format output/html Issues/PRs related with the HTML output format output/ocsf Issues/PRs related with the OCSF output format
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants