Feature Request: Allow Public Key Registration for GitHub Apps #176838
Replies: 1 comment
-
💬 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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Product Feedback
Body
Hello GitHub Community and Staff,
I'd like to propose a security enhancement for the GitHub App authentication flow. Currently, when creating a GitHub App, the private key is generated by GitHub and then provided to the user for download. I suggest an alternative and more secure workflow: allow users to generate their own key pair and register the public key with GitHub.
This approach would align better with cryptographic best practices and resolve a few security anti-patterns encouraged by the current workflow:
Improves Chain of Custody
The current process requires the private key to be downloaded from GitHub, often passing through a developer's machine. This breaks a secure chain of custody. Ideally, a private key should never leave the secure environment where it was generated (like a KMS, HSM, or secure server). By allowing public key registration, developers could generate the private key in their secure infrastructure and only expose the public portion, significantly reducing the risk of key compromise.
Strengthens the Asymmetric Security Model
When GitHub generates the private key, it technically has knowledge of both the private and public keys. This diminishes the benefit of asymmetric cryptography, where the private key is known only to the user. If the secret is known by both parties at any point, the model begins to resemble a symmetric key exchange. Allowing users to provide their own public key would enforce a true asymmetric model where GitHub only ever knows the public key.
As a side note, this is also more aligned with a Message Authentication Code (HS256), which is an alternative given that it would already be safe against Quantum Computers without requiring a migration to the new PQC safe signing algorithms in the medium/long term.
Security best practices call for regular key rotation. While a user could build automation around the GitHub API, the current flow requires a manual step: generating a new key in the GitHub UI and securely transporting it back to the application.
If we could register public keys via the API, we could build fully automated. An application could:
Generate a new key pair within its secure environment.
Register the new public key with GitHub via an API call.
Begin signing JWTs with the new private key once the new public key has propagated.
Deprecate the old key.
Thanks for your consideration!
Beta Was this translation helpful? Give feedback.
All reactions