-
-
Notifications
You must be signed in to change notification settings - Fork 5
fix: harden credentialed shared actions #176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,7 @@ runs: | |
| using: "composite" | ||
| steps: | ||
| - name: Free Disk Space (Ubuntu) | ||
| uses: jlumbroso/free-disk-space@main | ||
| uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # main | ||
| with: | ||
| # this might remove tools that are actually needed, | ||
| # if set to "true" but frees about 6 GB | ||
|
|
@@ -36,14 +36,14 @@ runs: | |
| large-packages: true | ||
| docker-images: true | ||
| swap-storage: true | ||
| - uses: ory/ci/checkout@master | ||
| - uses: ory/ci/checkout@53206fb2760d6580b0e3fa4e4d7547f5d7a0c109 # master | ||
| with: | ||
| token: ${{ inputs.token }} | ||
| fetch-depth: 0 | ||
|
Comment on lines
+39
to
42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- releaser/action.yml ---'
cat -n releaser/action.yml | sed -n '25,65p'
printf '%s\n' '--- .github/workflows/test.yml ---'
cat -n .github/workflows/test.yml | sed -n '1,35p'
printf '%s\n' '--- GitHub checkout usage and related Git operations ---'
rg -n -C 3 'actions/checkout|ory/ci/checkout|git (fetch|push|pull)|persist-credentials|checkout' \
releaser .github 2>/dev/null || trueRepository: ory/ci Length of output: 9612 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- checkout-related files ---'
git ls-files | rg '(^|/)(checkout|action\.yml|action\.yaml)$|checkout'
printf '%s\n' '--- checkout action definitions ---'
for f in $(git ls-files | rg '(^|/)(checkout)/(action\.yml|action\.yaml)$|(^|/)checkout/action\.ya?ml$'); do
echo "### $f"
cat -n "$f" | sed -n '1,180p'
done
printf '%s\n' '--- releaser action inputs and all Git operations ---'
cat -n releaser/action.yml | sed -n '1,180p'Repository: ory/ci Length of output: 12685 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- test workflow inputs and executed test targets ---'
for f in authors/Makefile conventional_commit_config/Makefile changelog/Makefile licenses/Makefile \
conventional_commit_config/package.json authors/package.json changelog/package.json; do
if [ -f "$f" ]; then
echo "### $f"
cat -n "$f" | sed -n '1,220p'
fi
done
printf '%s\n' '--- Git commands in test-reachable repository files ---'
rg -n -i '\bgit([[:space:]]|$)|gitpython|simple-git|isomorphic-git' \
authors conventional_commit_config changelog licenses \
--glob '!**/node_modules/**' --glob '!**/package-lock.json' 2>/dev/null || true
printf '%s\n' '--- checkout credential handling documentation and implementation references ---'
rg -n -C 3 'persist-credentials|post-job|git config|token is configured|credential' checkout README.md .github releaser 2>/dev/null || trueRepository: ory/ci Length of output: 14187 🌐 Web query:
💡 Result: In the official GitHub actions/checkout action (including v3), the persist-credentials input defaults to true [1][2][3]. When this setting is enabled (the default), the action configures the authentication token or SSH key used for the checkout in the local git config [2][4][5]. This allows subsequent git commands in your workflow steps to run as authenticated operations [1][6][7]. The credentials are removed during the post-job cleanup [1][3][6]. You can set persist-credentials to false if you wish to opt out of this behavior [1][7][5]. Citations:
Disable persistent checkout credentials. At 📍 Affects 2 files
🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||
| - uses: actions/setup-node@v6 | ||
| - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 | ||
| with: | ||
| node-version: "16" | ||
| - uses: actions/setup-go@v6 | ||
| - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 | ||
| with: | ||
| go-version: "1.25" | ||
| - run: | | ||
|
|
@@ -66,9 +66,10 @@ runs: | |
| shell: bash | ||
| run: | | ||
| sudo apt install -y moreutils | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5 | ||
| with: | ||
| repository: ory/changelog | ||
| ref: a084a3aeb57e581ad46f61f14f03889ece64d2f8 # master | ||
| path: changelog | ||
| token: ${{ inputs.token }} | ||
|
|
||
|
|
@@ -98,8 +99,8 @@ runs: | |
| git reset --hard HEAD | ||
| shell: bash | ||
|
|
||
| - uses: docker/setup-qemu-action@v3 | ||
| - uses: docker/setup-buildx-action@v3 | ||
| - uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3 | ||
| - uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3 | ||
| - env: | ||
| GORELEASER_CURRENT_TAG: ${{ github.ref_name }} | ||
| GORELEASER_KEY: ${{ inputs.goreleaser_key }} | ||
|
|
@@ -112,7 +113,7 @@ runs: | |
| # clean up ory/changelog checkout | ||
| rm -rf changelog | ||
|
|
||
| docker pull --platform linux/amd64 oryd/xgoreleaser:latest | ||
| docker pull --platform linux/amd64 oryd/xgoreleaser:1.26.0-2.14.1@sha256:635fdea1104f933c13298228601ceeda725eb7ce3ed3c1757aae712f44bdd773 | ||
| docker run --privileged --mount type=bind,source="$(pwd)",target=/project \ | ||
| --mount type=bind,source="$notes",target=/notes.md \ | ||
| --platform linux/amd64 \ | ||
|
|
@@ -123,7 +124,7 @@ runs: | |
| -e DOCKER_PASSWORD \ | ||
| -e GORELEASER_CURRENT_TAG \ | ||
| -v /var/run/docker.sock:/var/run/docker.sock \ | ||
| oryd/xgoreleaser:latest release --release-header "/notes.md" --clean --timeout 60m | ||
| oryd/xgoreleaser:1.26.0-2.14.1@sha256:635fdea1104f933c13298228601ceeda725eb7ce3ed3c1757aae712f44bdd773 release --release-header "/notes.md" --clean --timeout 60m | ||
|
|
||
| git add -A | ||
| git stash || true | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: ory/ci
Length of output: 11173
🏁 Script executed:
Repository: ory/ci
Length of output: 15854
🏁 Script executed:
Repository: ory/ci
Length of output: 136
Forward
ssh_keyto the checkout action.ory/ci/checkoutsupportsssh-keybut defaults togithub.tokenwhen it is absent.newsletter/action.ymlalso runsgit fetchbefore configuring SSH. Passssh-key: ${{ inputs.ssh_key }}to the checkout step.🤖 Prompt for AI Agents