Skip to content

fix(db): add missing tenant_id filter in queries#10722

Merged
jfagoagas merged 4 commits into
masterfrom
missing-tenant-id-filter
Apr 16, 2026
Merged

fix(db): add missing tenant_id filter in queries#10722
jfagoagas merged 4 commits into
masterfrom
missing-tenant-id-filter

Conversation

@jfagoagas
Copy link
Copy Markdown
Member

@jfagoagas jfagoagas commented Apr 16, 2026

Description

Attack Paths: Missing tenant_id filter while getting related findings after scan completes

Checklist

Community Checklist
  • This feature/issue is listed in here or roadmap.prowler.com
  • Is it assigned to me, if not, request it via the issue/feature in here or Prowler Community Slack

SDK/CLI

  • Are there new checks included in this PR? Yes / No
    • If so, do we need to update permissions for the provider? Please review this carefully.

UI

  • All issue/task requirements work as expected on the UI
  • Screenshots/Video of the functionality flow (if applicable) - Mobile (X < 640px)
  • Screenshots/Video of the functionality flow (if applicable) - Table (640px > X < 1024px)
  • Screenshots/Video of the functionality flow (if applicable) - Desktop (X > 1024px)
  • Ensure new entries are added to CHANGELOG.md, if applicable.

API

  • All issue/task requirements work as expected on the API
  • Endpoint response output (if applicable)
  • EXPLAIN ANALYZE output for new/modified queries or indexes (if applicable)
  • Performance test results (if applicable)
  • Any other relevant evidence of the implementation (if applicable)
  • 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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 16, 2026

✅ All necessary CHANGELOG.md files have been updated.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 16, 2026

Conflict Markers Resolved

All conflict markers have been successfully resolved in this pull request.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 16, 2026

🔒 Container Security Scan

Image: prowler-api:961a9d3
Last scan: 2026-04-16 09:45:00 UTC

📊 Vulnerability Summary

Severity Count
🔴 Critical 5
Total 5

4 package(s) affected

⚠️ Action Required

Critical severity vulnerabilities detected. These should be addressed before merging:

  • Review the detailed scan results
  • Update affected packages to patched versions
  • Consider using a different base image if updates are unavailable

📋 Resources:

@jfagoagas jfagoagas added the backport-to-v5.24 Backport PR to the v5.24 branch label Apr 16, 2026
josema-xyz
josema-xyz previously approved these changes Apr 16, 2026
@jfagoagas jfagoagas marked this pull request as ready for review April 16, 2026 09:31
@jfagoagas jfagoagas requested a review from a team as a code owner April 16, 2026 09:31
Copilot AI review requested due to automatic review settings April 16, 2026 09:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a potential cross-tenant data access path in Attack Paths by ensuring findings queries are scoped by tenant_id.

Changes:

  • Add explicit tenant_id filtering when batching findings for a scan in Attack Paths ingestion.
  • Add a changelog entry describing the fix (currently introduces a duplicate version header).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
api/src/backend/tasks/jobs/attack_paths/findings.py Scopes findings batch query by tenant_id in addition to scan_id.
api/CHANGELOG.md Documents the fix, but currently duplicates the 1.25.0 section header.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread api/CHANGELOG.md Outdated
@jfagoagas jfagoagas merged commit 12bf3d5 into master Apr 16, 2026
37 checks passed
@jfagoagas jfagoagas deleted the missing-tenant-id-filter branch April 16, 2026 09:55
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.61%. Comparing base (62f114f) to head (4054d51).
⚠️ Report is 19 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #10722   +/-   ##
=======================================
  Coverage   93.61%   93.61%           
=======================================
  Files         227      227           
  Lines       31899    31899           
=======================================
  Hits        29861    29861           
  Misses       2038     2038           
Flag Coverage Δ
api 93.61% <100.00%> (ø)

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

Components Coverage Δ
prowler ∅ <ø> (∅)
api 93.61% <100.00%> (ø)
🚀 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.

@prowler-bot
Copy link
Copy Markdown
Collaborator

💚 All backports created successfully

Status Branch Result
v5.24

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

@prowler-bot prowler-bot added the was-backported The PR was successfully backported to the target branch label Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-to-v5.24 Backport PR to the v5.24 branch component/api was-backported The PR was successfully backported to the target branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants