Skip to content

Scope admin app tokens to least-privilege permissions - #49

Open
rgarcia wants to merge 2 commits into
mainfrom
hypeship/scope-admin-app-tokens
Open

rgarcia wants to merge 2 commits into
mainfrom
hypeship/scope-admin-app-tokens

Conversation

@rgarcia

@rgarcia rgarcia commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

actions/create-github-app-token called without any permission-* inputs mints a token carrying every permission the app installation holds, including administration and workflows write. This PR requests only what each token is used for downstream. Repository scope is unchanged unless noted.

Workflow Job Before After Why
vuln-remediation.yml scan all app permissions on the calling repo contents: read used only by actions/checkout

This one matters more than most. Checkout persists the token in .git/config, and the same job then runs npm install -g @socketsecurity/cli and the Socket scan. Every repo that calls this reusable workflow gave that third-party code a token with admin and workflow write on its own repo. The fix and pr tokens in this workflow already had permission filters and are unchanged.

That checkout now also sets persist-credentials: false, so the token isn't left in .git/config while the Socket CLI installs and runs. The scan reads the local tree and never uses git credentials.

Testing

  • python3 -m unittest discover -s scripts -p test_vuln_remediation_workflow.py: 20 OK.
  • actionlint: no findings.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant