Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/base-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
version: ${{ steps.v.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0 # full history + tags so git describe sees release tags
- name: Compute version suffix
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
arch: ${{ fromJSON(needs.setup.outputs.arches) }}
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipeforce

echo "== workflow files =="
git ls-files '.github/workflows/*' 

echo
echo "== checkout occurrences =="
rg -n 'actions/checkout|persist-credentials|GITHUB_TOKEN|\$\{{\s*secrets|permission|permissions' .github/workflows || true

echo
echo "== affected workflow excerpts =="
for f in .github/workflows/base-image.yml .github/workflows/ci-walkthrough.yml .github/workflows/ci.yml; do
  if [ -f "$f" ]; then
    echo "--- $f ($(wc -l < "$f") lines) ---"
    nl -ba "$f" | sed -n '1,190p'
  fi
done

echo
echo "== deterministic documentation/source evidence for actions/checkout persist option =="
python3 - <<'PY'
# Read-only local probe: inspect whether any of the affected workflows already configure
# persist-credentials or run privileged build/tooling immediately after checkout.
from pathlib import Path
import re

paths = ['.github/workflows/base-image.yml','.github/workflows/ci-walkthrough.yml','.github/workflows/ci.yml']
for p in paths:
    text = Path(p).read_text()
    print(f'{p}: has persist-credentials: {bool(re.search(r"persist-credentials:\s*false", text))}')
    for m in re.finditer(r'uses:\s*actions/checkout@([^\s#]+)\s*(?:#\s*([^\n]+))?', text):
        ref = m.group(1)
        line = text.count('\n',0,m.start())+1
        print(f'  line {line}: actions/checkout@{ref}')
PY

Repository: pgEdge/coldfront

Length of output: 204


🏁 Script executed:

#!/bin/bash
set -eu

echo "== workflow files =="
git ls-files '.github/workflows/*'

echo
echo "== checkout occurrences =="
rg -n 'actions/checkout|persist-credentials|GITHUB_TOKEN|\$\{{\s*secrets|permission|permissions' .github/workflows || true

echo
echo "== affected workflow excerpts =="
for f in .github/workflows/base-image.yml .github/workflows/ci-walkthrough.yml .github/workflows/ci.yml; do
  if [ -f "$f" ]; then
    echo "--- $f ($(wc -l < "$f") lines) ---"
    nl -ba "$f" | sed -n '1,190p'
  fi
done

echo
echo "== simple workflow invariant probe =="
python3 - <<'PY'
from pathlib import Path
import re

paths = ['.github/workflows/base-image.yml','.github/workflows/ci-walkthrough.yml','.github/workflows/ci.yml']
for p in paths:
    text = Path(p).read_text()
    print(f'{p}: has persist-credentials false: {bool(re.search(r"persist-credentials:\s*false", text))}')
    for m in re.finditer(r'uses:\s*actions/checkout@([^\s#]+)\s*(?:#\s*([^\n]+))?', text):
        ref = m.group(1)
        line = text.count('\n',0,m.start())+1
        print(f'  line {line}: actions/checkout@{ref}')
PY

Repository: pgEdge/coldfront

Length of output: 1207


🏁 Script executed:

#!/bin/bash
set -eu

echo "== checkout occurrences =="
rg -n --no-heading 'actions/checkout|persist-credentials|GITHUB_TOKEN|secrets\.|permissions:' .github/workflows || true

echo
echo "== affected workflow excerpts =="
python3 - <<'PY'
from pathlib import Path
for fn in ['base-image.yml','ci-walkthrough.yml','ci.yml']:
    p = Path('.github/workflows')/fn
    lines = p.read_text().splitlines()
    print(f'--- .github/workflows/{fn} ({len(lines)} lines) ---')
    first=max(1, len(lines)-180)
    last=len(lines)+1
    for i in range(first, last):
        print(f'{i:4}: {lines[i-1]}')
PY

echo
echo "== simple workflow invariant probe =="
python3 - <<'PY'
from pathlib import Path
import re
paths = ['.github/workflows/base-image.yml','.github/workflows/ci-walkthrough.yml','.github/workflows/ci.yml']
for p in paths:
    text = Path(p).read_text()
    print(f'{p}: has persist-credentials false: {bool(re.search(r"persist-credentials:\s*false", text))}')
    for m in re.finditer(r'uses:\s*actions/checkout@([^\s#]+)\s*(?:#\s*([^\n]+))?', text):
        ref = m.group(1)
        start = text.find(f'uses: actions/checkout@{ref}', m.start())
        line = text.count('\n',0,start)+1
        print(f'  line {line}: actions/checkout@{ref}')
PY

echo
echo "== GitHub API action ref candidates =="
python3 - <<'PY'
import urllib.request
url='https://api.github.com/repos/actions/checkout/git/refs/tags/v7'
req=urllib.request.Request(url, headers={'Accept':'application/vnd.github+json','User-Agent':'code-rabbit-verify'})
print(urllib.request.urlopen(req, timeout=20).read().decode())
PY

Repository: pgEdge/coldfront

Length of output: 22593


🌐 Web query:

actions/checkout persist-credentials input defaults true git config credential.helper

💡 Result:

The persist-credentials input in actions/checkout is set to true by default [1][2]. This setting controls whether the action configures Git to use the provided authentication token or SSH key for subsequent Git commands within the workflow job [3][4]. When persist-credentials is set to true, the action configures local Git settings so that scripts in your workflow can run authenticated Git commands (e.g., git fetch, git push) without needing to manually provide credentials [3][4]. Regarding your query on git config credential.helper: 1. Mechanism: Historically, actions/checkout persisted credentials by writing them directly into the local.git/config file [4][2]. Since version v6.0.0, the action has been updated to improve security by storing credentials in a separate file located in $RUNNER_TEMP, rather than directly in.git/config [4][5]. 2. Interaction with credential.helper: actions/checkout does not explicitly rely on a standard Git credential.helper (as documented in git-scm.com [6]) to manage this token. Instead, it directly manipulates Git configuration (using git config --local) to inject the token or SSH key, effectively making them available to the Git environment for the duration of the job [5][7]. The token is then automatically removed during the post-job cleanup phase [3][4]. Security Note: Because this mechanism makes the credentials accessible to any process running within the job, there have been ongoing discussions and community requests to change the default value to false to enhance security [8][9]. If you require higher security, you should explicitly set persist-credentials: false in your workflow step [3][4].

Citations:


Make checkout credential persistence explicit where credentials are used. Since actions/checkout continues to expose the GitHub token to authenticated Git commands in the job, add persist-credentials: false to the listed checkouts unless later steps need authenticated Git operations; unset any persisted credential store afterward if it must remain true.

🧰 Tools
🪛 zizmor (1.26.1)

[warning] 94-95: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

📍 Affects 3 files
  • .github/workflows/base-image.yml#L95-L95 (this comment)
  • .github/workflows/ci-walkthrough.yml#L22-L22
  • .github/workflows/ci-walkthrough.yml#L36-L36
  • .github/workflows/ci.yml#L49-L49
  • .github/workflows/ci.yml#L101-L101
  • .github/workflows/ci.yml#L146-L146
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/base-image.yml at line 95, Make checkout credential
persistence explicit by adding persist-credentials: false to the checkout steps
at .github/workflows/base-image.yml:95, .github/workflows/ci-walkthrough.yml:22
and :36, and .github/workflows/ci.yml:49, :101, and :146. If any of these
checkout sites require authenticated Git operations later, retain persistence
only there and explicitly unset the credential store afterward.

Source: Linters/SAST tools

- name: Set up Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
- name: Log in to GHCR
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-walkthrough.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
name: Validate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Repository files matching workflow names:"
git ls-files .github/workflows | sed -n '1,120p'

echo
echo "Target workflow excerpts:"
if [ -f .github/workflows/ci-walkthrough.yml ]; then
  nl -ba .github/workflows/ci-walkthrough.yml | sed -n '1,90p'
else
  echo ".github/workflows/ci-walkthrough.yml not found"
fi

echo
echo "Search for checkout usage in target workflow:"
rg -n "actions/checkout|persist-credentials|run:|container:" .github/workflows/ci-walkthrough.yml || true

echo
echo "Repository evidence: list files in .github/workflows"
git ls-files .github/workflows | wc -l

Repository: pgEdge/coldfront

Length of output: 389


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Target workflow excerpts:"
awk '{printf "%6d\t%s\n", NR, $0}' .github/workflows/ci-walkthrough.yml | sed -n '1,120p'

echo
echo "Checkout and downstream action usage:"
awk '/actions\/checkout|run:|container:|permissions:|persist-credentials/ {printf "%6d\t%s\n", NR, $0}' .github/workflows/ci-walkthrough.yml

echo
echo "All actions uses pins:"
awk '/uses:/ {printf "%6d\t%s\n", NR, $0}' .github/workflows/ci-walkthrough.yml

Repository: pgEdge/coldfront

Length of output: 4900


Disable persisted checkout credentials before running repository code in both jobs.

This workflow checks out the repo before running repository scripts and Docker compose commands, but actions/checkout leaves the GitHub token in .git/config by default. Add with: persist-credentials: false to the checkout steps so downstream scripts cannot read the checkout token.

🧰 Tools
🪛 zizmor (1.26.1)

[warning] 22-22: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci-walkthrough.yml at line 22, Update the actions/checkout
steps in both workflow jobs to set with.persist-credentials to false. Preserve
the existing checkout behavior while ensuring downstream repository scripts and
Docker Compose commands cannot access the persisted GitHub token.

Source: Linters/SAST tools

- name: Run ShellCheck
run: shellcheck -x --source-path=examples/walkthrough examples/walkthrough/*.sh
- name: Validate Docker Compose
Expand All @@ -33,7 +33,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- name: Log in to GHCR
uses: docker/login-action@abd2ef45e78c5afb21d64d4ca52ee8550d9572c7 # v4.5.1
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
timeout-minutes: 90
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
COLDFRONT_GCS_BUCKET: ${{ secrets.COLDFRONT_GCS_BUCKET }}
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
Expand Down Expand Up @@ -126,7 +126,7 @@ jobs:
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0 # full history so gitleaks scans every commit
# Run gitleaks via its container — the gitleaks-ACTION is license-gated for
Expand All @@ -143,7 +143,7 @@ jobs:
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0

Expand Down