-
Notifications
You must be signed in to change notification settings - Fork 609
Description
Is your feature request related to a problem? Please describe.
The mere existence of a SECURITY.md file (or other file(s) searched such as .adoc) with 1 or more bytes in the repo rewards the project's score to the fullest possible score (10).
Describe the solution you'd like
Gradate the Security-Policy check which would incrementally improve the Security-Policy score if the SECURITY.md (or found file) contained links to pages or email addresses. That is detecting https:, or mailto:, or some other pattern (perhaps using regex) on the contents of that file. There would be no need to actually determine if the https:, or mailto: actually resolved (DNS) or didn't bounce (SMTP). Perhaps:
no Security-Policy: score 0
one found link content: score += 3
more than one found link content: score += 6
more bytes than the sum of the length of all the link content found: score += 4
the score of 10 here could then assume that around all that link content are intelligible words. for instance:
Sed ut perspiciatis unde omnis iste https://example.com/security or email security@example.com natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni
would score 10 as it has 2 link contents (score = 6) and a length of content (~379) which is greater than the sum of the length of the two link content (48 = strlen of the https (28) + strlen of the email (20)) would be (score = 6 + 4). If the content had no link content, then the final score would be score = 4 or had it only 1 link content, score = 7.
In practice, ossf's own scorecard file would score = 7 (it has one email address and many bytes beyond the length of that email). If ossf's scorecard is intended to be the exemplar, then perhaps another scale could be devised to detect portions of timelines, days, and other disclosure practices - which would require language analysis.
Describe alternatives you've considered
If a score for a project was non-zero, pull the appropriate security-policy file and inspect/parse myself. scorecard already details in the report that "reason": "security policy file detected" but does not display the file/path/name/URI of what was actually detected--therefore, the burden is on the consumer to 'go hunting' (first) then analyze later.
Additional context
The same could be said for the checks License and Signed-Releases as long as the representative file in GitHub is 1 byte or more, the project is award full points. Although checking the validity of Signed-Releases is troublesome, a single byte length file seems too small for any signature. For License, more NLP might be called for, but with further investigation known strings could be searched and recommended for those that want to be scorecard friendly. Such as https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/adding-a-license-to-a-repository or https://opensource.org/licenses