-
Notifications
You must be signed in to change notification settings - Fork 0
docs(audit) + 11 fixes: auditoria exaustiva 2026-05-23 + plano de 20 etapas #124
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
86020a3
1160f3b
94577a9
964518e
285cd22
c9ab4a2
5876bfc
fab293b
e5632a1
307ddfd
6250622
17a16d3
3a0fbea
24735c9
5ac4322
c70585d
fda7a54
c4f5ae5
ba5798b
4b64fd5
1953e4d
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 |
|---|---|---|
|
|
@@ -30,9 +30,9 @@ jobs: | |
| continue-on-error: true | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| - uses: actions/setup-node@v6 | ||
|
Comment on lines
+33
to
+35
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. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
FILE=".github/workflows/ci.yml"
echo "== File exists? =="
ls -l "$FILE"
echo
echo "== Lines around 25-80 (includes 33-35) =="
nl -ba "$FILE" | sed -n '25,80p'
echo
echo "== All persist-credentials in this workflow =="
rg -n "persist-credentials\s*:" "$FILE" || true
echo
echo "== All uses: actions/checkout@* =="
rg -n "uses:\s*actions/checkout@" "$FILE" || true
echo
echo "== All uses: actions/setup-node@* =="
rg -n "uses:\s*actions/setup-node@" "$FILE" || true
echo
echo "== All uses: actions/upload-artifact@* =="
rg -n "uses:\s*actions/upload-artifact@" "$FILE" || true
echo
echo "== Checkouts with context (10 lines after each checkout) =="
rg -n "uses:\s*actions/checkout@" "$FILE" | cut -d: -f1 | while read -r line; do
start=$((line-3))
end=$((line+12))
echo "--- Context for checkout at line $line ---"
nl -ba "$FILE" | sed -n "${start},${end}p"
doneRepository: adm01-debug/promo-gifts-v4 Length of output: 269 🏁 Script executed: #!/bin/bash
set -euo pipefail
FILE=".github/workflows/ci.yml"
echo "== File exists? =="
ls -l "$FILE"
echo
echo "== Lines around 25-80 (includes 33-35) =="
awk 'NR>=25 && NR<=80 {printf "%d\t%s\n", NR, $0}' "$FILE"
echo
echo "== All persist-credentials in this workflow =="
rg -n "persist-credentials\s*:" "$FILE" || true
echo
echo "== All uses: actions/checkout@* =="
rg -n "uses:\s*actions/checkout@" "$FILE" || true
echo
echo "== All uses: actions/setup-node@* =="
rg -n "uses:\s*actions/setup-node@" "$FILE" || true
echo
echo "== All uses: actions/upload-artifact@* =="
rg -n "uses:\s*actions/upload-artifact@" "$FILE" || true
echo
echo "== Checkouts com contexto (±3 linhas antes e +12 depois) =="
rg -n "uses:\s*actions/checkout@" "$FILE" | cut -d: -f1 | while read -r line; do
start=$((line-3))
end=$((line+12))
echo "--- Contexto do checkout no line $line ---"
awk -v s="$start" -v e="$end" 'NR>=s && NR<=e {printf "%d\t%s\n", NR, $0}' "$FILE"
echo
doneRepository: adm01-debug/promo-gifts-v4 Length of output: 11439 Endureça o workflow CI (pinagem por SHA +
Patch sugerido (padrão para aplicar nos steps equivalentes)- - uses: actions/checkout@v5
+ - uses: actions/checkout@<SHA_IMUTAVEL_DA_RELEASE_V5>
+ with:
+ persist-credentials: false
- - uses: actions/setup-node@v6
+ - uses: actions/setup-node@<SHA_IMUTAVEL_DA_RELEASE_V6>
- - uses: actions/upload-artifact@v5
+ - uses: actions/upload-artifact@<SHA_IMUTAVEL_DA_RELEASE_V5>🧰 Tools🪛 zizmor (1.25.2)[warning] 33-33: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) [error] 33-33: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) [error] 35-35: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI Agents |
||
| with: | ||
| node-version-file: '.nvmrc' | ||
|
|
||
|
|
@@ -55,9 +55,9 @@ jobs: | |
| timeout-minutes: 90 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version-file: '.nvmrc' | ||
| cache: npm | ||
|
|
@@ -189,8 +189,8 @@ jobs: | |
| needs: quality | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version-file: '.nvmrc' | ||
| cache: npm | ||
|
|
@@ -207,9 +207,9 @@ jobs: | |
| timeout-minutes: 75 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version-file: '.nvmrc' | ||
| cache: npm | ||
|
|
@@ -239,7 +239,7 @@ jobs: | |
|
|
||
| - name: Upload coverage report | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| uses: actions/upload-artifact@v5 | ||
| with: | ||
| name: coverage-report-${{ github.run_id }} | ||
| path: coverage/ | ||
|
|
@@ -261,8 +261,8 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| needs: quality | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version-file: '.nvmrc' | ||
| cache: npm | ||
|
|
@@ -289,7 +289,7 @@ jobs: | |
| --coverage.thresholds.branches=0 | ||
| --coverage.thresholds.statements=0 | ||
| - name: Upload Coverage Artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| uses: actions/upload-artifact@v5 | ||
| with: | ||
| name: full-coverage-report | ||
| path: coverage/ | ||
|
|
@@ -300,8 +300,8 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| needs: quality | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version-file: '.nvmrc' | ||
| cache: npm | ||
|
|
@@ -313,7 +313,7 @@ jobs: | |
| run: npm run test:e2e:critical | ||
| - name: Upload E2E Report | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| uses: actions/upload-artifact@v5 | ||
| with: | ||
| name: playwright-report | ||
| path: playwright-report/ | ||
|
|
@@ -329,8 +329,8 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| needs: build-gate | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version-file: '.nvmrc' | ||
| cache: npm | ||
|
|
@@ -342,7 +342,7 @@ jobs: | |
| run: npx playwright test e2e/flows/elite-ux-validation.spec.ts | ||
| - name: Upload Elite E2E Report | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| uses: actions/upload-artifact@v5 | ||
| with: | ||
| name: playwright-elite-report | ||
| path: playwright-report/ | ||
|
|
@@ -355,9 +355,9 @@ jobs: | |
| timeout-minutes: 10 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version-file: '.nvmrc' | ||
| cache: npm | ||
|
|
@@ -400,7 +400,7 @@ jobs: | |
|
|
||
| - name: Upload ref-warning console snapshot | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| uses: actions/upload-artifact@v5 | ||
| with: | ||
| name: console-snapshot-ref-${{ github.run_id }} | ||
| path: | | ||
|
|
@@ -415,9 +415,9 @@ jobs: | |
| timeout-minutes: 10 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version-file: '.nvmrc' | ||
| cache: npm | ||
|
|
@@ -455,7 +455,7 @@ jobs: | |
|
|
||
| - name: Upload hook coverage artifact | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| uses: actions/upload-artifact@v5 | ||
| with: | ||
| name: hooks-coverage | ||
| path: coverage/ | ||
|
|
@@ -468,9 +468,9 @@ jobs: | |
| timeout-minutes: 10 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version-file: '.nvmrc' | ||
| cache: npm | ||
|
|
@@ -509,7 +509,7 @@ jobs: | |
|
|
||
| - name: Upload price-freshness coverage artifact | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| uses: actions/upload-artifact@v5 | ||
| with: | ||
| name: price-freshness-coverage | ||
| path: coverage/ | ||
|
|
@@ -522,9 +522,9 @@ jobs: | |
| timeout-minutes: 10 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version-file: '.nvmrc' | ||
| cache: npm | ||
|
|
@@ -537,7 +537,7 @@ jobs: | |
|
|
||
| - name: Upload cloud-status coverage artifact | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| uses: actions/upload-artifact@v5 | ||
| with: | ||
| name: cloud-status-coverage | ||
| path: coverage/ | ||
|
|
@@ -550,9 +550,9 @@ jobs: | |
| timeout-minutes: 15 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version-file: '.nvmrc' | ||
|
|
||
|
|
@@ -574,9 +574,9 @@ jobs: | |
| timeout-minutes: 20 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version-file: '.nvmrc' | ||
| cache: npm | ||
|
|
@@ -592,7 +592,7 @@ jobs: | |
|
|
||
| - name: Upload Theme Validation Report | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| uses: actions/upload-artifact@v5 | ||
| with: | ||
| name: theme-validation-report | ||
| path: | | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,7 +26,7 @@ jobs: | |
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| uses: actions/checkout@v5 | ||
|
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. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== File = .github/workflows/codeql.yml =="
ls -la .github/workflows/codeql.yml || true
echo
echo "== Lines around checkout (approx 1-80) =="
nl -ba .github/workflows/codeql.yml | sed -n '1,120p'
echo
echo "== All checkout uses in the workflow =="
rg -n "uses:\s*actions/checkout@" .github/workflows/codeql.yml || true
echo
echo "== Any persist-credentials configuration =="
rg -n "persist-credentials" .github/workflows/codeql.yml || trueRepository: adm01-debug/promo-gifts-v4 Length of output: 293 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== File = .github/workflows/codeql.yml =="
sed -n '1,200p' .github/workflows/codeql.yml | cat
echo
echo "== Lines with checkout uses =="
grep -nE "uses:\s*actions/checkout@" .github/workflows/codeql.yml || true
echo
echo "== Lines with persist-credentials =="
grep -nE "persist-credentials" .github/workflows/codeql.yml || trueRepository: adm01-debug/promo-gifts-v4 Length of output: 1084 🌐 Web query:
💡 Result: For actions/checkout v5, the input persist-credentials has no explicit documented boolean default; instead, the README shows the default as an empty value (persist-credentials: ''). This corresponds to the action’s default behavior of persisting credentials (token/SSH key) into the local git configuration unless you set persist-credentials: false. The documentation also states that the auth token is persisted in local git config and removed during post-job cleanup, and that you can opt out by setting persist-credentials: false [1][2]. Citations:
🌐 Web query:
💡 Result: Best practice: in GitHub Actions workflows, pin the action you “use” to a full-length commit SHA (immutable reference) instead of a mutable tag like v5. GitHub documents that pinning to a full-length commit SHA is the only way to use an action as an immutable release and helps mitigate the risk of a malicious backdoor being added to the action’s repository.[1] Why v5 tags are not equivalent to SHA pinning - A tag reference such as actions/checkout@v5 is a moving, mutable Git ref; workflows that use tags can end up running different code over time if the tag is repointed (or if the action maintainer is compromised).[1] - Pinning to a commit SHA prevents silent changes because the commit SHA is immutable; the exact code state identified by that SHA is what will be executed.[1] What this looks like in YAML - Less secure (tag): - uses: actions/some-action@v5 - More secure (commit SHA): - uses: actions/some-action@ (Many teams keep the human-readable version as a comment for maintainability.)[2] How to keep SHAs up to date - Because commit SHAs are immutable, you must intentionally update pins when you want newer action versions; tools exist to automatically convert/update workflow pins to the latest SHA for a given tag.[3] Direct answer - To follow the security best practice implied by the docs, replace references like actions/ Citations:
Fix de segurança no checkout (CodeQL): pin SHA e desative persistência de credenciais.
🧰 Tools🪛 zizmor (1.25.2)[warning] 28-29: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) [error] 29-29: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI Agents |
||
|
|
||
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@v4 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,8 +37,8 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-node@v6 | ||
|
Comment on lines
+40
to
+41
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. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
FILE=".github/workflows/contract-tests.yml"
echo "== File: $FILE =="
echo
nl -ba "$FILE" | sed -n '1,160p'
echo
echo "== uses: lines =="
rg -n "uses:\s*actions/(checkout|setup-node)@|persist-credentials:" "$FILE" -n || trueRepository: adm01-debug/promo-gifts-v4 Length of output: 181 🏁 Script executed: #!/bin/bash
set -euo pipefail
FILE=".github/workflows/contract-tests.yml"
echo "== File: $FILE =="
echo
if [ ! -f "$FILE" ]; then
echo "Arquivo não encontrado: $FILE"
exit 1
fi
# Mostrar com numeração (sem nl)
awk '{printf "%6d\t%s\n", NR, $0}' "$FILE" | sed -n '1,220p'
echo
echo "== Evidências: uses/actions e persist-credentials =="
awk '{print NR "\t" $0}' "$FILE" | rg -n "uses:\s*actions/(checkout|setup-node)@|persist-credentials:" || trueRepository: adm01-debug/promo-gifts-v4 Length of output: 4637 🏁 Script executed: #!/bin/bash
set -euo pipefail
FILE=".github/workflows/contract-tests.yml"
echo "== persist-credentials no workflow =="
rg -n "persist-credentials\s*:" "$FILE" || true
echo
echo "== uses actions/*`@v`* (sem SHA) =="
rg -n "uses:\s*actions/[A-Za-z0-9_-]+@v[0-9]+" "$FILE" || true
echo
echo "== uses actions/*@<não-v>" # ajuda a ver se tem SHA em algum lugar
rg -n "uses:\s*actions/[A-Za-z0-9_-]+@([0-9a-f]{7,40})\b" "$FILE" || trueRepository: adm01-debug/promo-gifts-v4 Length of output: 322 🌐 Web query:
💡 Result: The actions/checkout input persist-credentials defaults to true. In the official actions/checkout README, the option is documented as “Default: true” and describes that “The auth token is persisted in the local git config… Set persist-credentials: false to opt-out.” [1][2] So the default value is: true. Citations:
Padronize o pin das Actions e desative persist-credentials no checkout. O workflow usa
🧰 Tools🪛 zizmor (1.25.2)[warning] 40-40: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) [error] 40-40: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) [error] 41-41: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI Agents |
||
| with: | ||
| node-version: '20' | ||
| cache: 'npm' | ||
|
|
@@ -63,9 +63,9 @@ jobs: | |
| if: github.event.pull_request.head.repo.full_name == github.repository | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'npm' | ||
|
|
||
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.
🧩 Analysis chain
🏁 Script executed:
Repository: adm01-debug/promo-gifts-v4
Length of output: 193
🏁 Script executed:
Repository: adm01-debug/promo-gifts-v4
Length of output: 7629
Pin
actions/checkoutem SHA imutável.actions/checkout@v5está referenciado por tag (mutável), enfraquecendo a cadeia de confiança do workflow. Troque por um commit SHA fixo da releasev5(neste arquivo, esse é o únicousessem pinagem por SHA).🧰 Tools
🪛 zizmor (1.25.2)
[error] 40-40: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
🤖 Prompt for AI Agents