Skip to content

M1: Add explicit least-privilege permissions to .github/workflows/ci.yml #82

Backlog

Description

@h45sh

Context

.github/workflows/ci.yml:1-28 omits a top-level permissions: block (and job-level permissions: blocks), whereas .github/workflows/docs.yml:26, codeql.yml:31, release.yml:24, and sync-main-to-dev.yml:8 all declare explicit permissions:.

On repositories or forks where the default GITHUB_TOKEN permission is read-write, lint, test, and test-macos jobs inherit write permissions unnecessarily.

Proof

Parsed all workflow files in .github/workflows/ at origin/dev@db5fc07 with PyYAML:

/home/harsh/Documents/ether/.venv/bin/python3 -c "
import yaml
from pathlib import Path
for p in sorted(Path('/tmp/ether-audit-A/.github/workflows').glob('*.yml')):
    d = yaml.safe_load(p.read_text())
    print(p.name, 'top:', 'permissions' in d, 'jobs:', {k: ('permissions' in v) for k, v in (d.get('jobs') or {}).items()})
"
# ci.yml top: False jobs: {'lint': False, 'test': False, 'test-macos': False}
# codeql.yml top: False jobs: {'analyze': True}
# docs.yml top: True jobs: {'claims': False}
# release.yml top: True jobs: {'pypi-release': True, 'docker-release': True}
# sync-main-to-dev.yml top: True jobs: {'sync-dev': False}

Impact

Violates least-privilege GITHUB_TOKEN hardening on PR and push CI runs in repositories with permissive default token settings. Does not affect runtime GatePolicy.SAFE enforcement.

Acceptance criteria

  • Add top-level permissions:\n contents: read to .github/workflows/ci.yml
  • Verify all CI jobs (lint, test, test-macos) pass with contents: read

Out of scope

Modifying permissions in other workflow files.

Part of #24


audit:self · run 2026-12-03 · ref origin/dev@db5fc07 · cell interface×supply

Activity

  1. added this to the M1 Truth milestone on Dec 1, 2026
  2. added
    type:task
    area:packaging
    on Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:packagingpriority:P3type:task

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions