Skip to content

fix(ci): standardize GHCR auth on self-hosted workflows - #623

Closed
POWERFULMOVES wants to merge 9 commits into
PMOVES.AI-Edition-Hardenedfrom
pr/hardened-ghcr-standardize
Closed

POWERFULMOVES wants to merge 9 commits into
PMOVES.AI-Edition-Hardenedfrom
pr/hardened-ghcr-standardize

Conversation

@POWERFULMOVES

Copy link
Copy Markdown
Owner

Summary\n- standardize GHCR auth inputs across self-hosted workflows using GHCR_USERNAME/GHCR_TOKEN with safe fallbacks\n- keep github.token as the default path while supporting PAT override for runner/service-account scenarios\n- add explicit packages: write permission in the deprecated self-hosted workflow to avoid token-scope drift\n- update secrets onboarding + CI image docs with PAT username/token pairing guidance\n\n## Why\nSome runs fail at docker/login-action@v3 with denied: denied when a PAT is used without a matching username or when workflow token scopes differ across runners. This makes GHCR auth deterministic for hardened/self-hosted pipelines.\n\n## Validation\n- parsed updated workflow YAML files via python + yaml.safe_load\n- manually audited login-action steps in:\n - .github/workflows/integrations-ghcr.yml\n - .github/workflows/build-images.yml\n - .github/workflows/self-hosted-builds.yml\n - .github/workflows/self-hosted-builds-hardened.yml\n

@coderabbitai

coderabbitai Bot commented Feb 14, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch pr/hardened-ghcr-standardize

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ec432ca931

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

REGISTRY: ghcr.io
IMAGE_PREFIX: ghcr.io/${{ github.repository_owner }}
GHCR_USERNAME: ${{ secrets.GHCR_USERNAME || github.actor }}
GHCR_PASSWORD: ${{ secrets.GHCR_TOKEN || secrets.GH_PAT_PUBLISH || github.token }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Prefer github.token before legacy PAT fallback

This fallback order makes GH_PAT_PUBLISH win over github.token, so any repo that keeps GH_PAT_PUBLISH for clone-only use (without write:packages) will now fail GHCR auth in docker/login-action even though the workflow already grants packages: write and github.token would succeed; the same pattern was added in build-images.yml and self-hosted-builds-hardened.yml, so GHCR publishing can regress across self-hosted pipelines unless the default is switched back to github.token (with PAT only as an explicit override).

Useful? React with 👍 / 👎.

Comment on lines +287 to +289
if [ -z "$PRIMARY_TAG" ]; then
echo "::warning::No tags generated; GHCR login failed and Docker Hub credentials are absent. Build/push, scan, and sign steps will be skipped."
echo "has_tags=false" >> $GITHUB_OUTPUT

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Fail the workflow when no publish tags are produced

In .github/workflows/integrations-ghcr.yml, when GHCR login fails and Docker Hub creds are absent, this block only emits a warning and sets has_tags=false, and all build/push/scan/sign steps are then skipped by if: steps.meta.outputs.has_tags == 'true'; on push/scheduled runs that means the job can pass green while publishing and security scans never ran, which hides release failures instead of surfacing them.

Useful? React with 👍 / 👎.

@POWERFULMOVES

Copy link
Copy Markdown
Owner Author

Operator note for GHCR auth validation:\n\n- This branch now supports PAT fallback via GHCR_TOKEN / GH_PAT_PUBLISH with explicit GHCR_USERNAME.\n- Current repo secrets already include GHCR_USERNAME and GH_PAT_PUBLISH; if login still fails, rotate GH_PAT_PUBLISH to a token with write:packages +
ead:packages (and
epo for private clones).\n- If you prefer GitHub token only, remove PAT overrides and ensure workflow/job packages: write remains enabled.\n

@POWERFULMOVES

Copy link
Copy Markdown
Owner Author

Added a follow-up CI integrity commit for production audit readiness:

  • fix(ci): resolve workflow-file blockers for codeql and secret sync
    • moved paths-ignore under on.push / on.pull_request in .github/workflows/codeql.yml
    • removed workflow-expression parse break in .github/workflows/sync-secrets-local.yml by avoiding a literal ${{ token in inline Python and fixed name/label logging bug

This should eliminate the immediate 0s "workflow file issue" failures seen on prior SHA runs; old failed checks on earlier commits are expected/stale.

@github-actions

Copy link
Copy Markdown
Contributor

Docker Hardening Validation

Hardening Validation Report

Validated: Sun 15 Feb 2026 02:48:15 PM UTC

Services Checked

PMOVES.AI Docker Hardening Validation

[INFO] Checking: pmoves/docker-compose.hardened.yml

[INFO] Validating: hi-rag-gateway-v2
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: extract-worker
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: langextract
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: presign
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: render-webhook
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: retrieval-eval
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: pdf-ingest
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: jellyfin-bridge
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: invidious-companion-proxy
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: ffmpeg-whisper
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: media-video
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: media-audio
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: hi-rag-gateway-v2-gpu
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: hi-rag-gateway-gpu
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: deepresearch
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: supaserch
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: publisher-discord
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: mesh-agent
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: nats-echo-req
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: nats-echo-res
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: publisher
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: analysis-echo
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: graph-linker
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: comfy-watcher
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: grayjay-plugin-host
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: agent-zero
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: archon
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: channel-monitor
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: pmoves-yt
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: notebook-sync
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: supabase_service_role_key
[WARN] No user directive
[WARN] No read_only directive
[WARN] No cap_drop: ["ALL"]
[WARN] No no-new-privileges
[WARN] No resource limits

[INFO] Validating: supabase_jwt_secret
[WARN] No user directive
[WARN] No read_only directive
[WARN] No cap_drop: ["ALL"]
[WARN] No no-new-privileges
[WARN] No resource limits

======================================
Summary: 120 passed, 40 warnings, 0 errors

@POWERFULMOVES

Copy link
Copy Markdown
Owner Author

Superseded by #624 merge into PMOVES.AI-Edition-Hardened (CI/hardening and integration gate fixes now landed there). Closing to avoid duplicate/conflicting workflow edits.

@POWERFULMOVES
POWERFULMOVES deleted the pr/hardened-ghcr-standardize branch March 7, 2026 21:48
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.

2 participants