Skip to content

ci: Keep scheduled.yaml's top level read-only and record its writer jobs (#962) - #2662

Merged
zackees merged 2 commits into
masterfrom
infra/962-sec-002-scheduled-permissions
Oct 27, 2026
Merged

zackees merged 2 commits into
masterfrom
infra/962-sec-002-scheduled-permissions

Conversation

@zackees

@zackees zackees commented Oct 27, 2026

Copy link
Copy Markdown
Member

Part of the #962 ci-lint burn-down (SEC-002).

What changes

scheduled.yaml's top-level block was contents: write, above the read-only
maximum a top-level block may hold. It becomes contents: read; every job that
writes already carries (or now carries) its scope on the job itself, and each
job id is recorded in ci.toml's [allow].permissions:

job scope why
services-availability contents: write, checks: write, pull-requests: write opens a PR
build-project contents: write grants it on to the reusable workflow it calls
report-nightly-failure issues: write files an issue
analyze-project security-events: write uploads SARIF
codeql security-events: write, packages: read uploads SARIF, reads packages

upload-language-files and steam-upload declare no permissions block and no
write need, so they stay read-only; both are upstream-only, gated on
repository_owner == 'obsproject', so the fork never runs them. The file's
SEC-002 [[exceptions]] block is deleted, and ci/test_ci_toml.py pins the
whole thing offline (ScheduledPermissionsTest).

RED → GREEN

  • RED 124e19db3 (test only): on the pre-change tree, ci-lint precheck
    reports scheduled.yaml with 9 SEC-002 findings (top-level
    contents: write above the max grant, plus the 5 jobs' unrecorded grants), and
    ScheduledPermissionsTest fails.
  • GREEN dcaf401f6: ci-lint precheck shows 0 SEC-002 findings for
    scheduled.yaml
    , total violations unchanged at 11, and no new finding.

SEC-002 falls 25 → 14 on this base. That is the 9 scheduled findings plus 2
more because [allow].permissions is keyed by job id: adding build-project to
contents: write also clears that job's finding in ci.yml and push.yaml
(their SEC-002 [[exceptions]] blocks stay until their remaining findings
clear).

Checks

  • uv run --no-project python -m unittest ci.test_ci_toml — 31 tests OK.
  • uvx [email protected] check ci/test_ci_toml.py — clean.
  • Rebased onto origin/master (1e68fc2da, after ci: Give sign-windows.yaml a read-only top-level token default (#962) #2659 landed); the add/add
    conflict in ci/test_ci_toml.py resolved as "master's SignWindowsPermissionsTest
    plus my ScheduledPermissionsTest", the ci.toml conflict as "master's list
    minus the scheduled block" (git diff origin/master -- ci.toml = only my block
    gone).

Not stamped with the local gate: on this host the gate's rust lane fails
independently of the change (stale host soldr), so PR CI is the gate.

Fixes #962

@zackees

zackees commented Oct 27, 2026

Copy link
Copy Markdown
Member Author

Handed off to the coordinator. RED 124e19db3 / GREEN dcaf401f6; local evidence in the description (ci.test_ci_toml 31 tests OK, ci-lint precheck scheduled.yaml SEC-002 9→0, total violations unchanged at 11). Auto-merge enabled. Not stamped with the local gate: on this host the gate's rust lane fails independently of the change (stale host soldr), so PR CI is the gate.

@zackees
zackees added this pull request to the merge queue Oct 27, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 27, 2026
@zackees
zackees enabled auto-merge October 27, 2026 16:34
@zackees
zackees force-pushed the infra/962-sec-002-scheduled-permissions branch from dcaf401 to 2f226df Compare October 27, 2026 16:35
@zackees
zackees added this pull request to the merge queue Oct 27, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 27, 2026
@zackees
zackees force-pushed the infra/962-sec-002-scheduled-permissions branch 2 times, most recently from 93678ad to 9d47e92 Compare October 27, 2026 16:52
@zackees
zackees enabled auto-merge October 27, 2026 16:52
@zackees
zackees added this pull request to the merge queue Oct 27, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 27, 2026
…962)

RED: ScheduledPermissionsTest fails on master — scheduled.yaml's top-level
block is 'contents: write' (above the read-only maximum) and none of its job
write scopes are recorded in ci.toml's [allow].permissions.

Refs #962
…obs (#962)

The top-level block was 'contents: write', above the read-only maximum a
top-level block may hold. It becomes 'contents: read'; every job that writes
already carries (or now carries) its scope on the job itself, and each job id
is recorded in ci.toml's [allow].permissions:

  services-availability  contents/checks/pull-requests: write (opens a PR)
  build-project          contents: write (grants it on to the called workflow)
  report-nightly-failure issues: write
  analyze-project        security-events: write
  codeql                 security-events: write, packages: read

upload-language-files and steam-upload declare no write need and are
upstream-only (gated on repository_owner == 'obsproject'), so they stay
read-only. The file's SEC-002 [[exceptions]] block is deleted.

GREEN: ci-lint precheck loses scheduled.yaml's nine SEC-002 findings with no
new finding; ci.test_ci_toml is 29 tests OK.

Fixes #962
@zackees
zackees force-pushed the infra/962-sec-002-scheduled-permissions branch from 9d47e92 to cf547f1 Compare October 27, 2026 17:07
@zackees
zackees enabled auto-merge October 27, 2026 17:07
@zackees
zackees added this pull request to the merge queue Oct 27, 2026
Merged via the queue into master with commit 35b680e Oct 27, 2026
31 checks passed
@zackees
zackees deleted the infra/962-sec-002-scheduled-permissions branch October 27, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

ci: Burn down the ci-lint precheck baseline in ci.toml

1 participant