logoalt Hacker News

c16 • today at 6:00 PM • 1 reply • view on HN

I wrote my own code harness which uses Apple Containers. As part of that I wanted the container to have Github CLI access. What threw me was that if you use a gh token, it gets full access to both my personal and corporate github repos/actions etc. So I made the gh command proxy requests to my application within the container which swaps out the super secret token `4` for my actual token.

I don't know what the correct answer here is, but full access across orgs seems ... a little too permissive. Maybe I've not spent the time looking in to this, but I'm sure gh cli could enforce the use of the secure enclave / finger print scanner prior to pushing.

In the meantime, `4` protects me (as it evidently has with our CA's...)


Replies

dcrazy • today at 7:02 PM

Github has 2 kinds of Personal Access Tokens: “Classic” and “fine-grained.” Fine-grained tokens can (actually, must) be restricted to a single organization. But they can’t do everything a classic PAT can do.