GitHub App Project Permissions: A Hurdle for Secure Automation and Developer Productivity
The Unintended Power of GitHub App Project Permissions
In the quest to enhance how to measure productivity of software developers and streamline workflows, automation plays a pivotal role. GitHub Apps are designed to be powerful tools for this, offering granular permissions and ephemeral tokens for secure integrations. However, a recent community discussion highlighted a significant challenge concerning GitHub App installation tokens and their interaction with organization-level project permissions. This issue, raised by user alpar-t, points to a potential security vulnerability and a major roadblock for large organizations aiming for secure, scalable project automation.
The Core Problem: Bypassing Base Roles
The discussion, titled "GitHub App tokens with organization_projects:write bypass per-project base role settings," details how an App installation token with organization_projects: write permission overrides the base role settings of individual projects. This means that even if an organization-level ProjectV2 has its base role explicitly set to "Read" for all organization members, a GitHub App token can still write to it.
This behavior is particularly concerning because classic Personal Access Tokens (PATs) with the project scope correctly respect these base role settings. The unexpected discrepancy makes GitHub Apps, which are generally considered more secure due to their ephemeral nature and finer-grained control, less safe than classic PATs for project automation in this specific context.
The author provided a clear reproduction path using GraphQL:
{ node(id: "PROJECT_NODE_ID") { ... on ProjectV2 { viewerCanUpdate } } }When run with an App installation token, this query unexpectedly returns viewerCanUpdate: true for a read-only project, confirming the bypass.
Impact on Organizations and Developer Productivity
For organizations managing a large number of projects – some with over a thousand, including public-facing roadmaps – this issue creates a severe security and operational challenge. Since there's no way to scope organization_projects to specific projects (it's an all-or-nothing permission at the organizational level), granting write access to an App effectively gives it unrestricted write access to every single project in the organization.
This lack of granular control forces teams to make a difficult choice: either risk broad project access with GitHub Apps or fall back to less secure classic PATs, which lack the benefits of ephemeral tokens and fine-grained permissions. This directly hinders efforts to securely automate project management, impacting the efficiency and security of developer workflows, and making it harder to maintain high kpis for engineering teams related to project delivery and security.
Proposed Solutions for Enhanced Control
To address these critical concerns and truly empower organizations to leverage GitHub Apps for project automation, the discussion proposed three key feature requests:
- GitHub App tokens should respect project base roles: Consistency with classic PATs is crucial. An App token should be read-only on a project unless explicitly granted write access as a collaborator.
- Per-project scoping for
organization_projects: This is identified as the most impactful change. Allowing Apps to request access to specific projects during installation, similar to repository permissions, would provide the necessary granular control. This would significantly improve the security posture and enable more targeted automation, directly contributing to a more efficient environment where it's easier to measure productivity of software developers. - Document the current behavior: If the current behavior is intentional, it needs to be clearly documented to prevent unexpected security implications.
Community Acknowledgment, But No Resolution
Unfortunately, the discussion was closed by github-actions due to not being submitted through the expected format/template. While this means the immediate conversation was cut short, the underlying issue remains a significant concern for organizations striving for secure and productive development environments.
Achieving secure, scalable automation is fundamental to improving how to measure productivity of software developers and ensuring smooth project delivery. Granular permissions for GitHub Apps are not just a convenience; they are a necessity for maintaining security and fostering trust in automated workflows across large, complex organizations.
