News for hackers. Stuff that matters.
Re:Read-only deploy keys by mdaniel on Tuesday June 16, 2015 @04:43PM (#9728572)
I don't know about your use-case, but in my experience by far the greatest use of these keys is (as they say in the linked article) for use by continuous integration servers. Some folks tag each build (if it creates an artifact), and almost everyone tags release builds created by CI. Thus, these keys need to be R/W to push tags back up.
Re:Read-only deploy keys by ctz on Tuesday June 16, 2015 @05:26PM (#9728798)
Pushing a new tag is a vastly smaller privilege than pushing arbitrary objects.
Re:Read-only deploy keys by myhf on Tuesday June 16, 2015 @05:40PM (#9728875)
Actually, pushing objects is a smaller privilege.
Re:Read-only deploy keys by Dylan16807 on Tuesday June 16, 2015 @05:50PM (#9728926)
Fine, let's be picky. Pushing a new tag onto an existing commit is a vastly smaller privilege than being able to push objects and point branches at them.
Re:Read-only deploy keys by eeeeeeeeeeeee on Tuesday June 16, 2015 @11:23PM (#9729919)
You can have a read-write user on your CI server, but use a read-only user for any remote server where code is deployed. It's bad security policy that GitHub ever allowed deploy keys to be RW.
Re:Read-only deploy keys by DannyBee on Tuesday June 16, 2015 @04:57PM (#9728646)
Re:Read-only deploy keys by bobfunk on Tuesday June 16, 2015 @05:45PM (#9728904)
API access is a lot more permissive. A deploy key only have access to 1 repo, but there's no way to limit API tokens to a single repo (and by default they have access to all repos in all organizations the issuer of a token have access to).
Re:Read-only deploy keys by DannyBee on Tuesday June 16, 2015 @06:26PM (#9729095)
Yes, I didn't realize how bad github's security model of this stuff was.
Re:Read-only deploy keys by Danack on Tuesday June 16, 2015 @08:26PM (#9729461)
Yeah, it's terrible.

You can't give read only Oauth access to private repos....it has to be read/write. Which means if you want to use online CI tools with those private repos....you've got to hope they don't either turn malicious, or they get hacked and have their keys copied.

Re:Read-only deploy keys by icebraining on Tuesday June 16, 2015 @05:51PM (#9728929)
Can you limit the user permissions to only affect tags? Otherwise, I'm not seeing the advantage.

From what I can tell, there's no write:tags scope: https://developer.github.com/v3/oauth/#scopes

Re:Read-only deploy keys by DannyBee on Tuesday June 16, 2015 @06:26PM (#9729093)
Ugh. You are right, it looks like they screwed this up.
Re:Read-only deploy keys by sytse on Wednesday June 17, 2015 @05:26AM (#9730753)
I don't understand, won't you tag a release commit first manually and than have it be created by the CI server?
Re:Read-only deploy keys by llasram on Wednesday June 17, 2015 @05:46AM (#9730805)
Some people using manual tagging as a mechanism to communicate something to CI as you suggest, but others let CI tag successful builds. When I re-did my team's CI a few years ago I chose the latter because it creates less friction for continuous deployment -- every commit which passes the tests automatically becomes a deployable artifact with a monotonically increasing build number which can be tracked across SCM, CI, and deployment.
Re:Read-only deploy keys by sytse on Wednesday June 17, 2015 @06:54AM (#9730983)
Why not use the sha as the build identifier across SCM, CI and deployment? It exists already.
Re:Read-only deploy keys by mdaniel on Wednesday June 17, 2015 @04:22PM (#9734982)
Heh, you've never worked with a project/product manager, have you? "Yes, ma'am, version 1b6411f has been deployed successfully. Now I just need to edit the pom and bump the version to 2e1080d"
Re:Read-only deploy keys by sytse on Thursday June 18, 2015 @08:13AM (#9738053)
Good point, but if you bump the version yourself why not set a tag?