Skip to content

Commit 6dbed17

Browse files
Merge branch 'main' into lift-depupdatetool
2 parents b11042c + 2f504b7 commit 6dbed17

File tree

13 files changed

+64
-48
lines changed

13 files changed

+64
-48
lines changed

Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM golang@sha256:ea3d912d500b1ae0a691b2e53eb8a6345b579d42d7e6a64acca83d274b949740 AS base
15+
# golang:1.19
16+
FROM golang@sha256:25de7b6b28219279a409961158c547aadd0960cf2dcbc533780224afa1157fd4 AS base
1617
WORKDIR /src
1718
ENV CGO_ENABLED=0
1819
COPY go.* ./

checks/evaluation/permissions.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -242,21 +242,21 @@ func calculateScore(result map[string]permissions) int {
242242
// contents.
243243
// Allows attacker to commit unreviewed code.
244244
// High risk: -10
245-
if permissionIsPresent(perms, "contents") {
245+
if permissionIsPresentInTopLevel(perms, "contents") {
246246
score -= checker.MaxResultScore
247247
}
248248

249249
// packages: https://docs.github.com/en/packages/learn-github-packages/about-permissions-for-github-packages.
250250
// Allows attacker to publish packages.
251251
// High risk: -10
252-
if permissionIsPresent(perms, "packages") {
252+
if permissionIsPresentInTopLevel(perms, "packages") {
253253
score -= checker.MaxResultScore
254254
}
255255

256256
// actions.
257257
// May allow an attacker to steal GitHub secrets by approving to run an action that needs approval.
258258
// High risk: -10
259-
if permissionIsPresent(perms, "actions") {
259+
if permissionIsPresentInTopLevel(perms, "actions") {
260260
score -= checker.MaxResultScore
261261
}
262262

checks/permissions_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func TestGithubTokenPermissions(t *testing.T) {
6464
filenames: []string{"./testdata/.github/workflows/github-workflow-permissions-run-writes-2.yaml"},
6565
expected: scut.TestReturn{
6666
Error: nil,
67-
Score: checker.MinResultScore,
67+
Score: checker.MaxResultScore,
6868
NumberOfWarn: 3,
6969
NumberOfInfo: 2,
7070
NumberOfDebug: 4,
@@ -86,7 +86,7 @@ func TestGithubTokenPermissions(t *testing.T) {
8686
filenames: []string{"./testdata/.github/workflows/github-workflow-permissions-run-package-write.yaml"},
8787
expected: scut.TestReturn{
8888
Error: nil,
89-
Score: checker.MinResultScore,
89+
Score: checker.MaxResultScore,
9090
NumberOfWarn: 1,
9191
NumberOfInfo: 1,
9292
NumberOfDebug: 4,
@@ -251,7 +251,7 @@ func TestGithubTokenPermissions(t *testing.T) {
251251
filenames: []string{"./testdata/.github/workflows/github-workflow-permissions-contents-writes-no-release.yaml"},
252252
expected: scut.TestReturn{
253253
Error: nil,
254-
Score: checker.MinResultScore,
254+
Score: checker.MaxResultScore,
255255
NumberOfWarn: 1,
256256
NumberOfInfo: 1,
257257
NumberOfDebug: 4,

cron/internal/bq/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM golang@sha256:ea3d912d500b1ae0a691b2e53eb8a6345b579d42d7e6a64acca83d274b949740 AS base
15+
# golang:1.19
16+
FROM golang@sha256:25de7b6b28219279a409961158c547aadd0960cf2dcbc533780224afa1157fd4 AS base
1617
WORKDIR /src
1718
ENV CGO_ENABLED=0
1819
COPY go.* ./

cron/internal/cii/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM golang@sha256:ea3d912d500b1ae0a691b2e53eb8a6345b579d42d7e6a64acca83d274b949740 AS base
15+
# golang:1.19
16+
FROM golang@sha256:25de7b6b28219279a409961158c547aadd0960cf2dcbc533780224afa1157fd4 AS base
1617
WORKDIR /src
1718
ENV CGO_ENABLED=0
1819
COPY go.* ./

cron/internal/controller/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM golang@sha256:ea3d912d500b1ae0a691b2e53eb8a6345b579d42d7e6a64acca83d274b949740 AS base
15+
# golang:1.19
16+
FROM golang@sha256:25de7b6b28219279a409961158c547aadd0960cf2dcbc533780224afa1157fd4 AS base
1617
WORKDIR /src
1718
ENV CGO_ENABLED=0
1819
COPY go.* ./

cron/internal/webhook/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM golang@sha256:ea3d912d500b1ae0a691b2e53eb8a6345b579d42d7e6a64acca83d274b949740 AS base
15+
# golang:1.19
16+
FROM golang@sha256:25de7b6b28219279a409961158c547aadd0960cf2dcbc533780224afa1157fd4 AS base
1617
WORKDIR /src
1718
ENV CGO_ENABLED=0
1819
COPY go.* ./

cron/internal/worker/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM golang@sha256:ea3d912d500b1ae0a691b2e53eb8a6345b579d42d7e6a64acca83d274b949740 AS base
15+
# golang:1.19
16+
FROM golang@sha256:25de7b6b28219279a409961158c547aadd0960cf2dcbc533780224afa1157fd4 AS base
1617
WORKDIR /src
1718
ENV CGO_ENABLED=0
1819
COPY go.* ./

cron/k8s/controller.release.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ spec:
5555
args: ["--config=/etc/scorecard/config.yaml", "cron/internal/data/projects.release.csv"]
5656
imagePullPolicy: Always
5757
env:
58+
- name: GOMEMLIMIT
59+
value: "950MiB"
5860
- name: SCORECARD_REQUEST_TOPIC_URL
5961
value: "gcppubsub://projects/openssf/topics/scorecard-batch-requests-releasetest"
6062
- name: SCORECARD_DATA_BUCKET_URL

cron/k8s/controller.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ spec:
5454
image: gcr.io/openssf/scorecard-batch-controller:stable
5555
args: ["--config=/etc/scorecard/config.yaml", "cron/internal/data/projects.csv"]
5656
imagePullPolicy: Always
57+
env:
58+
- name: GOMEMLIMIT
59+
value: "950MiB"
5760
resources:
5861
limits:
5962
memory: 1Gi

docs/faq.md

+38-33
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,77 @@
11
# Frequently Asked Questions
22

3-
This page answers frequently asked questions about Scorecards, including its purpose, usage, and checks. This page is continually updated. If you would like to add a question, please [contribute]!(../CONTRIBUTING.md)!
3+
This page answers frequently asked questions about Scorecards, including its purpose, usage, and checks. This page is continually updated. If you would like to add a question, please [contribute](../CONTRIBUTING.md)!
44

55
## Installation / Usage
66
- [Can I preview my project's score?](#can-i-preview-my-projects-score)
7-
- [What is the difference between Scorecard and other Code Scanning Tools?](#what-is-the-difference-between-scorecard-and-other-code-scanning-tools)
7+
- [What is the difference between Scorecards and other Code Scanning tools?](#what-is-the-difference-between-scorecards-and-other-code-scanning-tools)
88

99
## Check-Specific Questions
10-
- [Binary-Artifacts: Is it possible to set up a blocklist to check Binary-Artifacts?](#binary-artifacts-is-it-possible-to-set-up-a-blocklist-to-check-binary-artifacts)
11-
- [Code-Review: Can I set Code-Review check to ignore bot commits?](#code-review-can-i-set-code-review-check-to-ignore-bot-commits)
12-
- [Fuzzing: Scorecard accepts custom fuzzers and libfuzzer?](#fuzzing-scorecard-accepts-custom-fuzzers-and-libfuzzer)
13-
- [Pinned-Dependencies: Will the scorecard see not-pinned dependencies in tests with Dockerfiles?](#pinned-dependencies-will-the-scorecard-see-not-pinned-dependencies-in-tests-with-dockerfiles)
10+
- [Binary-Artifacts: Can I allowlist testing artifacts?](#binary-artifacts-can-i-allowlist-testing-artifacts)
11+
- [Code-Review: Can it ignore bot commits?](#code-review-can-it-ignore-bot-commits)
12+
- [Fuzzing: Does Scorecards accept custom fuzzers?](#fuzzing-does-scorecards-accept-custom-fuzzers)
13+
- [Pinned-Dependencies: Will Scorecards detect unpinned dependencies in tests with Dockerfiles?](#pinned-dependencies-will-scorecards-detect-unpinned-dependencies-in-tests-with-dockerfiles)
1414
- [Pinned-Dependencies: Can I use version pinning instead of hash pinning?](#pinned-dependencies-can-i-use-version-pinning-instead-of-hash-pinning)
15-
- [Signed-Releases: Why would I sign releases?](#signed-releases-why-would-i-sign-releases)
15+
- [Signed-Releases: Why sign releases?](#signed-releases-why-sign-releases)
1616

17-
________________________________________________________________________________
18-
________________________________________________________________________________
17+
---
1918

2019
## Installation / Usage
2120

2221
### Can I preview my project's score?
2322

24-
Yes, a preview of the Scorecard scores can be seen at https://api.securityscorecards.dev/projects/github.com/<username_or_org>/<repository_name>/ for the repositories tracked by the Scorecard Project for being considered relevant in the Open Source scenario.
23+
Yes.
24+
25+
Over a million projects are automatically tracked by the Scorecards project. These projects' scores can be seen at https://api.securityscorecards.dev/projects/github.com/<username_or_org>/<repository_name>.
2526

2627
You can also use the CLI to generate scores for any public repository by following these steps:
2728

28-
1. [Installation](https://github.com/joycebrum/scorecard#installation)
29-
1. [Authentication](https://github.com/joycebrum/scorecard#authentication)
30-
1. [Basic Usage](https://github.com/joycebrum/scorecard#basic-usage)
29+
1. [Installation](https://github.com/ossf/scorecard#installation)
30+
2. [Authentication](https://github.com/ossf/scorecard#authentication)
31+
3. [Basic Usage](https://github.com/ossf/scorecard#basic-usage)
3132

32-
### What is the difference between Scorecard and other Code Scanning Tools?
33+
### What is the difference between Scorecards and other Code Scanning tools?
3334

34-
Usually, the code scanning tools are focused on one or two specific types of vulnerabilities, while the Scorecard's Checks are focused on the overall security posture of the project. That's because the Scorecard is related to the Security Best Practices and whether the project is following them or not.
35+
Most code scanning tools are focused on detecting specific vulnerabilities already existing in your codebase. Scorecards, however, is focused on improving the project's overall security posture by helping it adopt best practices. The best solution for your project may well be to adopt Scorecards along with other tools!
3536

36-
## Check-Specific Questions
37+
## Check-specific Questions
3738

38-
### Binary-Artifacts: Is it possible to set up a blocklist to check Binary-Artifacts?
39+
### Binary-Artifacts: Can I allowlist testing artifacts?
3940

40-
It is still not possible to do that. However, the Scorecard team is working on this feature in the issue [ossf/scorecard#1270](https://github.com/ossf/scorecard/issues/1270).
41+
Scorecards lowers projects' scores whenever it detects binary artifacts. However, many projects use binary artifacts strictly for testing purposes.
4142

43+
While it isn't currently possible to allowlist such binaries, the Scorecards team is working on this feature ([#1270](https://github.com/ossf/scorecard/issues/1270)).
4244

43-
### Code-Review: Can I set Code-Review check to ignore bot commits?
45+
### Code-Review: Can it ignore bot commits?
4446

45-
This is quite a complex question to be answered. Right now, there is no way to do that and here are some pros and cons on allowing the users to set up a ignore list with bots.
47+
This is quite a complex question. Right now, there is no way to do that. Here are some pros and cons on allowing users to set up an ignore-list for bots.
4648

47-
- Pros: Some bots have a very frequent and automated job and, for some projects, reviewing every change is not feasible or reasonable.
48-
- Cons: Any bot can be compromised (its credentials can be compromised, for example), or considering that the commits are not being signed, an attacker could easily send a commit spoofing the bot. This means that the bot having a not supervised access to the main branch could potentially be a security risk.
49+
- Pros: Some bots run very frequently; for some projects, reviewing every change is therefore not feasible or reasonable.
50+
- Cons: Bots can be compromised (their credentials can be compromised, for example). Or if commits are not signed, an attacker could easily send a commit spoofing the bot. This means that a bot having unsupervised write access to the repository could be a security risk.
4951

50-
Anyhow, this is being discussed by the Scorecard Team, for more informations about this topic please see the issue [Code Review Check handle commits made by version bump bots](https://github.com/ossf/scorecard/issues/2302).
52+
However, this is being discussed by the Scorecards Team ([#2302](https://github.com/ossf/scorecard/issues/2302)).
5153

52-
### Fuzzing: Scorecard accepts custom fuzzers and libfuzzer?
54+
### Fuzzing: Does Scorecards accept custom fuzzers?
5355

54-
The Fuzzing Check detects OSS Fuzz, ClusterFuzzLite, OneFuzz and Go custom checks, thus it only catches custom fuzzing for GoLang. So, the check doesn’t detect custom use of libfuzzer, but some of these fuzzing tools might be using libfuzzers under the hood.
56+
Currently only for projects written in Go.
5557

56-
To see more about how the Fuzzing Check determines whether the project uses fuzzing or not, see [Fuzzing Check](https://github.com/ossf/scorecard/blob/main/docs/checks.md#fuzzing).
58+
For more information, see the [Fuzzing check description](https://github.com/ossf/scorecard/blob/main/docs/checks.md#fuzzing).
5759

58-
### Pinned-Dependencies: Will the scorecard see not-pinned dependencies in tests with Dockerfiles?
60+
### Pinned-Dependencies: Will Scorecards detect unpinned dependencies in tests with Dockerfiles?
5961

60-
Scorecard can show the dependencies that are referred to in tests like Dockerfiles, so it could be a great way for you to fix those dependencies and avoid the vulnerabilities related to version pinning dependencies. To see more about the benefits of hash pinning instead of version pinning, please see the [Pinned-Dependencies Check Description](/checks.md#pinned-dependencies)
62+
Scorecards can show the dependencies that are referred to in tests like Dockerfiles, so it could be a great way for you to fix those dependencies and avoid the vulnerabilities related to version pinning dependencies. To see more about the benefits of hash pinning instead of version pinning, please see the [Pinned-Dependencies check description](/checks.md#pinned-dependencies)
6163

6264
### Pinned-Dependencies: Can I use version pinning instead of hash pinning?
63-
It is not encouraged. The OpenSSF recommends the use of hash pinning instead of version pinning declarations in order to reduce several security risks. Please take a look at the [Pinned-Dependencies Check Description](/checks.md#pinned-dependencies) to a better understanding of the benefits of the Hash Pinning.
65+
Version pinning is a significant improvement over not pinning your dependencies. However, it still leaves your project vulnerable to tag-renaming attacks (where a dependency's tags are deleted and recreated to point to a malicious commit).
66+
67+
The OpenSSF therefore recommends hash pinning instead of version pinning, along with the use of dependency update tools such as dependabot to keep your dependencies up-to-date.
6468

69+
Please see the [Pinned-Dependencies check description](/checks.md#pinned-dependencies) for a better understanding of the benefits of the Hash Pinning.
6570

66-
### Signed-Releases: Why would I sign releases?
71+
### Signed-Releases: Why sign releases?
6772

68-
The main benefit that the [signed releases](/checks.md#signed-releases) could bring for now is the guarantee that a specific artifact was released by a source that you approve or you say is reliable.
73+
Currently, the main benefit of [signed releases](/checks.md#signed-releases) is the guarantee that a specific artifact was released by a source that you approve or attest is reliable.
6974

70-
Although, there are already moves to make it even more influential on the download process. The OpenSSF is working on [Implementing the signature verification with NPM packages](https://github.blog/2022-08-08-new-request-for-comments-on-improving-npm-security-with-sigstore-is-now-open/) which would allow a consumer to automatically verify if the package they are downloading was generated through a reliable builder and if it is correctly signed.
75+
However, there are already moves to make it even more relevant. For example, the OpenSSF is working on [implementing signature verification for NPM packages](https://github.blog/2022-08-08-new-request-for-comments-on-improving-npm-security-with-sigstore-is-now-open/) which would allow a consumer to automatically verify if the package they are downloading was generated through a reliable builder and if it is correctly signed.
7176

72-
The Releases Signature already has some benefits and it is moving to a future with even more security benefits both for consumers and maintainers.
77+
Signing releases already has some relevance and it will soon offer even more security benefits for both consumers and maintainers.

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ require (
3333
github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f
3434
go.opencensus.io v0.23.0
3535
gocloud.dev v0.26.0
36-
golang.org/x/text v0.3.8
36+
golang.org/x/text v0.4.0
3737
golang.org/x/tools v0.1.12
3838
google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc
3939
google.golang.org/protobuf v1.28.1

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -899,8 +899,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
899899
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
900900
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
901901
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
902-
golang.org/x/text v0.3.8 h1:nAL+RVCQ9uMn3vJZbV+MRnydTJFPf8qqY42YiA6MrqY=
903-
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
902+
golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
903+
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
904904
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
905905
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
906906
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=

0 commit comments

Comments
 (0)