Skip to content

Conversation

@vladd-bit
Copy link
Member

Potential fix for https://github.com/CogStack/ocr-service/security/code-scanning/3

To fix the problem, explicitly restrict the GITHUB_TOKEN permissions used by this workflow to the minimal set required. Since this workflow only checks out code and runs Docker-based smoke tests, it only needs read access to repository contents. It does not appear to need to write to the repo, issues, or pull requests, nor to access other privileged scopes.

The best way to fix this without changing functionality is to add a permissions block at the top (root) level of .github/workflows/docker_smoke.yml, so it applies to all jobs. Right after the on: block (or just after the name), add:

permissions:
  contents: read

No additional imports or methods are needed; this is purely a YAML configuration hardening change. Concretely, in .github/workflows/docker_smoke.yml, insert the permissions section between the on: block (line 3–8) and the jobs: key (line 10). This will ensure the GITHUB_TOKEN only has read access to repository contents for all jobs in this workflow.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@vladd-bit vladd-bit marked this pull request as ready for review December 19, 2025 14:08
@vladd-bit vladd-bit merged commit f69afc8 into main Dec 19, 2025
10 checks passed
@vladd-bit vladd-bit deleted the alert-autofix-3 branch December 19, 2025 14:08
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