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
scorecard-attestor is a tool that runs scorecard on a software source repo, and based on certain policies about those results, produces a Google Cloud binary authorization attestation.
6
+
7
+
scorecard-attestor helps users secure their software deployment systems by ensuring the code that they deploy passes certain criteria.
8
+
9
+
## Building and using scorecard-attestor
10
+
11
+
scorecard-attestor can be built as a standalone binary from source using `make build-attestor`, or with Docker, using `make build-attestor-docker`. scorecard-attestor is intended to be used as part of a Google Cloud Build pipeline, and inherits environment variables based on [build substitutions](https://cloud.google.com/build/docs/configuring-builds/substitute-variable-values).
12
+
13
+
Unless there's an internal error, scorecard-attestor will always return a successful status code, but will only produce a binary authorization attestation if the policy check passes.
14
+
15
+
## Configuring policies for scorecard-attestor
16
+
17
+
Policies for scorecard attestor can be passed through the CLI using the `--policy` flag. Examples of policies can be seen in [attestor/policy/testdata](/attestor/policy/testdata).
18
+
19
+
### Policy schema
20
+
21
+
Policies follow the following schema:
22
+
23
+
```yaml
24
+
---
25
+
type: "//rec"
26
+
optional:
27
+
preventBinaryArtifacts: "//bool"
28
+
allowedBinaryArtifacts:
29
+
type: "//arr"
30
+
contents: "//str"# Accepts glob-based filepaths as strings here
31
+
ensureNoVulnerabilities: "//bool"
32
+
ensureDependenciesPinned: "//bool"
33
+
allowedUnpinnedDependencies:
34
+
type: "//arr"
35
+
contents:
36
+
type: "//rec"
37
+
optional:
38
+
packagename: "//str"
39
+
filepath: "//str"
40
+
version: "//str"
41
+
ensureCodeReviewed: "//bool"
42
+
codeReviewRequirements:
43
+
type: "//rec"
44
+
optional:
45
+
requiredApprovers:
46
+
type: "//arr"
47
+
contents: "//str"
48
+
minReviewers: "//int"
49
+
```
50
+
51
+
### Missing parameters
52
+
53
+
Policies that are left blank will be ignored. Policies that allow users additional configuration options will be given default parameters as listed below.
54
+
55
+
* `PreventBinaryArtifacts`: If not specified, `AllowedBinaryArtifacts` will be empty, i.e. no binary artifacts will be allowed
56
+
* `PreventUnpinnedDependencies`: If not specified, `AllowedUnpinnedDependencies` will be empty, i.e. no unpinned dependencies will be allowed
57
+
* `RequireCodeReviewed`: If not specified, `CodeReviewRequirements` will require at least one reviewer on all changesets.
58
+
59
+
## Sample
60
+
61
+
Examples of how to use scorecard-attestor with binary authorization in your project can be found in these two repos:
0 commit comments