Request for Least-Privilege Scope for Environment Management via API #188666
Replies: 2 comments
-
|
π¬ Your Product Feedback Has Been Submitted π Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward β©
Where to look to see what's shipping π
What you can do in the meantime π»
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. β |
Beta Was this translation helpful? Give feedback.
-
|
Welcome to the GitHub Community, @amangrover90, we're happy you're here! You are more likely to get a useful response if you are posting your question(s) in the applicable category. I've gone ahead and moved this to the API & Webhooks category for you. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What GitHub Actions topic or product is this about?
General
Discussion Details
Subject: Request for Least-Privilege Scope for Environment Management via API
Summary
Currently, creating or updating environments via the REST API requires a personal access token (PAT) or GitHub App with Administration: Read & Write repository permission. This affects both classic apps and fine-grained PATs, even when a dedicated Environments: Read & Write scope is available.
Problem
Granting βAdministration: Writeβ permission gives tokens far broader access than necessary for merely managing environments. This permission includes highly sensitive operations such as repository transfer, deleting the repository, or changing settings. This violates the principle of least privilege and increases both the attack surface and organizational risk.
Expected/Desired Behavior
It should be possible to:
Use Cases
Current Behavior
Any attempt to use the environments API (REST docs reference) with a token lacking βAdministration: Writeβ fails with:
Even if the token has Environments: Write, the 403 persists unless administrative rights are added.
Request
Additional Context
Thanks for considering this improvement! Supporting least-privilege access aligns with security best practices and the expectations set by the introduction of dedicated token scopes.
Beta Was this translation helpful? Give feedback.
All reactions