Skip to content

SEC-03: The worker holds the bot credential and posts its own required checks, so CI is not independent of it #60

In progress

Description

@ephico2real2

Part of #18

What is wrong: on the Gitea stand-in the worker runs kubeconform, Kyverno and the cmapi check and posts the statuses branch protection requires; a compromised worker can therefore merge what it wants. The design has the Git host's CI run the checks and the cmapi check call GET /requests/{id}/approval-status. Recorded by Opus (Y4) and Codex (X4).

Where: cmapi/src/cmapi/jobs/pr_checks.py:17-19 names the three contexts ci/kubeconform, ci/kyverno and cmapi/check. The lines exist at ecc5cb3. The job sets every required context.

How to prove it: On the config repository, a pull request must not merge on statuses that only the worker posted. A new test in cmapi/tests/service/ shows it, not written yet. On branch fix-pr-status-check-runs, cmapi/tests/service/test_github_check_runs.py::test_green_from_actions_merges_and_the_worker_posts_only_the_cmapi_check covers the GitHub side (#87).

Measured or inferred: Measured by reading the code. Nobody ran an attack.

Severity: High. If the worker is compromised, a person can merge a change that nobody approved.

What must hold after the fix: The CI of the Git host runs kubeconform and Kyverno. The worker posts only cmapi/check. Each required check is pinned by app_id (HANDOVER-AND-RESUME.md, "Decisions that bind the work").

Research: Not done yet. The options when filed: Gitea Actions or a separate checker identity with its own token; on GitHub, Actions. The handover records Codex's signed permit as the next step on this issue.

Solution: Not written. #85 says that the removal of the Gitea chart and adapter closes this issue.

Class: INV and TDT. The fix adds an independent checker, which is a new control. The cause is the stand-in shortcut.

Activity

  1. added
    Backlog
    bug
    class:INV
    class:TDT
    sev:high
    status:open
    on Nov 13, 2026
  2. changed the title [-]Open: the worker holds the bot credential and posts its own required checks, so CI is not independent of it[/-] [+]SEC-03: The worker holds the bot credential and posts its own required checks, so CI is not independent of it[/+] on Nov 13, 2026
  3. ephico2real2 commented on Dec 1, 2026

    @ephico2real2
    OwnerAuthor

    Owner decision, 2026-12-01: GitHub Actions runs the checks. cmapi turns host CI on (git.external_ci) and reads ci/kubeconform and ci/kyverno from cmapi-cluster-configs' Actions; the worker posts only cmapi/check; the config repo's branch protection requires those two contexts pinned to the GitHub Actions app. Severity High, so fixed this session.

  4. ephico2real2 commented on Dec 1, 2026

    @ephico2real2
    OwnerAuthor

    Found while fixing this issue: #764 (High, security). A request PR can rewrite the config repository's workflow, so the Actions checks pinned to the GitHub Actions app can be made to pass. Reported to the coordinator; not in the #60 PR's scope.

  5. ephico2real2 commented on Dec 1, 2026

    @ephico2real2
    OwnerAuthor

    Owner decision, 2026-12-01: stay on the free plan and accept the risk. No branch protection on cmapi-cluster-configs for now. PR #769 lands the code (the worker reads ci/* from the config repo's Actions and never posts them on GitHub) as Part of #60. #60 and #764 stay open as accepted lab risks until protection is possible (GitHub Pro or a Team organisation). The protection command is recorded on PR #769.

  6. added 3 commits that reference this issue on Dec 1, 2026
  7. ephico2real2 commented on Dec 1, 2026

    @ephico2real2
    OwnerAuthor

    PR #769 merged as 839b6386. On GitHub the worker now reads ci/kubeconform and ci/kyverno from the config repository's Actions and never posts them. A run counts only when it is the configured workflow file's pull_request run on the approved head, branch and repository. The worker posts cmapi/check alone. Record: docs/reviews/2026-12-01-issue-60/.

    Still open, by the owner's decision of 2026-12-01 (#227, free plan): no branch protection, so nothing yet stops a merge on missing checks; and #764. Before the next CRC deploy, the cmapi-git-bot token needs Actions: Read. Without it, pr_checks gets 403.

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

    Backlogbugclass:INVclass:TDTsev:highstatus:open

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions