scorecard/checks
scott hissam 28b116f1a7
Add Additional Details to License Check (#2442)
*  Improved Security Policy Check (#2137)

* Examines and awards points for linked content (URLs / Emails)

* Examines and awards points for hints of disclosure and vulnerability practices

* Examines and awards points for hints of elaboration of timelines

Signed-off-by: Scott Hissam <shissam@gmail.com>

* Repaired Security Policy to correctly use linked content length for evaluation

Signed-off-by: Scott Hissam <shissam@gmail.com>

* gofmt'ed changes

Signed-off-by: Scott Hissam <shissam@gmail.com>

* Repaired the case in the evaluation which was too sensitive to content length over the length of the linked content for urls and emails

Signed-off-by: Scott Hissam <shissam@gmail.com>

* added unit test cases for the new content-based Security Policy checks

Signed-off-by: Scott Hissam <shissam@gmail.com>

* reverted the direct (mistaken) change to checks.md and updated the checks.yaml for generate-docs

Signed-off-by: Scott Hissam <shissam@gmail.com>

*  Improved Security Policy Check (#2137) (revisted based on comments)

* replaced reason strings with log.Info & log.Warn (as seen in --show-details)

* internal assertion check for nil (*pinfo) and empty pfile

* internal switched to FileTypeText over FileTypeSource

* internal implement type SecurityPolicyInformationType/SecurityPolicyInformation revised SecurityPolicyData to support only one file

* revised expected unit-test results and revised unit-test to reflect the new SecurityPolicyData type

Signed-off-by: Scott Hissam <shissam@gmail.com>

* revised the score value based on observation of one *or more* url(s) or one email(s) found; unit tests update accordingly

Signed-off-by: Scott Hissam <shissam@gmail.com>

* revised the score value based on observation of one *or more* url(s) or one email(s) found; unit tests update accordingly

Signed-off-by: Scott Hissam <shissam@gmail.com>

* revised the score value based on observation of one *or more* url(s) or one email(s) found; e2e tests update accordingly

Signed-off-by: Scott Hissam <shissam@gmail.com>

* Addressed PR comments; added telemetry for policy hits in security policy file to track hits by line number

Signed-off-by: Scott Hissam <shissam@gmail.com>

* Resolved merge conflict with checks.yaml

Signed-off-by: Scott Hissam <shissam@gmail.com>

* updated raw results to emit all the raw information for the new security policy check

Signed-off-by: Scott Hissam <shissam@gmail.com>

* Resolved merge conflicts and lint errors with json_raw_results.go

Signed-off-by: Scott Hissam <shissam@gmail.com>

* Addressed review comments to reorganize security policy data struct to support the potential for multiple security policy files.

Signed-off-by: Scott Hissam <shissam@gmail.com>

* Added logic to the security policy to process multiple security policy files only after future improvements to aggregating scoring across such files are designed. For now the security policy behaves as originally designed to stop once one of the expected policy files are found in the repo

Signed-off-by: Scott Hissam <shissam@gmail.com>

* added comments regarding the capacity to support multiple policy files and removed unneeded break statements in the code

Signed-off-by: Scott Hissam <shissam@gmail.com>

* Addressed review comments to remove the dependency on the path in the filename from the code and introduced FileSize to checker.File type and removed the SecurityContentLength which was used to hold that information for the new security policy assessment

Signed-off-by: Scott Hissam <shissam@gmail.com>

* restored reporting full security policy path and filename for policies found in the org level repos

Signed-off-by: Scott Hissam <shissam@gmail.com>

* Resolved conflicts in checks.yaml for documentation

Signed-off-by: Scott Hissam <shissam@gmail.com>

*  CLI for scorecard-attestor (#2309)

* Reorganize

Signed-off-by: Raghav Kaul <raghavkaul@google.com>

* Working commit

Signed-off-by: Raghav Kaul <raghavkaul@google.com>

* Compile with local scorecard; go mod tidy

Signed-off-by: Raghav Kaul <raghavkaul@google.com>

* Add signing code

Heavily borrowed from https://github.com/grafeas/kritis/blob/master/cmd/kritis/signer/main.go

Signed-off-by: Raghav Kaul <raghavkaul@google.com>

* Update deps

* Naming
* Makefile

Signed-off-by: Raghav Kaul <raghavkaul@google.com>

* Edit license, add lint.yml

Signed-off-by: Raghav Kaul <raghavkaul@google.com>

* checks: go mod tidy, license

Signed-off-by: Raghav Kaul <raghavkaul@google.com>

* Address PR comments

* Split into checker/signer files
* Naming convention

Signed-off-by: Raghav Kaul <raghavkaul@google.com>

* License, remove golangci.yml

Signed-off-by: Raghav Kaul <raghavkaul@google.com>

* Address PR comments

* Use cobra

Signed-off-by: Raghav Kaul <raghavkaul@google.com>

* Add tests for root command

Signed-off-by: Raghav Kaul <raghavkaul@google.com>

* Filter out checks that aren't needed for policy evaluation

Signed-off-by: Raghav Kaul <raghavkaul@google.com>

* Add `make` targets for attestor; submit coverage stats

Signed-off-by: Raghav Kaul <raghavkaul@google.com>

* Improvements

* Use sclog instead of glog
* Remove unneeded subcommands
* Formatting

Signed-off-by: Raghav Kaul <raghavkaul@google.com>

* Flags: Make note-name constant and fix messaging

Signed-off-by: Raghav Kaul <raghavkaul@google.com>

* Remove SupportedRequestTypes

Signed-off-by: Raghav Kaul <raghavkaul@google.com>

* go mod tidy

Signed-off-by: Raghav Kaul <raghavkaul@google.com>

* go mod tidy, makefile

Signed-off-by: Raghav Kaul <raghavkaul@google.com>

* Fix GH actions run

Signed-off-by: Raghav Kaul <raghavkaul@google.com>

Signed-off-by: Raghav Kaul <raghavkaul@google.com>
Signed-off-by: Scott Hissam <shissam@gmail.com>

* removed whitespace before stanza for Run attestor e2e

Signed-off-by: Scott Hissam <shissam@gmail.com>

* resolved code review and doc review comments

Signed-off-by: Scott Hissam <shissam@gmail.com>

* repaired the link for the maintainer's guide for supporting the coordinated vulnerability disclosure guidelines

Signed-off-by: Scott Hissam <shissam@gmail.com>

* initial implementation of https://github.com/ossf/scorecard/issues/1369#issuecomment-1304831531 to provide more license details

Signed-off-by: Scott Hissam <shissam@gmail.com>

* draft implementation to provide more information on license details

Signed-off-by: Scott Hissam <shissam@gmail.com>

* repaired a misspelling

Signed-off-by: Scott Hissam <shissam@gmail.com>

* Changed to handle http errors with 404 not found as being a non-error for not being able to find a license

Signed-off-by: Scott Hissam <shissam@gmail.com>

* Return an error status similar to other gitlab checks

Signed-off-by: Scott Hissam <shissam@gmail.com>

* add new raw licenses data

Signed-off-by: Scott Hissam <shissam@gmail.com>

* updated e2e test as new license check generates more info and warn as scores change as license file content is not parsed

Signed-off-by: Scott Hissam <shissam@gmail.com>

* added numerous more test filenames and a shouldFail boolean as some filenames will fail that do not meet checks.md rules

Signed-off-by: Scott Hissam <shissam@gmail.com>

* license check now, primarily, uses the GH API for checking licenses

Signed-off-by: Scott Hissam <shissam@gmail.com>

* updated local checker as new license check generates more info and warn as scores change as license file content is not parsed

Signed-off-by: Scott Hissam <shissam@gmail.com>

* added draft license gradation for scoring, add a map to OSI and FSF licenses, added GH API for retrieving repo license, revamp license filename matching when not using a repo API for detecting license files.

Signed-off-by: Scott Hissam <shissam@gmail.com>

* repaired race condition for case insensitive map, improved regex matching, moved licenses to raw, raw now mimics GH API return values for key, name, etc., updated unit tests and raw results accordingly

Signed-off-by: Scott Hissam <shissam@gmail.com>

* completed disambiguation of SPDX Identifiers and filename extensions, reworked some of the code comments, added map generation to TestLicense, added an additional mutex for the regex group identifier index, removed spurious prints, revised unit test accordingly, updated documentation.

Signed-off-by: Scott Hissam <shissam@gmail.com>

* removed repo Key from LicenseInformation as unneeded, changed attribution constants to be more meaningful, update documentation as necessary for changes

Signed-off-by: Scott Hissam <shissam@gmail.com>

Signed-off-by: Scott Hissam <shissam@gmail.com>
Signed-off-by: Raghav Kaul <raghavkaul@google.com>
Co-authored-by: raghavkaul <8695110+raghavkaul@users.noreply.github.com>
2022-11-28 11:23:18 -08:00
..
evaluation Add Additional Details to License Check (#2442) 2022-11-28 11:23:18 -08:00
fileparser Remove line continuations in all run steps. (#2335) 2022-10-06 15:08:12 -04:00
raw Add Additional Details to License Check (#2442) 2022-11-28 11:23:18 -08:00
testdata Improved Security Policy Check (#2195) 2022-11-04 14:35:44 -07:00
all_checks_test.go Only run allowed checks in different modes (#1579) 2022-02-07 16:49:49 -08:00
all_checks.go Favor SLSA provenance over plain signature in Signed-Release (#2144) 2022-08-12 11:49:32 -07:00
binary_artifact_test.go Commit depth feature (#2407) 2022-11-22 16:11:36 +00:00
binary_artifact.go Binary artifact exception for gradle-wrapper.jar when using validation action (#2039) 2022-07-18 18:42:32 +00:00
branch_protection_test.go Add CODEOWNERS branch protection check (#2057) 2022-08-29 12:57:47 -05:00
branch_protection.go Add raw results to cron scans (#1741) 2022-03-18 19:05:14 -07:00
ci_tests.go 🌱 Split CI-Tests check into a raw and evaluation section (#2291) 2022-09-29 15:03:40 +00:00
cii_best_practices_test.go Raw results for best practices badge (#1795) 2022-04-25 17:04:21 +00:00
cii_best_practices.go 🐛 Ignore shell parsing errors when reporting results (#1878) 2022-05-02 10:11:50 -07:00
code_review_test.go 🌱 Code Review: treat merging a PR as code review (#2413) 2022-11-08 11:09:02 -08:00
code_review.go Add raw results to cron scans (#1741) 2022-03-18 19:05:14 -07:00
contributors_test.go Replace clients.Contributor with clients.User (#1957) 2022-05-31 13:19:14 -07:00
contributors.go Raw results for Contributors check (#1919) 2022-05-18 18:13:10 +00:00
dangerous_workflow.go Raw results for dangerous workflow (#1849) 2022-04-21 22:02:18 +00:00
dependency_update_tool_test.go Add Sonatype Lift as a dependency update tool, doc upgrade (#2328) 2022-10-19 15:33:05 +00:00
dependency_update_tool.go Add raw results to cron scans (#1741) 2022-03-18 19:05:14 -07:00
errors.go Add raw results for Token-Permissions (#1912) 2022-07-15 21:48:50 +00:00
fuzzing_test.go Add Language struct and optimize result parsing for GHClient.ListProgrammingLanguages (#1992) 2022-06-10 12:13:38 -07:00
fuzzing.go Raw results for Fuzzing check (#1917) 2022-05-20 00:55:49 +00:00
license_test.go Add Additional Details to License Check (#2442) 2022-11-28 11:23:18 -08:00
license.go Add Additional Details to License Check (#2442) 2022-11-28 11:23:18 -08:00
maintained_test.go 🌱 Upgrade to go 1.18 (#2143) 2022-08-16 20:55:48 -05:00
maintained.go Raw result for Maintained check (#1780) 2022-03-29 16:35:42 +00:00
packaging.go Raw results for Packaging check (#1913) 2022-06-01 16:41:20 +00:00
permissions_test.go Removed job-level permissions check for actions and packages (#2367) 2022-10-19 01:02:17 -07:00
permissions.go 🐛 Fix remediation text when Scorecard is run multiple times within a program (#2168) 2022-08-17 16:10:49 -05:00
pinned_dependencies.go 🐛 Fix remediation text when Scorecard is run multiple times within a program (#2168) 2022-08-17 16:10:49 -05:00
sast_test.go 🌱 Upgrade to go 1.18 (#2143) 2022-08-16 20:55:48 -05:00
sast.go Optimize SAST check (#2191) 2022-08-26 19:53:48 +00:00
security_policy_test.go Improved Security Policy Check (#2195) 2022-11-04 14:35:44 -07:00
security_policy.go Security-Policy should not run on --local (#1825) 2022-04-07 14:12:22 -05:00
signed_releases_test.go Favor SLSA provenance over plain signature in Signed-Release (#2144) 2022-08-12 11:49:32 -07:00
signed_releases.go Raw results for Signed-Release check (#1789) 2022-04-01 23:13:58 +00:00
vulnerabilities_test.go Separate check from policies for the Vulnerabilities check (#1532) 2022-01-26 15:45:39 -05:00
vulnerabilities.go Add raw results to cron scans (#1741) 2022-03-18 19:05:14 -07:00
webhook_test.go 🌱 Limit access to registered checks (#2134) 2022-08-10 20:11:18 +00:00
webhook.go 🌱 Limit access to registered checks (#2134) 2022-08-10 20:11:18 +00:00
write.md 📖 Minor typos and copy-editing to checks/write.md (#2071) 2022-07-26 19:13:47 +00:00