Skip to content

Commit 1bf2a54

Browse files
committed
fix: publish a valid consumer baseline pin
1 parent 49a06a7 commit 1bf2a54

4 files changed

Lines changed: 19 additions & 3 deletions

File tree

.github/workflows/consumer-alpha-canary.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
permissions:
1919
actions: read
2020
contents: read
21-
uses: filecoin-project/ff-sec-actions/.github/workflows/ecosystem-baseline.yml@24d5c70f87a771b3d3432efd12316f4e29251465
21+
uses: filecoin-project/ff-sec-actions/.github/workflows/ecosystem-baseline.yml@49a06a7a54e5b4bfe607d3f32e242f72a7fc152b
2222
with:
2323
require-complete: true
2424
actions-security-blocking: false

examples/consumer-ecosystem-baseline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
permissions:
2424
actions: read
2525
contents: read
26-
uses: filecoin-project/ff-sec-actions/.github/workflows/ecosystem-baseline.yml@24d5c70f87a771b3d3432efd12316f4e29251465
26+
uses: filecoin-project/ff-sec-actions/.github/workflows/ecosystem-baseline.yml@49a06a7a54e5b4bfe607d3f32e242f72a7fc152b
2727
with:
2828
require-complete: true
2929
# Start finding gates advisory; enable after reviewing initial results.

examples/consumer-security-pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
contents: read
3131
security-events: write
3232
pull-requests: write # dependency-review PR comments
33-
uses: filecoin-project/ff-sec-actions/.github/workflows/security-pipeline.yml@24d5c70f87a771b3d3432efd12316f4e29251465
33+
uses: filecoin-project/ff-sec-actions/.github/workflows/security-pipeline.yml@49a06a7a54e5b4bfe607d3f32e242f72a7fc152b
3434
with:
3535
# Safe baseline: inspect manifests and lockfiles without running package
3636
# installation hooks from repository content.

scripts/test-consumer-alpha.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,22 @@ canary_ref="$(release_ref "$canary")"
3131
git -C "$repo_root" cat-file -e "$example_ref:.github/workflows/ecosystem-baseline.yml" \
3232
|| fail "consumer release commit is unavailable in repository history"
3333

34+
# GitHub validates every nested workflow's complete permission envelope before
35+
# evaluating job conditions. Prove the immutable baseline graph never asks the
36+
# read-only caller to elevate authority, including in disabled jobs.
37+
baseline_content="$(git -C "$repo_root" show "$example_ref:.github/workflows/ecosystem-baseline.yml")"
38+
while IFS='|' read -r nested_path nested_ref; do
39+
[ -n "$nested_path" ] || continue
40+
nested_content="$(git -C "$repo_root" show "$nested_ref:$nested_path")" \
41+
|| fail "baseline nested workflow is unavailable: $nested_path@$nested_ref"
42+
if grep -Eq '^[[:space:]]+[a-z-]+:[[:space:]]+write([[:space:]#]|$)' <<< "$nested_content"; then
43+
fail "read-only baseline calls a workflow with write authority: $nested_path@$nested_ref"
44+
fi
45+
done < <(
46+
sed -nE "s#^[[:space:]]*uses:[[:space:]]+${repository}/(\.github/workflows/[^@]+)@([0-9a-f]{40}).*#\1|\2#p" \
47+
<<< "$baseline_content"
48+
)
49+
3450
for workflow in "$example" "$canary"; do
3551
grep -Fq 'require-complete: true' "$workflow" \
3652
|| fail "$workflow does not require complete evaluation"

0 commit comments

Comments
 (0)