Skip to content

Lock down what the automated workflows are allowed to do - #95

Open
ianktoo wants to merge 1 commit into
masterfrom
ci/least-privilege-permissions
Open

ianktoo wants to merge 1 commit into
masterfrom
ci/least-privilege-permissions

Conversation

@ianktoo

@ianktoo ianktoo commented Nov 15, 2026

Copy link
Copy Markdown
Owner

Closes #89.

What was affected

The project's automated workflows (testing, building the downloadable programs, publishing to PyPI, and the post-release check) had no limits on what they were allowed to do. By default each one received broad access to the repository.

The publishing workflow also had two smaller problems:

  • It installed packages without using the exact versions that were tested, so what got published could differ from what passed testing.
  • It ran the whole test suite a second time right after the same suite had already passed, which only slowed releases down.

How it affects the app

Nothing changes for people using DataForge. The risk was behind the scenes: if a third-party step in one of these workflows were ever compromised, it would have had more access than it needs, in the same workflow that publishes DataForge to PyPI. And a published release could, in theory, contain different package versions from the tested ones.

The fix

  • Every workflow now starts with read-only access to the repository. Steps that genuinely need more (creating a release, publishing to PyPI) still ask for exactly that and nothing else.
  • The publishing workflow now installs the exact tested package versions.
  • Removed the duplicate test run. The publishing workflow still refuses to proceed unless the full test suite has passed first.

Status

  • Ready for review. Only workflow settings changed, no application code.
  • The automated checks on this PR run the normal test workflow. The release and publishing workflows only run when a version tag is pushed, so their changes will first be exercised on the next release. They were checked for valid syntax, and the permissions each step needs were reviewed by hand.

…s in publish

Refs #89

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

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.

ci: workflows lack least-privilege permissions and publish uses a non-frozen sync

1 participant