Skip to content

Add OctoSTS org trust policy for toolhive-doc-mcp refresh - #19

Merged
stacklokbot merged 1 commit into
mainfrom
octo-sts-toolhive-doc-refresh
Oct 8, 2026
Merged

stacklokbot merged 1 commit into
mainfrom
octo-sts-toolhive-doc-refresh

Conversation

@Nashon-Steffen

@Nashon-Steffen Nashon-Steffen commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add .github/chainguard/toolhive-doc-refresh.sts.yaml. This is the first org-level OctoSTS trust policy.
  • Add a CODEOWNERS entry for .github/chainguard/.

The toolhive-doc-mcp refresh CronJob reads docs from three public repos. It uses a token only for the GitHub API rate limit. The old classic PAT is expired, and every nightly refresh fails with 401 Bad credentials. The CronJob now exchanges an EKS service account token for a GitHub App token.

The policy allows exactly one subject, system:serviceaccount:toolhive-doc-mcp:toolhive-doc-refresh. It accepts that subject only from the dev, staging, and production EKS OIDC issuers. The token covers toolhive, toolhive-studio, and toolhive-catalog with contents: read only.

The infra side is stacklok/infra (link in the first comment).

Prerequisites (org admin)

  • Install stacklok-octosts on stacklok/.github. OctoSTS reads org policies from this repo.
  • Install stacklok-octosts on toolhive, toolhive-studio, and toolhive-catalog. GitHub rejects the token request if the policy lists a repo outside the installation.

Security note

With the app installed here, a policy in this repo can mint tokens for any repo where the app is installed. Those tokens can carry up to the app's own permissions. The main branch protection requires a Code Owner review, so the new /.github/chainguard/ entry makes @stacklok/maintain approval mandatory for every policy change.

Validation

  • An EKS token from staging reached the policy lookup at octo-sts.stacklok.dev and returned unable to find trust policy. The issuer and audience checks pass today.
  • The issuer_pattern matches the staging issuer as a full anchored match.
  • After merge, the infra PR runs a manual staging Job to confirm the real token mint.

🤖 Generated with Claude Code

The toolhive-doc-mcp refresh CronJob reads docs from toolhive,
toolhive-studio, and toolhive-catalog. It exchanges an EKS service
account token for a read-only GitHub App token. This replaces an
expired PAT.

Add a CODEOWNERS entry for .github/chainguard/. Org policies in this
repo can mint tokens for any repo where stacklok-octosts is installed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

Missing Issue Link

This PR does not appear to reference a GitHub issue.
Please add a closing keyword (e.g. Closes #123) if this PR fully resolves the issue, or a non-closing reference (e.g. Part of #123) if it's one of several PRs implementing it.
Cross-repo references are also supported (e.g. Part of owner/repo#123) for issues tracked outside this repository.
Supported closing keywords: closes, fixes, resolves, close, fix, resolve (case insensitive)
Supported non-closing references: relates to, related to, part of, refs, ref, references, reference, contributes to, follow-up to (case insensitive)
Note: closing keywords only auto-close issues in this repository — cross-repo references never auto-close, regardless of keyword.

@Nashon-Steffen

Copy link
Copy Markdown
Contributor Author

@stacklokbot
stacklokbot merged commit 05d18af into main Oct 8, 2026
2 checks passed
@stacklokbot
stacklokbot deleted the octo-sts-toolhive-doc-refresh branch October 8, 2026 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants