Skip to content

Commit d1ed1ed

Browse files
chore(sdk): update dependency black to v26 [security] (#11290)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Daniel Barranquero <danielbo2001@gmail.com>
1 parent 0c9f4f6 commit d1ed1ed

9 files changed

Lines changed: 100 additions & 105 deletions

File tree

contrib/inventory-graph/lib/inventory_output.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
from prowler.lib.logger import logger
1717
from lib.models import ConnectivityGraph
1818

19-
2019
# ---------------------------------------------------------------------------
2120
# JSON output
2221
# ---------------------------------------------------------------------------

prowler/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ All notable changes to the **Prowler SDK** are documented in this file.
2323

2424
### 🔐 Security
2525

26+
- `black` from 25.1.0 to 26.3.1, patching a known vulnerability in the SDK formatter dependency [(#11290)](https://github.com/prowler-cloud/prowler/pull/11290)
2627
- `microsoft-kiota-*` to 1.9.9 and `aiohttp` to 3.14.0, patching known CVEs [(#11596)](https://github.com/prowler-cloud/prowler/pull/11596)
2728
- Container base image bumped to `python:3.12.13-slim-bookworm` (patches `libgnutls30` CVE-2026-33845 and CVE-2026-42010) and `trivy` bumped to 0.71.0 (patches embedded `golang.org/x/crypto` and Go stdlib CVEs); `.trivyignore` documents remaining bookworm criticals with no-fix or not-affected rationale [(#11592)](https://github.com/prowler-cloud/prowler/pull/11592)
2829

prowler/lib/banner.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,13 @@ def print_banner(legend: bool = False, provider: str = None):
2828
print_prowler_cloud_banner(provider)
2929

3030
if legend:
31-
print(
32-
f"""
31+
print(f"""
3332
{Style.BRIGHT}Color code for results:{Style.RESET_ALL}
3433
- {Fore.YELLOW}MANUAL (Manual check){Style.RESET_ALL}
3534
- {Fore.GREEN}PASS (Recommended value){Style.RESET_ALL}
3635
- {orange_color}MUTED (Muted by muted list){Style.RESET_ALL}
3736
- {Fore.RED}FAIL (Fix required){Style.RESET_ALL}
38-
"""
39-
)
37+
""")
4038

4139

4240
def print_prowler_cloud_banner(provider: str = None):
@@ -56,8 +54,7 @@ def print_prowler_cloud_banner(provider: str = None):
5654
"""
5755
check = f"{Fore.GREEN}{Style.RESET_ALL}"
5856
bar = f"{banner_color}{Style.RESET_ALL}"
59-
print(
60-
f"""
57+
print(f"""
6158
{bar} {Style.BRIGHT}You're getting a snapshot 📸. Prowler Cloud gives you the full picture:{Style.RESET_ALL}
6259
{bar}
6360
{bar} {check} {Style.BRIGHT}Continuous Security Monitoring{Style.RESET_ALL} - scheduled scans with history, trends and alerts.
@@ -70,5 +67,4 @@ def print_prowler_cloud_banner(provider: str = None):
7067
{bar} {check} {Style.BRIGHT}Integrations{Style.RESET_ALL} - Anything with our MCP + Jira, Slack, AWS Security Hub, Amazon S3, SSO and RBAC.
7168
{bar}
7269
{bar} {Fore.BLUE}Start free at 👉 cloud.prowler.com{Style.RESET_ALL}
73-
"""
74-
)
70+
""")

prowler/lib/outputs/html/html.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ def transform(self, findings: list[Finding]) -> None:
7373
elif finding.status == "FAIL":
7474
row_class = "table-danger"
7575

76-
self._data.append(
77-
f"""
76+
self._data.append(f"""
7877
<tr class="{row_class}">
7978
<td>{finding_status}</td>
8079
<td>{finding.metadata.Severity.value}</td>
@@ -89,8 +88,7 @@ def transform(self, findings: list[Finding]) -> None:
8988
<td><p class="show-read-more">{HTML.process_markdown(finding.metadata.Remediation.Recommendation.Text)}</p> <a class="read-more" href="{finding.metadata.Remediation.Recommendation.Url}"><i class="fas fa-external-link-alt"></i></a></td>
9089
<td><p class="show-read-more">{parse_html_string(unroll_dict(finding.compliance, separator=": "))}</p></td>
9190
</tr>
92-
"""
93-
)
91+
""")
9492
except Exception as error:
9593
logger.error(
9694
f"{error.__class__.__name__}[{error.__traceback__.tb_lineno}]: {error}"
@@ -143,8 +141,7 @@ def write_header(
143141
from_cli (bool): whether the request is from the CLI or not
144142
"""
145143
try:
146-
file_descriptor.write(
147-
f"""<!DOCTYPE html>
144+
file_descriptor.write(f"""<!DOCTYPE html>
148145
<html lang="en">
149146
<head>
150147
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
@@ -253,8 +250,7 @@ def write_header(
253250
<th scope="col">Compliance</th>
254251
</tr>
255252
</thead>
256-
<tbody>"""
257-
)
253+
<tbody>""")
258254
except Exception as error:
259255
logger.error(
260256
f"{error.__class__.__name__}[{error.__traceback__.tb_lineno}] -- {error}"
@@ -269,8 +265,7 @@ def write_footer(file_descriptor: TextIOWrapper) -> None:
269265
file_descriptor (file): the file descriptor to write the footer
270266
"""
271267
try:
272-
file_descriptor.write(
273-
"""
268+
file_descriptor.write("""
274269
</tbody>
275270
</table>
276271
</div>
@@ -409,8 +404,7 @@ def write_footer(file_descriptor: TextIOWrapper) -> None:
409404
</body>
410405
411406
</html>
412-
"""
413-
)
407+
""")
414408
except Exception as error:
415409
logger.error(
416410
f"{error.__class__.__name__}[{error.__traceback__.tb_lineno}] -- {error}"

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ requires = ["hatchling"]
55
[dependency-groups]
66
dev = [
77
"bandit==1.8.3",
8-
"black==25.1.0",
8+
"black==26.3.1",
99
"coverage==7.6.12",
1010
"docker==7.1.0",
1111
"filelock==3.20.3",
@@ -205,7 +205,7 @@ constraint-dependencies = [
205205
"azure-core==1.41.0",
206206
"azure-mgmt-core==1.6.0",
207207
"bandit==1.8.3",
208-
"black==25.1.0",
208+
"black==26.3.1",
209209
"blinker==1.9.0",
210210
"certifi==2026.4.22",
211211
"cffi==2.0.0",
@@ -325,6 +325,7 @@ constraint-dependencies = [
325325
"pytest-env==1.1.5",
326326
"pytest-randomly==3.16.0",
327327
"pytest-xdist==3.6.1",
328+
"pytokens==0.4.1",
328329
"pywin32==311",
329330
"pyyaml==6.0.3",
330331
"referencing==0.36.2",

tests/lib/outputs/outputs_test.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ def test_unroll_list_separator(self):
5151

5252
def test_parse_html_string(self):
5353
string = "CISA: your-systems-3, your-data-1, your-data-2 | CIS-1.4: 2.1.1 | CIS-1.5: 2.1.1 | GDPR: article_32 | AWS-Foundational-Security-Best-Practices: s3 | HIPAA: 164_308_a_1_ii_b, 164_308_a_4_ii_a, 164_312_a_2_iv, 164_312_c_1, 164_312_c_2, 164_312_e_2_ii | GxP-21-CFR-Part-11: 11.10-c, 11.30 | GxP-EU-Annex-11: 7.1-data-storage-damage-protection | NIST-800-171-Revision-2: 3_3_8, 3_5_10, 3_13_11, 3_13_16 | NIST-800-53-Revision-4: sc_28 | NIST-800-53-Revision-5: au_9_3, cm_6_a, cm_9_b, cp_9_d, cp_9_8, pm_11_b, sc_8_3, sc_8_4, sc_13_a, sc_16_1, sc_28_1, si_19_4 | ENS-RD2022: mp.si.2.aws.s3.1 | NIST-CSF-1.1: ds_1 | RBI-Cyber-Security-Framework: annex_i_1_3 | FFIEC: d3-pc-am-b-12 | PCI-3.2.1: s3 | FedRamp-Moderate-Revision-4: sc-13, sc-28 | FedRAMP-Low-Revision-4: sc-13 | KISA-ISMS-P-2023: 2.6.1 | KISA-ISMS-P-2023-korean: 2.6.1"
54-
assert (
55-
parse_html_string(string)
56-
== """
54+
assert parse_html_string(string) == """
5755
&#x2022;CISA: your-systems-3, your-data-1, your-data-2
5856
5957
&#x2022;CIS-1.4: 2.1.1
@@ -94,7 +92,6 @@ def test_parse_html_string(self):
9492
9593
&#x2022;KISA-ISMS-P-2023-korean: 2.6.1
9694
"""
97-
)
9895

9996
def test_unroll_tags(self):
10097
dict_list = [

0 commit comments

Comments
 (0)