Skip to content

feat(security): the App's installation tokens carry only the permissions the roadmap jobs use #2473

Description

@dan-petty

Problem or Motivation

The owner gave GitHub App devops-cli-service read and write on every repository permission on 2026-10-28, for planned repository-management work (ADR 0015, #2454). Each installation token that the Service and the cluster Jobs mint today gets every permission of the installation, including Administration, Secrets, Variables, Environments and Workflows, which AGENTS.md leaves to a person. A bug, a prompt injection that reaches a write, or a leaked token can then use all of them. The roadmap jobs need only Issues, Pull requests and Contents read and write, and Checks, Actions and Metadata read (k8s/README.md, "Roadmap service", step 1).

GitHub's "Create an installation access token for an app" endpoint takes a permissions object (and repositories) that narrows the token below the installation's grant. src/devops_cli/github/app_installation.py:145-150 mints the token with no such object.

Proposed Solution & Architectural Design

  • The token request names the permissions the roadmap jobs use, from one constant: issues: write, pull_requests: write, contents: write, checks: read, actions: read, metadata: read.
  • A request that GitHub refuses because the installation lacks one of them fails with an error that names the missing permission.
  • A later feature that needs more asks for its own token with its own set; the App's grant stays the owner's setting.

Target Subsystem

GitHub session (src/devops_cli/github/app_installation.py).

Existing Tool Considered

GitHub's documented permissions parameter of POST /app/installations/{installation_id}/access_tokens, through gidgethub.apps.get_installation_access_token or the session's request, whichever the code uses. Nothing is built.

Acceptance criteria

  • With GitHub faked at the HTTP edge, the token request body holds exactly the permissions above.
  • The minted token's permissions in the reply are logged as names only, and a reply that grants more is not an error.
  • uv run devops ci passes.

Activity

  1. added
    source/agent
    type/security
    status/new
    value/medium
    effort/low
    on Oct 28, 2026
  2. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/security. The change reduces the token's granted permissions to limit the blast radius of a compromised or leaked token.
    • Priority: P2-Medium. It is a defense-in-depth fix with no active exploit, so it is important but not urgent.
    • Value: Medium. It limits the damage a single leaked token can cause, which protects all roadmap jobs.
    • Effort: Low. The change adds one constant and one parameter to an existing API call in app_installation.py.
    • Related: refactor(github): one github session per identity owning token, quota and transport #767, which asks for a different change. Both work in the GitHub session area, but #767 consolidates token discovery and transport while this candidate restricts the permissions on minted installation tokens.
  3. added
    priority/p2-medium
    on Oct 28, 2026
  4. added 3 commits that reference this issue on Oct 28, 2026
    9599ef2
    5064f31
    2d32dae
  5. removed
    status/new
    on Oct 30, 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

    effort/lowpriority/p2-mediumsource/agenttype/securityvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions