You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
📖 Clarifications about the pinned dependencies check (#2319)
* Clarifications about the pinned dependencies check
The pinned dependencies check is confusing to authors of libraries,
who shouldn't be pinning the dependencies of the library. But it is
still valuable for flagging things which are used as part of
the build and release process for a library.
Signed-off-by: Jeremy Katz <jeremy@tidelift.com>
* Regenerate docs/checks.md
Signed-off-by: Jeremy Katz <jeremy@tidelift.com>
Signed-off-by: Jeremy Katz <jeremy@tidelift.com>
This check tries to determine if the project pins its dependencies.
441
+
This check tries to determine if the project pins dependencies used during its build and release process.
442
442
A "pinned dependency" is a dependency that is explicitly set to a specific hash instead of
443
443
allowing a mutable version or range of versions. It
444
444
is currently limited to repositories hosted on GitHub, and does not support
445
445
other source hosting repositories (i.e., Forges).
446
446
447
-
The check works by looking for unpinned dependencies in Dockerfiles, shell scripts and GitHub workflows.
447
+
The check works by looking for unpinned dependencies in Dockerfiles, shell scripts, and GitHub workflows
448
+
which are used during the build and release process of a project.
448
449
449
450
Pinned dependencies reduce several security risks:
450
451
@@ -464,7 +465,6 @@ However, pinning dependencies can inhibit software updates, either because of a
464
465
security vulnerability or because the pinned version is compromised. Mitigate
465
466
this risk by:
466
467
467
-
-[having applications and _not_ libraries pin to specific hashes](https://jbeckwith.com/2019/12/18/package-lock/);
468
468
- using automated tools to notify applications when their dependencies are
469
469
outdated;
470
470
- quickly updating applications that do pin dependencies.
@@ -474,11 +474,10 @@ dependencies using the [GitHub dependency graph](https://docs.github.com/en/code
474
474
475
475
476
476
**Remediation steps**
477
-
- First determine if your project is producing a library or application. If it is a library, you generally don't want to pin dependencies of library users, and should not follow any remediation steps.
478
477
- If your project is producing an application, declare all your dependencies with specific versions in your package format file (e.g. `package.json` for npm, `requirements.txt` for python). For C/C++, check in the code from a trusted source and add a `README` on the specific version used (and the archive SHA hashes).
479
-
- If the package manager supports lock files (e.g. `package-lock.json` for npm), make sure to check these in the source code as well. These files maintain signatures for the entire dependency tree and saves from future exploitation in case the package is compromised.
480
-
- For Dockerfiles, pin dependencies by hash. See [Dockerfile](https://github.com/ossf/scorecard/blob/main/cron/internal/worker/Dockerfile) for example. If you are using a manifest list to support builds across multiple architectures, you can pin to the manifest list hash instead of a single image hash. You can use a tool like [crane](https://github.com/google/go-containerregistry/blob/main/cmd/crane/README.md) to obtain the hash of the manifest list like in this [example](https://github.com/ossf/scorecard/issues/1773#issuecomment-1076699039).
481
-
- For GitHub workflows, pin dependencies by hash. See [main.yaml](https://github.com/ossf/scorecard/blob/f55b86d6627cc3717e3a0395e03305e81b9a09be/.github/workflows/main.yml#L27) for example. To determine the permissions needed for your workflows, you may use [StepSecurity's online tool](https://app.stepsecurity.io/) by ticking the "Pin actions to a full length commit SHA". You may also tick the "Restrict permissions for GITHUB_TOKEN" to fix issues found by the Token-Permissions check.
478
+
- If your project is producing an application and the package manager supports lock files (e.g. `package-lock.json` for npm), make sure to check these in the source code as well. These files maintain signatures for the entire dependency tree and saves from future exploitation in case the package is compromised.
479
+
- For Dockerfiles used in building and releasing your project, pin dependencies by hash. See [Dockerfile](https://github.com/ossf/scorecard/blob/main/cron/internal/worker/Dockerfile) for example. If you are using a manifest list to support builds across multiple architectures, you can pin to the manifest list hash instead of a single image hash. You can use a tool like [crane](https://github.com/google/go-containerregistry/blob/main/cmd/crane/README.md) to obtain the hash of the manifest list like in this [example](https://github.com/ossf/scorecard/issues/1773#issuecomment-1076699039).
480
+
- For GitHub workflows used in building and releasing your project, pin dependencies by hash. See [main.yaml](https://github.com/ossf/scorecard/blob/f55b86d6627cc3717e3a0395e03305e81b9a09be/.github/workflows/main.yml#L27) for example. To determine the permissions needed for your workflows, you may use [StepSecurity's online tool](https://app.stepsecurity.io/) by ticking the "Pin actions to a full length commit SHA". You may also tick the "Restrict permissions for GITHUB_TOKEN" to fix issues found by the Token-Permissions check.
482
481
- To help update your dependencies after pinning them, use tools such as
This check tries to determine if the project pins its dependencies.
454
+
This check tries to determine if the project pins dependencies used during its build and release process.
455
455
A "pinned dependency" is a dependency that is explicitly set to a specific hash instead of
456
456
allowing a mutable version or range of versions. It
457
457
is currently limited to repositories hosted on GitHub, and does not support
458
458
other source hosting repositories (i.e., Forges).
459
459
460
-
The check works by looking for unpinned dependencies in Dockerfiles, shell scripts and GitHub workflows.
460
+
The check works by looking for unpinned dependencies in Dockerfiles, shell scripts, and GitHub workflows
461
+
which are used during the build and release process of a project.
461
462
462
463
Pinned dependencies reduce several security risks:
463
464
@@ -477,35 +478,30 @@ checks:
477
478
security vulnerability or because the pinned version is compromised. Mitigate
478
479
this risk by:
479
480
480
-
- [having applications and _not_ libraries pin to specific hashes](https://jbeckwith.com/2019/12/18/package-lock/);
481
481
- using automated tools to notify applications when their dependencies are
482
482
outdated;
483
483
- quickly updating applications that do pin dependencies.
484
484
485
485
For projects hosted on GitHub, you can learn more about
486
486
dependencies using the [GitHub dependency graph](https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-the-dependency-graph).
487
487
remediation:
488
-
- >-
489
-
First determine if your project is producing a library or
490
-
application. If it is a library, you generally don't want to pin dependencies of
491
-
library users, and should not follow any remediation steps.
492
488
- >-
493
489
If your project is producing an application, declare all your dependencies with specific versions in your package
494
490
format file (e.g. `package.json` for npm, `requirements.txt` for python).
495
491
For C/C++, check in the code from a trusted source and add a `README` on the
496
492
specific version used (and the archive SHA hashes).
497
493
- >-
498
-
If the package manager supports lock files (e.g. `package-lock.json` for
494
+
If your project is producing an application and the package manager supports lock files (e.g. `package-lock.json` for
499
495
npm), make sure to check these in the source code as well. These files
500
496
maintain signatures for the entire dependency tree and saves from future
501
497
exploitation in case the package is compromised.
502
498
- >-
503
-
For Dockerfiles, pin dependencies by hash. See [Dockerfile](https://github.com/ossf/scorecard/blob/main/cron/internal/worker/Dockerfile) for example. If you are using a manifest list to support builds
499
+
For Dockerfiles used in building and releasing your project, pin dependencies by hash. See [Dockerfile](https://github.com/ossf/scorecard/blob/main/cron/internal/worker/Dockerfile) for example. If you are using a manifest list to support builds
504
500
across multiple architectures, you can pin to the manifest list hash instead
505
501
of a single image hash. You can use a tool like [crane](https://github.com/google/go-containerregistry/blob/main/cmd/crane/README.md)
506
502
to obtain the hash of the manifest list like in this [example](https://github.com/ossf/scorecard/issues/1773#issuecomment-1076699039).
507
503
- >-
508
-
For GitHub workflows, pin dependencies by hash. See [main.yaml](https://github.com/ossf/scorecard/blob/f55b86d6627cc3717e3a0395e03305e81b9a09be/.github/workflows/main.yml#L27) for example.
504
+
For GitHub workflows used in building and releasing your project, pin dependencies by hash. See [main.yaml](https://github.com/ossf/scorecard/blob/f55b86d6627cc3717e3a0395e03305e81b9a09be/.github/workflows/main.yml#L27) for example.
509
505
To determine the permissions needed for your workflows, you may use [StepSecurity's online tool](https://app.stepsecurity.io/) by ticking
510
506
the "Pin actions to a full length commit SHA". You may also tick the "Restrict permissions for GITHUB_TOKEN" to fix issues found
0 commit comments