Skip to content

Conversation

zohayb23
Copy link
Contributor

@zohayb23 zohayb23 commented Sep 26, 2025

Implements OSPS-VM-04.01 to check if projects publicly publish vulnerability data.

Closes #34

- Add hasPublicVulnerabilityDisclosure function to check for public disclosure mechanisms
- Update OSPS-VM-04.01 assessment steps (IsActive + hasPublicVulnerabilityDisclosure)
- Add comprehensive test coverage with 5 test cases:
  * GitHub security policy enabled
  * Security Insights policy URL present
  * No disclosure mechanisms available
  * Both mechanisms present (GitHub takes priority)
  * Invalid payload handling
- Add stubGraphqlRepoWithSecurityPolicy helper function following existing patterns

Closes revanite-io#34
Copy link

kusari-inspector bot commented Sep 26, 2025

Kusari Inspector

Kusari Analysis Results:

Proceed with these changes

✅ No Flagged Issues Detected
All values appear to be within acceptable risk parameters.

No pinned version dependency changes, code issues or exposed secrets detected!

Note

View full detailed analysis result for more information on the output and the checks that were run.


@kusari-inspector rerun - Trigger a re-analysis of this PR
@kusari-inspector feedback [your message] - Send feedback to our AI and team
See Kusari's documentation for setup and configuration.
Commit: c57b3be, performed at: 2025-10-03T03:01:03Z

Found this helpful? Give it a 👍 or 👎 reaction!

@zohayb23 zohayb23 marked this pull request as ready for review September 26, 2025 21:57
@zohayb23 zohayb23 requested a review from a team as a code owner September 26, 2025 21:57
eddie-knight
eddie-knight previously approved these changes Sep 26, 2025
Comment on lines 74 to 75
if data.Insights.Project.Vulnerability.SecurityPolicy != "" {
return layer4.Passed, "Public vulnerability disclosure available via security policy in Security Insights data"
Copy link
Contributor

Choose a reason for hiding this comment

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

Roughly the same question as above... just having a security policy doesn't necessarily mean that the project is publicly publishing data about discovered vulnerabilities.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I see. I didn't realize that. I'm thinking about changing the message to be more accurate. WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

If you have a plan to demonstrate whether a project is "publicly publishing data about discovered vulnerabilities," then press on. I haven't put thought into measuring that, so I don't have much specific input at the moment.

Copy link
Contributor

Choose a reason for hiding this comment

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

@zohayb23 zohayb23 marked this pull request as draft September 27, 2025 18:23
Copy link

Kusari PR Analysis rerun based on - 92cf8b0 performed at: 2025-09-30T20:14:50Z - link to updated analysis

…curity Advisories API

- Replace security policy check with published security advisories check
- Add SecurityAdvisory struct and REST API integration in rest-data.go
- Update hasPublicVulnerabilityDisclosure to count published advisories
- Add comprehensive tests for all scenarios (0, 1, multiple advisories)
- Addresses Eddie's feedback about checking actual public disclosure evidence
Copy link

Kusari PR Analysis rerun based on - 434cdee performed at: 2025-09-30T21:49:03Z - link to updated analysis

@zohayb23 zohayb23 marked this pull request as ready for review September 30, 2025 21:51
… reference

- Change data.RestData.SecurityAdvisories to data.SecurityAdvisories
- Fixes golangci-lint staticcheck QF1008 error
- RestData is embedded in Payload struct, so direct access is possible
Copy link

Kusari PR Analysis rerun based on - daf8479 performed at: 2025-09-30T21:54:46Z - link to updated analysis

return layer4.Passed, fmt.Sprintf("Found %d published security advisories", advisoryCount)
}

return layer4.Failed, "No published security advisories found"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible that advisory publishing is active/enabled but that no advisories have been published?

That is probably a passing condition for this requirement

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@trumant Do you suggest I implement a check to see if advisory publishing is active/enabled prior to checking if advisories have been published?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes

@zohayb23 zohayb23 marked this pull request as draft October 1, 2025 20:16
- Added function to check if security advisory publishing is enabled
- Uses SecurityAdvisories != nil to detect feature availability
- Added comprehensive test coverage with HTTP mocking
- Positioned SecurityAdvisory struct below RestData per code review

Signed-off-by: Zohayb Bhatti <[email protected]>
Copy link

Kusari PR Analysis rerun based on - c57b3be performed at: 2025-10-03T03:01:03Z - link to updated analysis

@zohayb23 zohayb23 marked this pull request as ready for review October 3, 2025 15:21
@zohayb23 zohayb23 marked this pull request as draft October 6, 2025 15:17
@zohayb23 zohayb23 self-assigned this Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement OSPS-VM-04
3 participants