grafana/grafana
Access control / Privilege escalation in CI automation via GitHub App tokens
MEDIUM
This commit implements CI security hardening by replacing broad automation tokens with a dedicated GitHub App (grafana-pr-automation) and context-sensitive permission sets for actions such as tagging, PR migration, and security-mirror writes. Previously, CI workflows could rely on tokens with broader permissions (e.g., delivery bot or default GITHUB_TOKEN) to perform privileged tasks like creating annotated tags or writing to repos, which could be exploited if those tokens were leaked or misconfigured. The changes:
- Switch token source from a generic/app with wide permissions to a GitHub App with restricted permission_set per action context (writer-release, writer-main, pr-writer-*, etc.).
- Scope token usage to specific repositories (also enabling a dedicated security-mirror-writer for the security mirror repo).
- Use app tokens for privileged steps (e.g., annotated tag creation) instead of the default GITHUB_TOKEN.
- Remove some heavy release steps (publish-dockerhub, meticulous tests) that could broaden the blast radius of token usage during releases.
The net effect is a reduction in privilege and blast radius for CI automation, mitigating a potential access-control/privilege-escalation risk in release workflows where leakage or misuse of automation tokens could lead to unauthorized tagging, PR migrations, or repository edits. While the fix is applied in CI configuration rather than in Grafana core code, it addresses a real security concern around CI token permissions and automated release artifacts.
Commit: c3504a7f
Affected: <=12.4.0
2026-06-08 11:41