Skip to content

nightly-security-audit workflow runs with permissions: contents: write - least privilege violated #1207

Description

@nanaf6203-bit

Context: .github/workflows/nightly-security-audit.yml sets broad GitHub token scopes including contents: write for a job that only needs to run tests/audit and optionally upload artifacts.

Problem: A compromised or maliciously-modified step in the nightly job could push to the repo (contents: write) - exactly the privilege escalation chains security audits aim to avoid; write-overread permissions also complicate review of the shared token.

Proposed approach: Restrict to least privilege: permissions: { contents: read, security-events: write, pull-requests: none } (or [none] + artifact upload scope), and rely on artifacts for evidence.

Acceptance criteria: workflow.yml shows least-privilege permissions; a PR that re-adds write is caught by review.

Activity

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions