Skip to content

Harden manual-dispatch workflows and resolve CKV_GHA_7 linter failures - #8

Merged
austinsager merged 2 commits into
kiwifrom
copilot/fix-github-actions-linter-job
Sep 7, 2026
Merged

austinsager merged 2 commits into
kiwifrom
copilot/fix-github-actions-linter-job

Conversation

Copilot AI commented Sep 7, 2026

Copy link
Copy Markdown

Run source-code linter was failing on CKV_GHA_7 across admin workflows using workflow_dispatch.inputs. This PR keeps required manual controls but makes the rule handling explicit and tightens input handling in shell-executed paths.

  • Checkov suppression alignment (CKV_GHA_7)

    • Normalized explicit CKV_GHA_7 skip directives on manual-dispatch workflows flagged in CI.
    • Added/updated scoped skip placement for:
      • build_and_sign_release_apk.yml
      • rename_directory.yml
      • delete_committed_file.yml
      • import_file_from_chromium.yml
      • download_icon_from_fontawesome.yml
      • update_chromium_files.yml (also flagged in the failing run)
  • Input-safety hardening for shell execution

    • Replaced inline ${{ github.event.inputs.* }} in run: commands with env-mapped variables.
    • Added validation guards for user-controlled values (path traversal checks, newline rejection, format checks).
    • Applied safe argument passing (-- and quoted expansions) where paths feed git/shell operations.
  • Workflow-specific tightening

    • rename_directory.yml: validates source/destination paths before git mv.
    • delete_committed_file.yml: validates filename and safely injects target into history-rewrite command.
    • import_file_from_chromium.yml: validates import path before download/decode/add flow.
    • download_icon_from_fontawesome.yml: whitelists icon type, validates icon name and output filename, validates optional hex fill color.
    • build_and_sign_release_apk.yml: constrains manual toggles to explicit choice values and replaces contains() checks with strict equality.
- name: Rename directory
  env:
    SOURCE_DIRECTORY: ${{ github.event.inputs.source_directory }}
    DESTINATION_DIRECTORY: ${{ github.event.inputs.destination_directory }}
  run: git mv -- "$SOURCE_DIRECTORY" "$DESTINATION_DIRECTORY"

Copilot AI and others added 2 commits September 7, 2026 16:34
…essions

Co-authored-by: austinsager <294792209+austinsager@users.noreply.github.com>
Co-authored-by: austinsager <294792209+austinsager@users.noreply.github.com>
@austinsager
austinsager marked this pull request as ready for review September 7, 2026 16:42
Copilot AI lite review requested due to automatic review settings September 7, 2026 16:42
@austinsager
austinsager merged commit f2523b9 into kiwi Sep 7, 2026
3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

A few newly added input-validation checks still allow unsafe/pathspec patterns (and one hex-color regex is overly permissive), leaving avoidable gaps in the stated hardening.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR addresses Checkov CKV_GHA_7 findings in admin/maintenance workflow_dispatch workflows while hardening several user-controlled inputs that flow into shell/git operations.

Changes:

  • Normalizes CKV_GHA_7 skip directives on affected manual-dispatch workflows.
  • Adds/expands validation and safer argument passing for workflow inputs used in shell commands.
  • Tightens release workflow toggles by converting booleans to explicit choice inputs and using strict equality in if: conditions.
File summaries
File Description
.github/workflows/update_chromium_files.yml Adds CKV_GHA_7 suppression alignment and validates Chromium version components as numeric.
.github/workflows/rename_directory.yml Adds path validation and uses env-mapped, quoted args with git mv --.
.github/workflows/import_file_from_chromium.yml Adds import-path validation and switches URL construction to env-mapped variables.
.github/workflows/download_icon_from_fontawesome.yml Adds input validation and switches script invocation to env-mapped variables with safe quoting.
.github/workflows/delete_committed_file.yml Adds filename validation and safer injection of the target into the history-rewrite command.
.github/workflows/build_and_sign_release_apk.yml Converts manual toggles to choice inputs and replaces contains() checks with strict equality.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 4
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

FILENAME: ${{ github.event.inputs.filename }}
run: |
git filter-branch --force --index-filter "git rm --cached --ignore-unmatch ${{ github.event.inputs.filename }}" --prune-empty --tag-name-filter cat -- --all
if [ -z "$FILENAME" ] || [ "${FILENAME#/}" != "$FILENAME" ] || [ "${FILENAME#../}" != "$FILENAME" ] || [[ "$FILENAME" == *"/../"* ]] || [[ "$FILENAME" == *"'"* ]] || [[ "$FILENAME" == *$'\n'* ]]; then
Comment on lines +79 to +82
if [ -z "$FILE_NAME_IN_CHROMIUM" ] || [[ "$FILE_NAME_IN_CHROMIUM" == */* ]] || [[ "$FILE_NAME_IN_CHROMIUM" == *$'\n'* ]]; then
echo "::error::Invalid Chromium icon filename: $FILE_NAME_IN_CHROMIUM"
exit 1
fi
exit 1
fi

if [ -n "$FILL_COLOR" ] && [[ ! "$FILL_COLOR" =~ ^#[0-9A-Fa-f]{3,8}$ ]]; then
DESTINATION_DIRECTORY: ${{ github.event.inputs.destination_directory }}
run: |
for path_value in "$SOURCE_DIRECTORY" "$DESTINATION_DIRECTORY"; do
if [ -z "$path_value" ] || [ "${path_value#/}" != "$path_value" ] || [ "${path_value#../}" != "$path_value" ] || [[ "$path_value" == *"/../"* ]] || [[ "$path_value" == *$'\n'* ]]; then
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants