News for hackers. Stuff that matters.
Re:Okta says its GitHub account hacked, source code stolen by IanCal on Wednesday December 21, 2022 @04:41AM (#34078548)
> - It only says "access to code repositories" (it does not say anything about the level of that access, it might as well mean write access, capability to trigger actions etc.)

Given the exceptionally broad granularity of github permissions with oauth at least I'd be concerned. I've repeatedly had to avoid using something because while I wanted to grant permission to, say, read one particular repo I'd have to allow write access to all private repos. Githubs solution is to give broad access to a user that has limited access, although then they shout at you for creating more users if you're not a paying member yourself (but may be in an organisation).

https://docs.github.com/en/developers/apps/building-oauth-ap...

Re:Okta says its GitHub account hacked, source code stolen by e1g on Wednesday December 21, 2022 @04:46AM (#34078578)
GitHub recently introduced fine-grained tokens that can be scoped to a single repository that might work for your use-case https://github.blog/2022-10-18-introducing-fine-grained-pers...
Re:Okta says its GitHub account hacked, source code stolen by ChymeraXYZ on Wednesday December 21, 2022 @05:16AM (#34078808)
Unfortunately this only seems to be available for repos you own yourself and not if an org owns the repo, making it useless in a company context until that is expanded. Great for personal stuff tho.
Re:Okta says its GitHub account hacked, source code stolen by e1g on Wednesday December 21, 2022 @05:31AM (#34078907)
They work, but the organization needs to approve the token (and its scope). As the org manager, I prefer it this way because I can audit what access developers give out to what repositories.

The new tokens are still in Beta, so there are some other limitations: for example, GitHub Packages do not support them yet, so you cannot use them in Yarn/NPM to get private packages hosted on GitHub.

Re:Okta says its GitHub account hacked, source code stolen by Aeolun on Wednesday December 21, 2022 @06:30AM (#34079284)
Doesn't this rather defeat the point? If using a PAT is simpler than using the org token then I'll just use a PAT that has access to every single repository in the org.
Re:Okta says its GitHub account hacked, source code stolen by e1g on Wednesday December 21, 2022 @06:59AM (#34079513)
GitHub Org admins have the option to block all regular PATs, and only allow fine-grained tokens that they pre-approve. This block is “off” by default, but I expect the best practice soon will be to enforce this rule.
Re:Okta says its GitHub account hacked, source code stolen by Aeolun on Wednesday December 21, 2022 @08:02AM (#34080155)
Oh, aside from the pre-approval, that would be really nice. I need stuff scoped to the org that is not necessarily connected to my personal account (and all it’s repositories).
Re:Okta says its GitHub account hacked, source code stolen by drothlis on Wednesday December 21, 2022 @05:24AM (#34078853)
Fine-grained access tokens are available on org-owned repos too, but the org has to opt in (for some reason).
Re:Okta says its GitHub account hacked, source code stolen by likeclockwork on Wednesday December 21, 2022 @08:51AM (#34080701)
GitLab has had this feature for years.
Re:Okta says its GitHub account hacked, source code stolen by twistedpair on Wednesday December 21, 2022 @09:46AM (#34081334)
I'm excited for FGPATs, but they're still in beta and still have a lot of shortcomings at this time.
Re:Okta says its GitHub account hacked, source code stolen by awinter-py on Wednesday December 21, 2022 @09:51AM (#34081400)
overbroad roles + permissions is such a problem on every platform. github surprisingly bad given their technical sophistication overall

on my long-term wishlist: a standard way to aspirationally reduce your permissions footprint

like if I'm a twitter plugin, and I need one operation for which there is only a broad permission, I request the broad permission ('read and write everything'), but include an optional manifest making it clear that I only need the one action ('add followers')

this 1) enables a linter ecosystem to verify my footprint is narrower than it seems, and 2) over time lets the platform tailor offer narrower perms based on observed use-cases

permissions matter bc users can audit them more easily than code