BarkleyGitHub
Controls · ACC
Markdown file

Your GitHub account

Whoever controls your GitHub account controls what every user of your app installs next. Nothing in the repository can protect against a stolen login.

From the 2026 sweepOf the 137 accounts that publish five or more apps, 72 (52.6%) have only ever had one account publish releases. If that one login is stolen, there's no second maintainer to notice or step in. The Marketplace report has more on this.

Controls

  1. ACC-1Level 1Turn on two-factor login with a passkey or a security key.

    Why A common way to take over an account is a page that looks like a real login. A password and an authenticator code work on any site you type them into, and a lookalike can pass them straight on to the real one. A passkey or security key only works on the site it was made for. In 2025, phishing like this was used to publish malware from maintainers' accounts on both PyPI and npm (how it happened).

    Settings → Password and authentication. An authenticator app is fine as a second method. Avoid SMS. Store the recovery codes somewhere offline.

  2. ACC-2Level 1Replace classic personal access tokens with fine-grained ones.

    Why A token works for anyone who has a copy, with no password or 2FA, and copies end up in CI secrets, .env files and old laptops. A classic token can act on every repository you can reach and never expires. A fine-grained one only reaches the repository and permissions you gave it, until its expiry date. The Shai-Hulud worm collected tokens like these from developers' machines and CI in 2025 (how it happened).

    Settings → Developer settings → Personal access tokens. Give each token one repository, only the permissions it needs, and an expiry date. Delete tokens you no longer use.

  3. ACC-3Level 1Review what can act for you.

    Why Every OAuth app, GitHub App, SSH key and signed-in session can act for you without your password, and each is another way into your account. Some were probably added years ago for something you no longer use. After the Shai-Hulud worm, CISA's advice included removing the GitHub Apps and OAuth apps you don't need (how it happened).

    Settings → Applications (OAuth apps and GitHub Apps), SSH keys, and Sessions. Remove anything you don't recognize or no longer use.

  4. ACC-4Level 2Level markerSign your commits.

    Why Git lets anyone put any name and email on a commit. A signature can't be made without your key, so signed commits let people tell your work from a commit pushed with a stolen token or written to look like yours. In 2021, two malicious commits were pushed to PHP's source code in the names of two of its core developers (PHP's announcement).

    An SSH key is the simplest way. You can use the one you already push with.

    1. If you don't have an SSH key, run ssh-keygen -t ed25519. It saves the public half as ~/.ssh/id_ed25519.pub.
    2. Tell Git to sign every commit and tag with it.
      Terminal
      git config --global gpg.format ssh
      git config --global user.signingkey ~/.ssh/id_ed25519.pub
      git config --global commit.gpgsign true
      git config --global tag.gpgsign true
      Change the path if your key has a different name.
    3. Give GitHub the public key, so it can check your signatures. Until you do, your signed commits show "Unverified". In Settings → SSH and GPG keys, choose New SSH key, set Key type to Signing Key, and paste the line that cat ~/.ssh/id_ed25519.pub prints. Only share the file ending in .pub. The one without .pub is your private key. From a terminal, the GitHub CLI can do it instead:
      Terminal
      gh auth refresh -h github.com -s admin:ssh_signing_key
      gh ssh-key add ~/.ssh/id_ed25519.pub --type signing --title "My laptop"
      A key you already added for pushing has to be added again as a signing key.

    Where the private key is kept decides what someone gets if they copy your files or run code on your machine:

    Where the key isSomeone copies your filesMalware runs as youDay to day
    A file with no passphraseThey have your keyCan signNothing to type
    A file with a passphrase, loaded into the SSH agentUseless without the passphraseCan sign while the key is loadedUnlock once per login. macOS can keep the passphrase in Keychain.
    A password manager's SSH agentThere's no key fileAsks before each app uses the keyApprove each app
    A security key (ssh-keygen -t ed25519-sk)The key never leaves the hardwareNeeds a touch for every signatureA touch for every commit, so a rebase of 20 commits is 20 touches

    With a password manager, its own instructions give the value for user.signingkey. GPG keys work too, with GitHub's GPG instructions.

    In a codespace you don't need a key of your own. Turn on Settings → Codespaces → GPG verification for the repositories you trust, and GitHub signs the commits you make there. Commits you make on GitHub's website are signed by GitHub already.

  5. ACC-5Level 2Then turn on vigilant mode.

    Why Signing only helps if an unsigned commit in your name stands out. Without vigilant mode, GitHub shows an unsigned commit with no label, like most commits. With it on, an unsigned commit in your name shows "Unverified".

    On the same page, tick "Flag unsigned commits as unverified". Any commit with your name that you didn't sign then shows "Unverified", including one pushed with a stolen token. Wait until a commit you push shows "Verified", or your own commits show "Unverified" too.

  6. ACC-6Level 2Give the project a second maintainer, or at least a plan.

    Why When one person can publish, nobody notices an odd release from that account, and nobody can step in if that person loses access or moves on. If its maintainer leaves without a plan, a project can pass to whoever asks for it. In 2018, someone posing as a maintainer took over the event-stream package on npm and added code that stole from bitcoin wallets (how it happened).

    A free GitHub organization lets several people share a project and can require two-factor login for all of them. Organizations covers when it's worth it. If you're on your own, write down in the README who can take over.

Check it worked

Settings → Password and authentication lists a passkey or security key. Settings → Developer settings shows no classic tokens. Your recent commits show "Verified".

Barkley shows who has published an app's releases and flags a release from a new publisher. It can't see how an account is protected.

Open the full page