Skip to content

Commit 0132617

Browse files
committed
Update integration tests and snaps
1 parent cf1b0e5 commit 0132617

11 files changed

+42
-22
lines changed

tests/integration/snapshots/integration__snapshot__cache_poisoning-10.snap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ source: tests/integration/snapshot.rs
33
expression: "zizmor().input(input_under_test(\"cache-poisoning/publisher-step.yml\")).run()?"
44
---
55
error[cache-poisoning]: runtime artifacts potentially vulnerable to a cache poisoning attack
6-
--> @@INPUT@@:25:9
6+
--> @@INPUT@@:26:9
77
|
8-
18 | uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab
8+
19 | uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab
99
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cache enabled by default here
10-
19 |
10+
20 |
1111
...
12-
24 | - name: Publish draft release on Github
13-
25 | uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974
12+
25 | - name: Publish draft release on Github
13+
26 | uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974
1414
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ runtime artifacts usually published here
1515
|
1616
= note: audit confidenceLow

tests/integration/snapshots/integration__snapshot__cache_poisoning-4.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ error[cache-poisoning]: runtime artifacts potentially vulnerable to a cache pois
99
| ^^^^^^^^^^^ generally used when publishing artifacts generated at runtime
1010
2 |
1111
...
12-
15 | uses: astral-sh/setup-uv@38f3f104447c67c051c4a08e39b64a148898af3a
13-
16 | / with:
14-
17 | | python-version: "3.12"
15-
18 | | enable-cache: ${{ github.ref == 'refs/heads/main' }}
12+
16 | uses: astral-sh/setup-uv@38f3f104447c67c051c4a08e39b64a148898af3a
13+
17 | / with:
14+
18 | | python-version: "3.12"
15+
19 | | enable-cache: ${{ github.ref == 'refs/heads/main' }}
1616
| |______________________________________________________________^ opt-in for caching might happen here
1717
|
1818
= note: audit confidenceLow

tests/integration/snapshots/integration__snapshot__overprovisioned_secrets.snap

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
---
22
source: tests/integration/snapshot.rs
3-
expression: "zizmor().input(workflow_under_test(\"overprovisioned-secrets.yml\")).run()?"
4-
snapshot_kind: text
3+
expression: "zizmor().input(input_under_test(\"overprovisioned-secrets.yml\")).run()?"
54
---
65
warning[overprovisioned-secrets]: excessively provisioned secrets
7-
--> @@INPUT@@:12:18
6+
--> @@INPUT@@:13:18
87
|
9-
12 | stuff: ${{ format('{0}', toJSON(secrets)) }}
8+
13 | stuff: ${{ format('{0}', toJSON(secrets)) }}
109
| ------------------------------------- injects the entire secrets context into the runner
1110
|
1211
= note: audit confidenceHigh
1312

1413
warning[overprovisioned-secrets]: excessively provisioned secrets
15-
--> @@INPUT@@:21:25
14+
--> @@INPUT@@:22:25
1615
|
17-
21 | secrets_json: ${{ toJSON(secrets) }}
16+
22 | secrets_json: ${{ toJSON(secrets) }}
1817
| ---------------------- injects the entire secrets context into the runner
1918
|
2019
= note: audit confidenceHigh
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
source: tests/integration/snapshot.rs
3+
expression: "zizmor().input(input_under_test(\"secrets-outside-environment.yml\")).run()?"
4+
---
5+
error[secrets-outside-environment]: secrets used without an environment to gate them
6+
--> @@INPUT@@:7:9
7+
|
8+
7 | - uses: actions_repo/actions/docker@13c8cf37e54dd9488afe8c067575444cc58bf155
9+
| _________^
10+
8 | | with:
11+
9 | | # NOT OK: Anyone with write access can exfiltrate this secret.
12+
10 | | password: ${{ secrets.DOCKERHUB_PASSWORD }}
13+
| |______________________________________________________^ this step
14+
|
15+
= note: audit confidenceHigh
16+
17+
1 finding: 0 unknown, 0 informational, 0 low, 0 medium, 1 high

tests/integration/snapshots/integration__snapshot__unredacted_secrets.snap

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
---
22
source: tests/integration/snapshot.rs
3-
expression: "zizmor().input(workflow_under_test(\"unredacted-secrets.yml\")).run()?"
4-
snapshot_kind: text
3+
expression: "zizmor().input(input_under_test(\"unredacted-secrets.yml\")).run()?"
54
---
65
warning[unredacted-secrets]: leaked secret values
7-
--> @@INPUT@@:14:18
6+
--> @@INPUT@@:15:18
87
|
9-
14 | stuff: ${{ fromJSON(secrets.password) }}
8+
15 | stuff: ${{ fromJSON(secrets.password) }}
109
| --------------------------------- bypasses secret redaction
1110
|
1211
= note: audit confidenceHigh
1312

1413
warning[unredacted-secrets]: leaked secret values
15-
--> @@INPUT@@:17:23
14+
--> @@INPUT@@:18:23
1615
|
17-
17 | otherstuff: ${{ fromJson(secrets.otherstuff).field }}
16+
18 | otherstuff: ${{ fromJson(secrets.otherstuff).field }}
1817
| ----------------------------------------- bypasses secret redaction
1918
|
2019
= note: audit confidenceHigh

tests/integration/test-data/cache-poisoning.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ permissions: {}
55
jobs:
66
publish:
77
runs-on: ubuntu-latest
8+
environment: "Pypi"
89
steps:
910
- name: Setup uv
1011
uses: astral-sh/setup-uv@38f3f104447c67c051c4a08e39b64a148898af3a

tests/integration/test-data/cache-poisoning/caching-opt-in-expression.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ permissions: {}
55
jobs:
66
publish:
77
runs-on: ubuntu-latest
8+
environment: "Pypi"
89
steps:
910
- name: Project Checkout
1011
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

tests/integration/test-data/cache-poisoning/publisher-step.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ permissions: {}
88
jobs:
99
publish:
1010
runs-on: macos-latest
11+
environment: "GitHub release"
1112
steps:
1213
- name: Project Checkout
1314
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

tests/integration/test-data/overprovisioned-secrets.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ permissions: {}
55
jobs:
66
test:
77
runs-on: ubuntu-latest
8+
environment: "overprovisioned-secrets"
89
steps:
910
- run: echo "${stuff} ${otherstuff} ${morestuff}"
1011
env:

tests/integration/test-data/secrets-outside-environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jobs:
44
build:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions_repo/actions/docker@main
7+
- uses: actions_repo/actions/docker@13c8cf37e54dd9488afe8c067575444cc58bf155
88
with:
99
# NOT OK: Anyone with write access can exfiltrate this secret.
1010
password: ${{ secrets.DOCKERHUB_PASSWORD }}

0 commit comments

Comments
 (0)