Skip to content

✨ feat: factor private vulnerability reporting into Security-Policy check - #5163

Open
bilaldeveloper4312 wants to merge 4 commits into
ossf:mainfrom
bilaldeveloper4312:feat/private-vuln-reporting
Open

✨ feat: factor private vulnerability reporting into Security-Policy check#5163
bilaldeveloper4312 wants to merge 4 commits into
ossf:mainfrom
bilaldeveloper4312:feat/private-vuln-reporting

Conversation

@bilaldeveloper4312

@bilaldeveloper4312 bilaldeveloper4312 commented Aug 5, 2026

Copy link
Copy Markdown

This PR checks private vulnerability reporting through GitHub's REST API using go-github's Repositories.IsPrivateReportingEnabled and factors the signal into the Security-Policy check evaluation.

It also:

  • returns an explicit unsupported-feature result for non-GitHub clients
  • preserves HEAD-only behavior so current repository settings are not applied to historical scans
  • adds probe coverage for enabled, disabled, and unsupported states
  • updates evaluator tests for the fifth Security-Policy probe
  • updates raw-check mocks for the new client call

Fixes #2465

Verification

go test ./clients/githubrepo -run '^TestIsPrivateVulnerabilityReportingEnabled' -count=1
go test ./probes/securityPolicyEnablesPrivateReporting ./checks/evaluation
go test ./checks/raw -run 'Test_Run|TestSecurityPolicy'
go test ./clients/ossfuzz ./clients/azuredevopsrepo ./clients/githubrepo -run '^$'

The focused tests pass locally with Go 1.25.6. The full clients/githubrepo package reaches an unrelated existing Windows tar-path failure in TestExtractTarball; the focused client coverage above passes.

@bilaldeveloper4312
bilaldeveloper4312 requested a review from a team as a code owner August 5, 2026 12:43
@bilaldeveloper4312
bilaldeveloper4312 requested review from AdamKorcz and justaugustus and removed request for a team August 5, 2026 12:43
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Aug 5, 2026
@bilaldeveloper4312 bilaldeveloper4312 changed the title feat: factor private vulnerability reporting into Security-Policy check ✨ feat: factor private vulnerability reporting into Security-Policy check Aug 5, 2026
@bilaldeveloper4312
bilaldeveloper4312 requested a review from a team as a code owner August 9, 2026 11:14
@bilaldeveloper4312

Copy link
Copy Markdown
Author

Correction pushed in e64afd3: private vulnerability reporting status is exposed by GitHub's REST API, not the GraphQL Repository object. I replaced the GraphQL field with go-github's Repositories.IsPrivateReportingEnabled, preserved the HEAD-only guard for historical scans, and added focused enabled/disabled plus non-HEAD tests.

Verification:

  • go test ./clients/githubrepo -run '^TestIsPrivateVulnerabilityReportingEnabled' -count=1
  • go test ./checks/evaluation -count=1

Both pass locally with Go 1.25.6. The full clients/githubrepo package reaches an unrelated existing Windows tar-path failure in TestExtractTarball; the focused client tests pass.

@bilaldeveloper4312
bilaldeveloper4312 force-pushed the feat/private-vuln-reporting branch from 3a4f048 to 2f878d2 Compare August 11, 2026 15:39
@github-actions

Copy link
Copy Markdown

This pull request has been marked stale because it has been open for 10 days with no activity

@github-actions github-actions Bot added the Stale label Aug 22, 2026
bilaldeveloper4312 and others added 4 commits August 24, 2026 14:43
Signed-off-by: Bilal <designbybilal9@gmail.com>
Signed-off-by: Muhammad Bilal Mukhtar <119035493+bilaldeveloper4312@users.noreply.github.com>
Signed-off-by: Muhammad Bilal Mukhtar <119035493+bilaldeveloper4312@users.noreply.github.com>
Signed-off-by: Muhammad Bilal Mukhtar <119035493+bilaldeveloper4312@users.noreply.github.com>
@bilaldeveloper4312
bilaldeveloper4312 force-pushed the feat/private-vuln-reporting branch from 2f878d2 to fa8d0d4 Compare August 24, 2026 10:53
@github-actions github-actions Bot removed the Stale label Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Factor whether or not private vulnerability reporting is enabled into the scorecard

1 participant