Skip to content
Open
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
5 changes: 1 addition & 4 deletions .github/workflows/required-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ on:
merge_group:
workflow_dispatch:

permissions:
checks: write
contents: read
pull-requests: read
permissions: write-all

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:

#!/usr/bin/env bash
set -euo pipefail

for file in \
  .github/workflows/required-checks.yml \
  .github/workflows/precheck.yml \
  .github/workflows/build.yml
do
  if [[ -f "$file" ]]; then
    echo "===== $file ====="
    nl -ba "$file"
  fi
done

rg -n -C 4 \
  'permissions:|GITHUB_TOKEN|github\.token|secrets\.GITHUB_TOKEN|id-token|pull_request_target|pull_request|uses:|run:' \
  .github/workflows

Repository: sshiv012/texera

Length of output: 244


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

for file in \
  .github/workflows/required-checks.yml \
  .github/workflows/precheck.yml \
  .github/workflows/build.yml
do
  if [[ -f "$file" ]]; then
    echo "===== $file ====="
    cat -n "$file"
  else
    echo "===== $file (missing) ====="
  fi
done

echo "===== workflow permission and token references ====="
rg -n -C 5 \
  'permissions:|GITHUB_TOKEN|github\.token|secrets\.GITHUB_TOKEN|id-token|pull_request_target|pull_request|workflow_call|uses:|run:' \
  .github/workflows

Repository: sshiv012/texera

Length of output: 50372


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

echo "===== required-checks.yml ====="
cat -n .github/workflows/required-checks.yml

echo "===== permission declarations in the directly related workflows ====="
for file in .github/workflows/precheck.yml .github/workflows/build.yml; do
  echo "===== $file ====="
  rg -n -C 8 '(^|[[:space:]])permissions:|workflow_call:|workflow_dispatch:|pull_request|pull_request_target|uses: \./\.github/workflows/' "$file"
done

echo "===== callers of build.yml and required-checks.yml ====="
rg -n -C 8 'build\.yml|required-checks\.yml|needs:|permissions:' .github/workflows \
  -g '*.yml' -g '*.yaml' | head -n 800

Repository: sshiv012/texera

Length of output: 50371


Security Misconfiguration (CWE-250)

Reachability: External

Restrict workflow permissions.

permissions: write-all gives the reusable build workflow write access because it declares no narrower permissions. Set permissions: {} on required-checks and grant build only the scopes it requires, such as contents: read.

🧰 Tools
🪛 zizmor (1.29.0)

[error] 35-35: overly broad permissions (excessive-permissions): uses write-all permissions

(excessive-permissions)

🤖 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/required-checks.yml at line 35, Restrict permissions in
the required-checks workflow by replacing the top-level write-all setting with
permissions: {} and explicitly granting the reusable build workflow only its
required scopes, including contents: read. Keep all unrelated workflow behavior
unchanged.

Source: Linters/SAST tools


concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down