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
feat: support verifying if the commit hash of a semver comment is equivalent to a commit SHA of action version (#439)
* feat: support verifying if the commit hash of a semver comment is equivalent to a commit SHA of action version
* fix: improve the error log and add document
* docs: update document
This indicates version annotations aren't necessarily correct.
19
+
Especially, attackers can specify a full commit SHA including a malicious code while setting a safe tag to the version annotation.
20
+
If a pull request includes changes of GitHub Actions, you should verify version annotations.
21
+
22
+
pinact v0.1.3 or newer can verify version annotations using `pinact run`'s `--verify` option.
23
+
This verification works only if the version annotation is semver and the version is full commit hash like the above example.
24
+
This option gets a full commit hash from a version annotation by GitHub API and compares it with the version.
25
+
26
+
e.g.
27
+
28
+
```console
29
+
$ pinact run --verify testdata/bar.yaml
30
+
ERRO[0000] parse a line action=actions/checkout action_version=ee0669bd1cc54295c223e0bb666b733df41de1c5 commit_hash_of_version_annotation=83b7061638ee4956cf7545a6f7efe594e5ad0247 error="verify the version annotation: action_version must be equal to commit_hash_of_version_annotation" help_docs="https://github.com/suzuki-shunsuke/pinact/blob/main/docs/codes/001.md" pinact_version= program=pinact version_annotation=v3.5.1 workflow_file=testdata/bar.yaml
31
+
```
32
+
33
+
Note that `--verify` option calls GitHub API to verify version annotations, which may cause API rate limiting.
0 commit comments