Commit Graph

417 Commits

Author SHA1 Message Date
Azeem Shaikh
696553be2d
Fix linter issues (#1472)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2022-01-12 20:34:16 +00:00
Azeem Shaikh
f2c57d2590 Migrate to v4 2022-01-12 14:12:09 -06:00
laurentsimon
531561c8f4
npm install-test support (#1468) 2022-01-12 11:34:19 +11:00
naveen
ad5ffab313 Unit tests for CI_Tests
Implemented Unit tests for CI_Tests

Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
2022-01-11 13:31:58 -06:00
laurentsimon
993e9c1010
update msg (#1457) 2022-01-10 22:22:39 +00:00
naveen
d2a14e0f2b 🌱 Unit tests for contributors
Implemented unit tests for contributors.
2022-01-10 11:24:05 -06:00
naveen
911463714b Unit tests github_workflow 2022-01-10 08:29:29 -06:00
naveen
bb42878e63 Unit test for security policy
Unit tests for security policy
2022-01-09 23:09:22 -06:00
naveen
b5d34a6489 Unit tests for listing file
Included tests for listing.go
2022-01-07 18:19:07 -06:00
Naveen
93e05a4e3d
Unit test for maintained check (#1449)
Included unit tests for maintained check.

Co-authored-by: laurentsimon <64505099+laurentsimon@users.noreply.github.com>
2022-01-07 23:49:34 +00:00
laurentsimon
87a2d09822
🐛 Remove inconclusive result from SAST (#1447)
* remove inconclusive

* fix comment
2022-01-07 15:22:49 -08:00
Naveen
192ae4d18f
Unit tests for signed releases (#1446)
Implemented tests for signed releases.
2022-01-06 16:49:06 -08:00
laurentsimon
165d4b562f
Update messages for pinning warning (#1440)
* update msg

* update msg
2022-01-06 18:03:42 +00:00
naveen
cc4b52b0d8 Included test for OSV Vulnerabilities 2022-01-06 10:21:18 -06:00
laurentsimon
7a91384f8d
Add line numbers for insecure downloads (#1413)
* add lines for docker files

* support for other constructs

* other insecure patterns

* fixes

* fixes

* comments
2022-01-06 00:13:53 +00:00
naveen
de39061cc5 🌱 Refactor vulnerabilities client 2022-01-04 13:55:58 -06:00
naveen
c8f15a495e 🌱 Refactor the osv check into a interface
Refactor the osv check into a interface for that it can be tested.
2022-01-04 13:55:58 -06:00
laurentsimon
0e20950839
fix (#1419) 2021-12-24 01:16:10 +00:00
laurentsimon
70fa923907
info to debug (#1416) 2021-12-23 17:27:40 -06:00
laurentsimon
cf71c9539c
Add details to message for default location in SARIF (#1414)
* add details to message

* fix
2021-12-23 19:06:02 +00:00
laurentsimon
6f21258131
reduce score by 1 (#1404) 2021-12-21 17:28:31 +00:00
laurentsimon
df3d50df76
🐛 Fix score calculation for multiple files (#1401)
* multi file support

* fix multi-files permissions

* change name

* add tests

* use struct for files

* comments

* comment
2021-12-16 23:16:02 +00:00
laurentsimon
3d9b1d2900
[RAW] Branch Protection support (#1396)
* raw bp

* missing files

* context never nil

* support raw bp

* unit tests

* remove comments

* merging

* linter
2021-12-16 21:42:05 +00:00
laurentsimon
f2cee41ca9
[RAW]: dependency update tool (#1391)
* dependency update tool

* rename

* missing files

* add fields

* rm field
2021-12-15 17:02:31 +00:00
laurentsimon
46e94eb925
[DRAFT: RAW]: Security policy support (#1372)
* raw sec policy

* missing file

* fix validation of check.yml

* updates

* comments

* dea code

* comments
2021-12-14 23:51:42 +00:00
laurentsimon
551961718d
[RAW] End-to-end support for raw results for Binary-Artifacts (#1255)
* split binary artifact check

* fix

* missing file

* comments

* fix

* comments

* draft

* merge fix

* fix merge

* add indirection

* comments

* comments

* linter

* comments

* updates

* updates

* updates

* linter

* comments
2021-12-14 21:10:24 +00:00
Chris McGehee
f991fee32d
Adding line numbers for rest of Token-Permessions (and by extension, (#1381)
Packaging)
2021-12-14 04:14:35 +00:00
asraa
cfa1593e1c
Add Script Injection to Dangerous-Workflow (#1368)
* add dangerous workflow pattern script injection

Signed-off-by: Asra Ali <asraa@google.com>

* add more tests

Signed-off-by: Asra Ali <asraa@google.com>

* update laurent comments

Signed-off-by: Asra Ali <asraa@google.com>
2021-12-09 13:53:55 -08:00
Evgeny Vereshchagin
75bcc333de
CI-Tests: look for test-related strings in target urls as well (#1374)
Apparently some projects like systemd and bcc put links (containing
the word "Jenkins") to their Jenkins instances in target urls.

https://buildbot.iovisor.org/jenkins/job/bcc-pr/1157/
https://jenkins-systemd.apps.ocp.ci.centos.org/job/upstream-vagrant-archlinux-sanitizers/8288/

It's a follow-up to https://github.com/ossf/scorecard/pull/1293#issuecomment-976384882

Co-authored-by: laurentsimon <64505099+laurentsimon@users.noreply.github.com>
2021-12-08 17:34:28 +00:00
Evgeny Vereshchagin
01ebb0dcf3
Pinned-Dependencies: show where exactly parsing fails (#1297)
Looks like due to https://github.com/mvdan/sh/issues/636
scorecard can't parse comments quoted with backticks like
```
cmd -a \
    -b `# withouth backticks -c below would be a separate command` \
    -c
```
and fails with something like
```
error parsing shell code: 82:26: reached EOF without closing quote `
```

This PR turns that message into
```
error parsing shell code: vagrant/bootstrap_scripts/arch-sanitizers-clang.sh: 82:26: reached EOF without closing quote `
```
which is a bit more useful.

Co-authored-by: laurentsimon <64505099+laurentsimon@users.noreply.github.com>
2021-12-08 01:52:08 +00:00
laurentsimon
6e013cf67d
Token-Permission: Allow top level permissions not defined if all run level permissions are (#1356)
* doc

* allow non defined top level

* fix

* e2e fix

* linter
2021-12-08 01:18:28 +00:00
Evgeny Vereshchagin
2e391503e4
Code-Review: show PRs merged without code review (#1375)
to make it easier to figure out whether those PRs are really merged
without code review or whether there is a bug in scorecard like
https://github.com/ossf/scorecard/issues/1260 that prevents it
from finding reviewed PRs. Other than that, the "CI-Tests" check
already show "untested" PRs so it seems the "Code-Review" check
should follow suit.
2021-12-07 16:47:29 -08:00
Evgeny Vereshchagin
5043cbcc7c
CI-Tests: no longer fail if there are no check suites (#1335)
In PRs like https://github.com/iovisor/bcc/pull/3626 no checks suites
are triggered:
```
$ curl --silent  -H "Accept: application/vnd.github.v3+json"   3fcf0f1b58/check-runs
{
  "total_count": 0,
  "check_runs": [

  ]
}
```
```
 curl --silent  -H "Accept: application/vnd.github.v3+json"   3fcf0f1b58/check-suites
{
  "total_count": 0,
  "check_suites": [

  ]
}
```
The check should just keep going because "statuses" still can be
triggered so it should use them instead:
```

Closes https://github.com/ossf/scorecard/issues/1285

Co-authored-by: laurentsimon <64505099+laurentsimon@users.noreply.github.com>
Co-authored-by: Azeem Shaikh <azeemshaikh38@gmail.com>
2021-12-07 03:27:59 +00:00
laurentsimon
1aac7aa39c
update log msg for non-pinned actions (#1370) 2021-12-06 19:33:27 -06:00
laurentsimon
063d384b6d
move dir (#1367) 2021-12-06 17:57:02 +00:00
laurentsimon
023eab671e
Ignore local actions that are not pinned (#1357)
* ignore local actions

* missing files
2021-12-06 16:36:42 +00:00
Chris McGehee
38b5199e9e
🐛 Adding line numbers to token-permissions and a couple other places (#1363)
* Adding line numbers to token-permissions and a couple other places

* Fix deadlink for security policy

Signed-off-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>
Co-authored-by: Furkan Türkal <furkan.turkal@trendyol.com>

* Updating formatting

Co-authored-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>
Co-authored-by: Furkan Türkal <furkan.turkal@trendyol.com>
2021-12-06 10:05:52 -06:00
laurentsimon
b323cded04
🐛 checks.yml not sync'ed with checks.md (#1360)
* update docs

* update

* remove file

* remove  improper commit

* fix
2021-12-04 08:56:50 -06:00
laurentsimon
afe55a83c1
🐛 Disable pinning lock file search in repo (#1315)
* fix

* linter

* linter

* linter

* comment
2021-12-04 00:44:09 +00:00
Evgeny Vereshchagin
9f7e682fe6
CI-Check: add SemaphoreCI and Packit-as-a-Service (#1293)
to make it more likely for some projects to pass the check

https://semaphoreci.com/
https://github.com/marketplace/packit-as-a-service

Co-authored-by: Naveen <172697+naveensrinivasan@users.noreply.github.com>
Co-authored-by: laurentsimon <64505099+laurentsimon@users.noreply.github.com>
2021-12-03 23:33:01 +00:00
laurentsimon
aed511670f
Cleanup Branch Protection and add e2e tests (#1344)
* BP cleanup

* linnter

* e2e fix

* linter

* linter

Co-authored-by: asraa <asraa@google.com>
2021-12-03 21:53:18 +00:00
Nanik
45b5a35020
Add new checking for license file availability (#1178)
* Add checking logic inside license_check.go
    * Add test case license_check_test.go
    * Add check information inside checks.yaml
2021-12-03 09:28:27 -08:00
laurentsimon
c3c017bf6f
npm ci only (#1314) 2021-12-03 01:37:18 +00:00
laurentsimon
938c637ee0
rem audio files (#1300)
Co-authored-by: Naveen <172697+naveensrinivasan@users.noreply.github.com>
Co-authored-by: Azeem Shaikh <azeemshaikh38@gmail.com>
2021-12-03 00:54:06 +00:00
Arnaud J Le Hors
83ea9bf653
Fix faulty shell file handling (#1312)
Parsing errors are meant to be discarded but aren't. This patch
changes the code so that the error is indeed discarded and checking
continues as intended and adds a unit test for it.

Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>

Co-authored-by: Azeem Shaikh <azeemshaikh38@gmail.com>
2021-12-01 16:46:00 +00:00
laurentsimon
2d6bf97dd8
fix (#1331) 2021-12-01 14:43:25 +00:00
laurentsimon
736f2e2922
Allow pip install with --require-hashes only (#1313)
* allow --require-hashes only

* comment

* rem log

* comment

* att test

* Update checks/shell_download_validate.go

Co-authored-by: Dustin Ingram <di@users.noreply.github.com>

* Update checks/shell_download_validate.go

Co-authored-by: Dustin Ingram <di@users.noreply.github.com>

* Update checks/shell_download_validate.go

Co-authored-by: Oliver Chang <oliverchang@users.noreply.github.com>

* Update checks/shell_download_validate.go

Co-authored-by: Dustin Ingram <di@users.noreply.github.com>

* Update checks/shell_download_validate.go

Co-authored-by: Dustin Ingram <di@users.noreply.github.com>

* Update checks/shell_download_validate.go

Co-authored-by: Dustin Ingram <di@users.noreply.github.com>

* comments

Co-authored-by: Dustin Ingram <di@users.noreply.github.com>
Co-authored-by: Oliver Chang <oliverchang@users.noreply.github.com>
2021-11-23 00:02:56 +00:00
asraa
fd67ddf1c4
🌱 update dangerous workflow to use actionlint (#1328)
* update dangerous workflow to use actionlint

Signed-off-by: Asra Ali <asraa@google.com>

* fix nilptr

Signed-off-by: Asra Ali <asraa@google.com>

Co-authored-by: Azeem Shaikh <azeemshaikh38@gmail.com>
2021-11-22 18:32:27 +00:00
Chris McGehee
9b600bdc69
Skip pinned dependencies check for template Dockerfiles (#1324)
Co-authored-by: Azeem Shaikh <azeemshaikh38@gmail.com>
2021-11-22 16:16:03 +00:00
Chris McGehee
2d8ec84be4
Get OSes from matrix.include if present (#1323) 2021-11-22 15:40:17 +00:00
laurentsimon
fd8731481f
Update score for branch protection with levels (#1287)
* draft

* draft2

* fix

* fix

* fix

* test

* linter

* comments

* comment

* update doc

* comments
2021-11-20 01:42:21 +00:00
Evgeny Vereshchagin
9d2976592f
Signed-Releases: really look for *.sign files (#1298)
With this patch applied projects like dracut pass the check:
```
  "checks": [
    {
      "details": [
        "Debug: GitHub release found: 055",
        "Info: signed release artifact: dracut-055.tar.sign: https://api.github.com/repos/dracutdevs/dracut/releases/assets/37635937",
        "Debug: GitHub release found: 054",
        "Info: signed release artifact: dracut-054.tar.sign: https://api.github.com/repos/dracutdevs/dracut/releases/assets/36958052",
        "Debug: GitHub release found: 053",
        "Info: signed release artifact: dracut-053.tar.sign: https://api.github.com/repos/dracutdevs/dracut/releases/assets/32484038",
        "Debug: GitHub release found: 052",
        "Info: signed release artifact: dracut-052.tar.sign: https://api.github.com/repos/dracutdevs/dracut/releases/assets/32130796",
        "Debug: GitHub release found: 051",
        "Info: signed release artifact: dracut-051.tar.sign: https://api.github.com/repos/dracutdevs/dracut/releases/assets/31933850"
      ],
      "score": 10,
      "reason": "5 out of 5 artifacts are signed -- score normalized to 10",
      "name": "Signed-Releases",
```
2021-11-20 00:55:08 +00:00
asraa
730076fab1
🐛 fix dangerous workflow test and workflow parsing (#1283)
* fix dangerous workflow

Signed-off-by: Asra Ali <asraa@google.com>

* check if removing label comment fixes

Signed-off-by: Asra Ali <asraa@google.com>

Co-authored-by: Azeem Shaikh <azeemshaikh38@gmail.com>
2021-11-20 00:16:02 +00:00
Azeem Shaikh
e15e7b1ca5
More nilptr issues (#1296)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-11-18 05:27:06 +00:00
Azeem Shaikh
8fae5b10bd
Fix more nil-ptr dereferences (#1295)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-11-17 20:00:40 +00:00
Azeem Shaikh
2375ae2812
Add a OssFuzzRepoClient (#1280)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-11-17 03:04:37 +00:00
Azeem Shaikh
0b32cc3138
Fix broken e2e tests (#1291)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-11-17 02:41:25 +00:00
Evgeny Vereshchagin
0bd575641d
Binary-Artifacts: no longer complain about ".bin" files (#1288)
Those files most likely contain binary data used by tests for
example. It should be safe to remove this because executables
disguised as ".bin" files will still be caught and flagged by scorecard
before it even have a chance to look at extensions.

It should address https://github.com/ossf/scorecard/issues/1256
2021-11-17 01:08:25 +00:00
laurentsimon
cc4949465b
[Check split]: Binary-Artifacts (#1244)
* split binary artifact check

* fix

* missing file

* comments

* linter

* fix

* comments

* linter
2021-11-16 19:57:14 +00:00
Chris McGehee
4bd24b8291
Including line number: Dockerfile FROM not pinned (#1258)
Co-authored-by: laurentsimon <64505099+laurentsimon@users.noreply.github.com>
2021-11-16 18:28:51 +00:00
laurentsimon
86835fcfd6
🐛 Fix branch protection results (#1252)
* fix

* fix

* doc

* fix

* comment

* update tests

* fix

* fixes

* fix

* disable tests temp

* score change

* fix

* comments

* docs
2021-11-16 17:27:27 +00:00
laurentsimon
4502dfb557
Reduce false positives in Token-Permissions for contents permission (#1253)
* fix

* tests
2021-11-16 03:03:54 +00:00
laurentsimon
63e3b92466
fix (#1277) 2021-11-15 21:42:25 +00:00
asraa
1050b1cd60
Add dangerous workflow check with untrusted code checkout pattern (#1168)
* add dangerous workflow check with untrusted code checkout pattern

Signed-off-by: Asra Ali <asraa@google.com>

* update

Signed-off-by: Asra Ali <asraa@google.com>

* add env var

Signed-off-by: Asra Ali <asraa@google.com>

* fix comment

Signed-off-by: Asra Ali <asraa@google.com>

* add repos git checks.yaml

Signed-off-by: Asra Ali <asraa@google.com>

* update checks.md

Signed-off-by: Asra Ali <asraa@google.com>

* address comments

Signed-off-by: Asra Ali <asraa@google.com>

* fix merge

Signed-off-by: Asra Ali <asraa@google.com>

* add delete

Signed-off-by: Asra Ali <asraa@google.com>

* update docs

Signed-off-by: Asra Ali <asraa@google.com>

Co-authored-by: Naveen <172697+naveensrinivasan@users.noreply.github.com>
2021-11-15 20:18:10 +00:00
Azeem Shaikh
4dde356329
Fix nil-ptr dereference (#1269)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-11-15 17:54:27 +00:00
Azeem Shaikh
6223b6620a
Add CIIClient interface (#1262)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-11-15 02:46:41 +00:00
Evgeny Vereshchagin
d4904555b4
CI-Test: stop assuming either "statuses" or "check runs" are used (#1259)
Projects with a lot of different CI services use both and the check
should take that into account so as not to report that PRs
like https://github.com/systemd/systemd/pull/21329
with 28 successful, 4 failing, and 2 neutral checks were merged
without any tests.

Without this patch `scorecard` says that 5 out 30 PRs were merged
without running tests:
```
        "Debug: CI test found: pr: 21299, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 472a52d22b",
        "Debug: CI test found: pr: 21300, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): cf35602cbc",
        "Debug: CI test found: pr: 21301, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 13b7b8bd73",
        "Debug: CI test found: pr: 21302, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): dfa4876c41",
        "Debug: CI test found: pr: 21304, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 01f6c450b6",
        "Debug: CI test found: pr: 21305, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 547f97d571",
        "Debug: CI test found: pr: 21310, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 0078bbb232",
        "Debug: CI test found: pr: 21312, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): df8a8240d3",
        "Debug: merged PR without CI test: 21313",
        "Debug: CI test found: pr: 21314, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): a942a27840",
        "Debug: CI test found: pr: 21316, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 3fec0e6cbf",
        "Debug: CI test found: pr: 21318, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): db4f0788c5",
        "Debug: CI test found: pr: 21320, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 875afa02fa",
        "Debug: CI test found: pr: 21321, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): a55277b889",
        "Debug: CI test found: pr: 21324, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): b9df4a2b20",
        "Debug: merged PR without CI test: 21325",
        "Debug: CI test found: pr: 21327, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 44ddfb922f",
        "Debug: CI test found: pr: 21328, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 5e034d4d32",
        "Debug: merged PR without CI test: 21329",
        "Debug: CI test found: pr: 21330, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 4df52c20f4",
        "Debug: CI test found: pr: 21331, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 5dd57a00d5",
        "Debug: merged PR without CI test: 21332",
        "Debug: CI test found: pr: 21333, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): e0c311b1aa",
        "Debug: CI test found: pr: 21334, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 55caae6a78",
        "Debug: CI test found: pr: 21335, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): f1d467af25",
        "Debug: merged PR without CI test: 21337",
        "Debug: CI test found: pr: 21341, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 17f8d8f9b4",
        "Debug: CI test found: pr: 21342, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 38ac3ab10a",
        "Debug: CI test found: pr: 21347, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 4f8c9645df",
        "Debug: CI test found: pr: 21349, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 502e2b4b9e"
```
With this patch:
```
        "Debug: CI test found: pr: 21299, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 472a52d22b",
        "Debug: CI test found: pr: 21300, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): cf35602cbc",
        "Debug: CI test found: pr: 21301, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 13b7b8bd73",
        "Debug: CI test found: pr: 21302, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): dfa4876c41",
        "Debug: CI test found: pr: 21304, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 01f6c450b6",
        "Debug: CI test found: pr: 21305, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 547f97d571",
        "Debug: CI test found: pr: 21310, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 0078bbb232",
        "Debug: CI test found: pr: 21312, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): df8a8240d3",
        "Debug: CI test found: pr: 21313, context: github-actions: https://api.github.com/repos/systemd/systemd/check-runs/4191612395",
        "Debug: CI test found: pr: 21314, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): a942a27840",
        "Debug: CI test found: pr: 21316, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 3fec0e6cbf",
        "Debug: CI test found: pr: 21318, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): db4f0788c5",
        "Debug: CI test found: pr: 21320, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 875afa02fa",
        "Debug: CI test found: pr: 21321, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): a55277b889",
        "Debug: CI test found: pr: 21324, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): b9df4a2b20",
        "Debug: CI test found: pr: 21325, context: github-actions: https://api.github.com/repos/systemd/systemd/check-runs/4191237494",
        "Debug: CI test found: pr: 21327, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 44ddfb922f",
        "Debug: CI test found: pr: 21328, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 5e034d4d32",
        "Debug: CI test found: pr: 21329, context: github-actions: https://api.github.com/repos/systemd/systemd/check-runs/4192198481",
        "Debug: CI test found: pr: 21330, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 4df52c20f4",
        "Debug: CI test found: pr: 21331, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 5dd57a00d5",
        "Debug: CI test found: pr: 21332, context: github-actions: https://api.github.com/repos/systemd/systemd/check-runs/4192365458",
        "Debug: CI test found: pr: 21333, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): e0c311b1aa",
        "Debug: CI test found: pr: 21334, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 55caae6a78",
        "Debug: CI test found: pr: 21335, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): f1d467af25",
        "Debug: CI test found: pr: 21337, context: github-actions: https://api.github.com/repos/systemd/systemd/check-runs/4197451714",
        "Debug: CI test found: pr: 21341, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 17f8d8f9b4",
        "Debug: CI test found: pr: 21342, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 38ac3ab10a",
        "Debug: CI test found: pr: 21347, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 4f8c9645df",
        "Debug: CI test found: pr: 21349, context: ci/semaphoreci/pr: Debian autopkgtest (LXC): 502e2b4b9e"
```

Co-authored-by: Naveen <172697+naveensrinivasan@users.noreply.github.com>
2021-11-14 16:03:18 -08:00
Azeem Shaikh
51de6b6e5d
Check for issue activity in Maintained (#1251)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-11-12 22:16:22 +00:00
Eng Zer Jun
177502552a
🌱 Move from io/ioutil to io and os packages (#1250)
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.

Signed-off-by: Eng Zer Jun <zerjun@eta-hd.com>

Co-authored-by: laurentsimon <64505099+laurentsimon@users.noreply.github.com>
2021-11-12 19:34:46 +00:00
Azeem Shaikh
c8d2a51375
Ignore nil values in Branch-Protection check (#1243)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-11-12 19:11:06 +00:00
Azeem Shaikh
ab2bb205d4
Fix nil-ptr access bug (#1248)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-11-12 16:51:41 +00:00
Evgeny Vereshchagin
46611eac5d Security-Policy: really look for the security policy
It was tested with the systemd project where the security policy
is kept in docs/SECURITY.md. Without this patch `scorecard`
says that the security policy can't be found.
2021-11-11 10:08:27 -06:00
laurentsimon
795505fd7f
Remove isScorecardRepo (#1236)
* remove isScorecardRepo

* linter

* linter

Co-authored-by: Naveen <172697+naveensrinivasan@users.noreply.github.com>
2021-11-10 20:13:12 +00:00
Evgeny Vereshchagin
5524c9717b
SAST: no longer skip "neutral" checks (#1237)
Some SASTs like LGTM don't analyze PRs where code hasn't been changed,
which leads to their status being "neutral" there.

It's a follow up to https://github.com/ossf/scorecard/pull/1232#issuecomment-965552702

I'm not sure what to do about one-offs like the one
mentioned in https://github.com/ossf/scorecard/pull/1232#issuecomment-965585962
that shouldn't affect the aggregate score but it can probably
be fixed later.
2021-11-10 19:49:02 +00:00
Evgeny Vereshchagin
6a2fb2edc2
Add LGTM to the SAST check (#1232)
According to https://github.com/apps/lgtm-com
"LGTM is a code analysis platform for identifying vulnerabilities early and preventing
them from reaching production". It's used by `systemd`, `lxc` and a lot of other large
open source projects. The check is
still kind of broken in the sense that it fails to detect
projects where every PR is analyzed by LGTM before getting merged
but it's better than nothing I guess.

Co-authored-by: Naveen <172697+naveensrinivasan@users.noreply.github.com>
2021-11-10 10:09:11 -08:00
Chris McGehee
3dc507b9e1 Using library to parse github workflows 2021-11-08 17:00:40 -06:00
Chris McGehee
f319aca82d Moving github worflow parsing to its own file 2021-11-08 17:00:40 -06:00
Chris McGehee
2006be1819 🐛 Token permission check was failing on non-yaml files 2021-11-04 06:19:10 -05:00
Oliver Chang
d3796f29b1
Add ClusterFuzzLite to Fuzzing check. (#1166)
* Add ClusterFuzzLite to Fuzzing check.

Check for the existence of ".clusterfuzzlite/Dockerfile".

Fixes #1148.

* comment

Co-authored-by: Naveen <172697+naveensrinivasan@users.noreply.github.com>
2021-10-29 22:33:17 -07:00
Azeem Shaikh
c73c5628ea
Fix GitHub workflows failing (#1172)
Co-authored-by: Azeem Shaikh <azeems@google.com>
Co-authored-by: laurentsimon <64505099+laurentsimon@users.noreply.github.com>
2021-10-28 18:42:55 +00:00
laurentsimon
4cca9b4960
Implement local repo client for local folders (#1146)
* draft

* draft

* docker file

* error

* fix

* fix

* bug

* comments

* missing merge

* fix

* merge issue

* fix

* validate format early

* comments

* fix

* fixes

* uncomment

* gate code for v4 code

* draft

* draft 2

* fix security-policy check

* fix

* merge fixes

* fixes

* fixes

* fixes

* fixes

* mock repo

* linter

* comments

* unit tests

* comments
2021-10-28 18:30:02 +00:00
Azeem Shaikh
0ba864e9c2
Avoid panic in code (#1171)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-10-27 12:24:02 -07:00
Chris McGehee
faab6969d6 Improve formatting, readability 2021-10-25 17:36:37 -05:00
Chris McGehee
c13783a040 🐛 Fixing parsing for Github workflow when matrix is an expression 2021-10-25 17:36:37 -05:00
naveen
54f1429eaa 🌱 Fixed typo administrator
Fixed typo administrator.
2021-10-23 16:29:32 -05:00
laurentsimon
950e0e3d2d
Add support for file-based repo URIs (#1113)
* draft

* draft

* docker file

* error

* fix

* fix

* fixa

* bug

* comments

* missing merge

* fix

* fix rebase

* merge issue

* fix

* validate format early

* fix

* fix2

* comments

* fix
2021-10-21 20:08:56 +00:00
Azeem Shaikh
96140f9646
Add exponential backoff to CII badge check (#1147)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-10-20 18:13:17 +00:00
Azeem Shaikh
b8eba248ac
Improve logging messages (#1140)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-10-18 15:08:15 -07:00
Chris McGehee
cf9399aad4
🐛 Fixing parsing errors for github workflows (#1131) 2021-10-14 08:16:22 -07:00
Naveen
6c1c789dc5
🌱 v3 upgrade changes (#1118)
v3 go.mod changes
2021-10-07 18:16:01 -05:00
Read Sprabery
98f77eea5b
Detect unverified installs of npm packages (#1043)
Co-authored-by: Naveen <172697+naveensrinivasan@users.noreply.github.com>
2021-09-30 19:40:04 +00:00
laurentsimon
7e73875acb
update msg (#1086) 2021-09-29 00:39:04 +00:00
olivekl
47319e2841
Update write.md (#1084)
Fix broken link: errors/errors.md 
Replace checks/frozen_deps.go with checks/pinned_dependencies.go

Co-authored-by: Azeem Shaikh <azeemshaikh38@gmail.com>
2021-09-28 20:41:47 +00:00
Azeem Shaikh
00741115ae
Fix CodeReview bug (#1058)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-09-24 03:56:50 +00:00
laurentsimon
0686ed2ba0
🐛 Fix invalid code review (#1055)
* fix bug

* fix

* comments

* fix

* fixes
2021-09-23 21:17:32 +00:00
laurentsimon
b9daae1c0c
🐛 Update message for Code-Review (#1054)
* update msg

* fix
2021-09-22 21:09:44 +00:00
Chris McGehee
90332a9cb9
🌱 Add counting of shell parsing errors (#1026)
* Add counting of shell parsing errors

* Use existing CheckErrors metric instead

Co-authored-by: Azeem Shaikh <azeemshaikh38@gmail.com>
2021-09-22 14:46:29 +00:00
naveen
e1a6e7dcad 📖 Fixed the docs for dependabot 2021-09-16 10:25:31 -05:00
naveen
9e81b5f25e 📖 Fixed the dependabot check message
Fixed the dependabot warning message.
https://github.com/ossf/scorecard/issues/1028
2021-09-16 10:08:51 -05:00
laurentsimon
b0fab3fa43
code (#1006)
Co-authored-by: Naveen <172697+naveensrinivasan@users.noreply.github.com>
2021-09-13 16:35:50 +00:00
Nanik
0590b03338
change message to make it more easier for user (#1003)
to understand.

* reword the message

* add test for testing the mssage
2021-09-13 07:33:40 -07:00
Azeem Shaikh
bc37c74b28
Remove Owner/Repo strings from CheckRequest (#997)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-09-10 10:13:14 -07:00
Azeem Shaikh
e730e911e6
sce.Create -> sce.WithMessage for wrapcheck (#995)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-09-10 15:50:33 +00:00
Nanik
1da121da29
Give low importance to github-owned actions (#802) (#906)
* Different calculation between github and non-github actions

* Add test case for different kind of github and non-github action

* Modify existing test as score calculation has changed
2021-09-09 12:16:31 -07:00
Chris McGehee
1c7ba79435
🐛 Github workflow steps run on Windows should default to pwsh as its shell (#877)
* Github workflow steps run on Windows should default to pwsh as its shell

* Style change from PR feedback

* Fixing linter error

* MR feedback: simplifying code

* Moving consts to top of file

Co-authored-by: laurentsimon <64505099+laurentsimon@users.noreply.github.com>
Co-authored-by: Azeem Shaikh <azeemshaikh38@gmail.com>
Co-authored-by: Naveen <172697+naveensrinivasan@users.noreply.github.com>
2021-09-07 09:09:20 -07:00
neil465
5476b878bd
Removed unnecessary linters (#969)
* gomnd
* prealloc
* dupl
2021-09-07 10:45:12 -04:00
Chris McGehee
29b7bd3885 Parsing GitHub Workflows should only happen on yaml files 2021-09-06 10:51:33 -05:00
Azeem Shaikh
afe5b40567
Make RepoClient as default interface for Scorecard (#951)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-09-02 02:32:26 +00:00
Azeem Shaikh
eceb577b84
Add and use RepoClient API for ListStatuses (#949)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-09-01 18:34:58 +00:00
Azeem Shaikh
eb2b3b2185
Add RepoClient API for ListCheckRunsForRef (#948)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-09-01 17:43:53 +00:00
Azeem Shaikh
99b9c91570
Use RepoClient API for Packaging check (#940)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-09-01 01:05:34 +00:00
Azeem Shaikh
d6ba2cd6ac
Fix #890 (#938)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-08-30 20:26:11 -07:00
Azeem Shaikh
e305a94e4f
Use ListReleases API for BranchProtection check (#937)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-08-30 17:52:08 -07:00
Azeem Shaikh
9a1978a051
Use RefUpdateRule in BranchProtection check (#936)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-08-30 23:14:42 +00:00
Azeem Shaikh
d9f5209803
Update test utils (#933)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-08-30 14:12:57 -07:00
Chris McGehee
dbb23450e5
Add line number to unpinned dependency: GitHub workflow "uses" field (#821)
* Display line number for github workflow "uses" field

* Adding test for line numbers

* Updating comment

* Updating this log message to use SARIF format

Co-authored-by: laurentsimon <64505099+laurentsimon@users.noreply.github.com>
2021-08-30 17:03:45 +00:00
Azeem Shaikh
37696aceb3
Create and use MockRepoClient in unit tests (#922)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-08-26 19:48:39 +00:00
laurentsimon
9eb7929ebc
🐛 Address friction logs' comments (#899)
* fixes

* fix

* fix

* fixes

* doc

* missing file

* fixes

* comments

* typo
2021-08-25 21:02:23 +00:00
Azeem Shaikh
2d65ab4f0c
Remove ErrRepoUnavailable (#908)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-08-25 09:33:59 -07:00
Azeem Shaikh
8cf95c46e4
Use singleton pattern for OSS-Fuzz (#902)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-08-25 03:28:49 +00:00
Azeem Shaikh
41d0ce38c4
Replace errors.As with Is (#901)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-08-25 01:03:45 +00:00
Azeem Shaikh
46a655d405
Fixes for Branch Protection (#900)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-08-25 00:04:17 +00:00
laurentsimon
6403eb1382
Transition Packaging, SAST, Security-policy, Signed-releases check to the new structured detail format (#887)
* move checks to new format

* fix

* comments

* fix

* comments
2021-08-24 01:44:06 +00:00
laurentsimon
b731f450b9
Transition Vulnerabilities, Permissions, CI-Tests, Dependency-Update-Tool, Code-Reviews to structured details (#889)
* move other checks togit add -u

* more checks

* fixes
2021-08-24 00:54:22 +00:00
laurentsimon
d1de6cf513
support v3 (#883) 2021-08-23 18:48:29 +00:00
Chris McGehee
c54d77b0d7
🐛 Only validate shell scripts supported by our parser (#862)
* Only validate shell scripts supported by our parser

* Updating tests, code quality

Co-authored-by: Abhishek Arya <inferno@chromium.org>
2021-08-19 08:18:45 -07:00
Azeem Shaikh
13ef9dd7e0
Use RepoClient.Search API in SAST check (#857)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-08-16 17:34:10 +00:00
laurentsimon
b3a3f7e217
SARIF 2: add short description to checks.yml (#848)
* short desc

* validate new field

* typos

* comments

* fixed
2021-08-16 15:42:55 +00:00
Azeem Shaikh
42ee430332
Use RepoClient API for Fuzzing (#855)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-08-14 00:34:40 +00:00
Azeem Shaikh
8baaaa4cf8
Use RepoClient API for Contributors check (#854)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-08-13 18:13:43 +00:00
Azeem Shaikh
b7ddc9ac93
Update go-github version for consistency (#852)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-08-13 00:43:22 +00:00
Azeem Shaikh
d4701c4a4e
Delete Signed-Tags check from Scorecard (#851)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-08-12 22:26:50 +00:00
Azeem Shaikh
3f9431d08c
Update SignedReleases to use RepoClient API (#844)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-08-12 20:46:06 +00:00
asraa
cc312f2d1d
feature: branch protection without admin token (#823)
* branch protection without admin permission

Signed-off-by: Asra Ali <asraa@google.com>

* handle other errors

Signed-off-by: Asra Ali <asraa@google.com>

* fix lint

Signed-off-by: Asra Ali <asraa@google.com>

Co-authored-by: Naveen <172697+naveensrinivasan@users.noreply.github.com>
2021-08-12 15:54:28 +00:00
Azeem Shaikh
eeb563be10
Update SAST and CITest with Repoclient API (#842)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-08-12 08:27:48 +10:00
Mark J. Cox
20370f782a
🐛 Look for organisation default .github security.md files in all the locations they are allowed to be in (#837)
* The default community health files for an organisation can be in one of
three places, but the current check only looked in one of them. Expand
the check to all three places as per
https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/creating-a-default-community-health-file

This fixes scorecards failing to pick up the default Apache policy
https://github.com/apache/.github/blob/main/.github/SECURITY.md

Signed-off-by: Mark J. Cox <mark@awe.com>

* Wrap don't use a long line

* Follow the hint in the failure and run "gofmt -s" on it
2021-08-11 10:53:04 -07:00
laurentsimon
d821ea27ec
improve token permission (#811)
* sarif action

* update
2021-08-05 17:10:34 +00:00
laurentsimon
e4f3ede843
fix/enhance pinned-dependencies (#806)
* commit

* e2e tests

* typo
2021-08-03 23:32:34 +00:00
laurentsimon
b2b37161f3
Improve token permission check (#800)
* draft

* draft 2

* draft3

* fix e2e

* comment

* comment

* check codeql

* missing files

* comments

* nit

* update msg

* msg

* nit

* nit

* msg

* e2e

* update doc
2021-08-03 00:56:45 +00:00
Azeem Shaikh
30bb11965a
Update Packaging check to use new APIs (#796)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-08-02 17:17:38 +00:00
laurentsimon
1bee125ab3
fix message (#798) 2021-08-02 16:00:22 +00:00
Azeem Shaikh
6368c25f54
More linter issues (#794)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-08-01 03:42:14 +00:00
Azeem Shaikh
83e9f52501
Enable revive linters which are used in google3 (#793)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-07-31 22:31:34 +00:00
laurentsimon
29594d4294
change signature of FileIfExist and FileContent (#787)
* draft

* add pinning

* remove functions

* typo

* commment

* name
2021-07-30 15:09:52 +00:00
laurentsimon
b35cbdcdcf
Make Branch-Protection score more granular (#777)
* commit

* uni tests

* full score

* typos

* update msg

* remove function

* comments

* linter

* comments
2021-07-30 01:54:19 +00:00
laurentsimon
c48fe4f9ed
Make Token-Permission check more granular (#773)
* draft

* add tests

* add e2e2 tests

* typos

* typo

* fixes

* linter

* use named value

* comments

* comment
2021-07-30 00:13:01 +00:00
Azeem Shaikh
1d1e799f84
Add ListCommits and IsArchived API (#772)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-07-29 14:18:58 -07:00
Azeem Shaikh
1e6d99eb20
Remove PullRequest check (#771)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-07-29 20:58:36 +00:00
Azeem Shaikh
59e14eef80
Add validation for checks.yaml (#781)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-07-29 20:29:12 +00:00
Azeem Shaikh
df89767c35
Fix bug in SecurityPolicy (#761)
Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-07-29 20:09:56 +00:00