Skip to content

Conversation

@Sakeeb91
Copy link
Contributor

@Sakeeb91 Sakeeb91 commented Nov 4, 2025

Closes #9084

Summary

  • add repository_immutable_releases_enabled GitHub repository check that reports PASS/FAIL when immutable releases are enforced
  • extend the repository service to call the /repos/{owner}/{repo}/immutability REST endpoint using existing auth and expose the result on the repository model
  • include descriptive metadata (high severity, remediation guidance) and align the check folder layout with other GitHub repository checks

Implementation Details

  • introduced _get_repository_immutable_releases_status to retrieve the immutability flag, handling 404 (not available) and 403 (insufficient permissions) responses without failing the scan
  • normalized preview API responses via _normalize_immutability_value and _parse_immutability_response, covering both boolean and string states as well as nested payloads
  • updated repository service fixtures plus added PASS/FAIL/unknown tests for the new check to ensure coverage of each outcome

Testing

  • poetry run pytest tests/providers/github/services/repository

@Sakeeb91 Sakeeb91 requested review from a team as code owners November 4, 2025 15:18
@github-actions github-actions bot added community Opened by the Community provider/github Issues/PRs related with the Github provider metadata-review and removed community Opened by the Community labels Nov 4, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2025

Conflict Markers Resolved

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

@andoniaf andoniaf added the community Opened by the Community label Nov 6, 2025
@andoniaf andoniaf self-assigned this Nov 21, 2025
@andoniaf
Copy link
Member

Thanks @Sakeeb91 for the contribution! I'll take a look to this next week 👍

@andoniaf
Copy link
Member

While testing I found an issue. I misswrote the endpoint for the inmutability in the issue description, is not GET /repos/{owner}/{repo}/immutability it is /repos/{owner}/{repo}/immutable-releases.

I took care of it, and now it's working fine:
image

@codecov
Copy link

codecov bot commented Nov 24, 2025

Codecov Report

❌ Patch coverage is 69.44444% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.02%. Comparing base (6e135ab) to head (53245a6).
⚠️ Report is 4 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (6e135ab) and HEAD (53245a6). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (6e135ab) HEAD (53245a6)
api 1 0
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #9162       +/-   ##
===========================================
- Coverage   92.58%   78.02%   -14.56%     
===========================================
  Files         154       30      -124     
  Lines       21271     1065    -20206     
===========================================
- Hits        19693      831    -18862     
+ Misses       1578      234     -1344     
Flag Coverage Δ
api ?
prowler-py3.10-github 78.02% <69.44%> (?)
prowler-py3.11-github 78.02% <69.44%> (?)
prowler-py3.12-github 78.02% <69.44%> (?)
prowler-py3.9-github 78.02% <69.44%> (?)

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

Components Coverage Δ
prowler 78.02% <69.44%> (∅)
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.

andoniaf
andoniaf previously approved these changes Nov 24, 2025
andoniaf
andoniaf previously approved these changes Nov 25, 2025
@andoniaf andoniaf merged commit 59f8dfe into prowler-cloud:master Nov 27, 2025
28 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Opened by the Community metadata-review provider/github Issues/PRs related with the Github provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add GitHub check to ensure repositories have immutable releases enabled

2 participants