Skip to content

security(ci): separate repo-sentinel gate control plane from PR code #10

Description

@stacknil

Problem

The Repo Sentinel consumer gate protects the base baseline and rejects changes to .reposentinel.toml and .reposentinel-baseline.json, but the required pull_request workflow and its orchestration script still come from the pull request merge ref. A pull request can therefore alter the control plane that reports the required check.

This is an ownership boundary, not a scanner finding. The current gate remains useful against accidental policy drift and baseline self-suppression, but it must not be described as resistant to a pull request that rewrites the workflow itself.

GitHub documents that pull_request workflows run from the pull request merge ref, while pull_request_target runs from the base context and becomes dangerous when it checks out or executes untrusted pull request code:

Decision-driving hypothesis

A base-owned, read-only, no-secrets control plane can treat the pull request tree as data and preserve the required gate identity without executing pull-request-owned scripts in a privileged context.

Minimum acceptance criteria

  • Compare repository ruleset or required-workflow options with a base-owned workflow design.
  • Keep the semantic core outside pull-request control for the run that reports the required check.
  • Never combine pull_request_target with execution of an untrusted checkout, local action, hook, build script, or dependency definition.
  • Keep permissions at contents: read and do not expose repository or organization secrets.
  • Define one target tree and verify its commit identity before scanning.
  • Add a negative fixture that attempts to replace or bypass the gate implementation.
  • Preserve trusted-base baseline selection, protected-policy failure, deterministic redacted reports, and error-only blocking semantics.

Non-goals

  • Switching event types merely to make the workflow base-owned.
  • Granting write permissions or secrets to a pull request scan.
  • Treating CODEOWNERS alone as runtime integrity.
  • Expanding scanner heuristics or refreshing the baseline.

Relationship

Issue #9 covers consumer orchestration regressions inside the current trust model. This issue owns the separate control-plane integrity decision.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions