Skip to content

ci(trivy): authenticate to GHCR so the weekly image scan can pull - #6

Merged
jcam2803 merged 1 commit into
developfrom
claude/dependabot-security-updates-l9u9p9
Nov 20, 2026
Merged

jcam2803 merged 1 commit into
developfrom
claude/dependabot-security-updates-l9u9p9

Conversation

@jcam2803

Copy link
Copy Markdown
Member

Description

The weekly Trivy Container Vulnerability Scan scans CamCore's production image, ghcr.io/team-camcore/seerr:latest (pointed there by #2, OPS-644). It has failed on every recorded run (9, 16 and 23 October 2026), so that image has had no container vulnerability scan.

The cause is in the failed run's log (run 39956593110, 23 October 2026):

remote error: GET https://ghcr.io/token?scope=repository%3Ateam-camcore%2Fseerr%3Apull&service=ghcr.io: UNAUTHORIZED: authentication required

The GHCR package is private and the workflow never authenticated.

This change, in .github/workflows/trivy-scan.yml only:

  • adds packages: read to the job's permissions;
  • passes the workflow's own GITHUB_TOKEN to Trivy through TRIVY_USERNAME / TRIVY_PASSWORD for the registry pull.

The image is published by this repository's CamCore Seerr Image workflow with GITHUB_TOKEN, so the repository token can read it and no new secret is needed. No new action is introduced, so actions.lock is unchanged. The image, tag, schedule and SARIF upload are unchanged.

Change record: OPS-1507.

How Has This Been Tested?

  • prettier --check on the workflow: clean.
  • Parsed the YAML and confirmed the job permissions and the scan step's environment keys.
  • actionlint is not available in this environment and was not run.
  • The workflow will be run on this branch with workflow_dispatch to confirm the pull and the SARIF upload; the result is recorded in a comment below and on OPS-1507.

Screenshots / Logs (if applicable)

Checklist:

  • I have read and followed the contribution guidelines.
  • Disclosed any use of AI (prepared with Claude Code)
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • Successful build pnpm build
  • Translation keys pnpm i18n:extract
  • Database migration (if required)

Generated by Claude Code

The weekly Trivy scan targets the private CamCore image
ghcr.io/team-camcore/seerr:latest but never authenticated, so every run
failed with 'UNAUTHORIZED: authentication required'. Grant the job
packages: read and pass the workflow's own GITHUB_TOKEN to Trivy. The
image is published by this repository, so no new secret is needed.

Refs: OPS-1507

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnghqAkpHr5qF3HeAS1oti

Copy link
Copy Markdown
Member Author

Validation: ran this workflow on the PR branch with workflow_dispatch (run 44707979964, head 91709d1). It completed successfully: the Trivy image scan pulled ghcr.io/team-camcore/seerr:latest and the SARIF upload to code scanning succeeded. The previous scheduled runs failed at the scan step with UNAUTHORIZED: authentication required.


Generated by Claude Code

@jcam2803
jcam2803 marked this pull request as ready for review November 20, 2026 09:10
@jcam2803
jcam2803 merged commit 3e9f8be into develop Nov 20, 2026
8 checks passed
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