Skip to content

Add a token policy for rate card publication - #100

Merged
mr-lee merged 1 commit into
mainfrom
ratecard-publication-policy
Oct 22, 2026
Merged

mr-lee merged 1 commit into
mainfrom
ratecard-publication-policy

Conversation

@mr-lee

@mr-lee mr-lee commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

Adds a dd-octo-sts trust policy that lets one workflow, DataDog/trajectory's ratecard-publish.yml running from protected main in the ratecard-publication environment, get a short-lived token with contents: write for this repository. The workflow will keep generated rate card files on a separate ratecards branch; it does not open pull requests or change main.

Lets only DataDog/trajectory's protected ratecard-publish workflow on main
get a short-lived token with contents: write, to update the generated
files on the ratecards branch.

@datadog-official datadog-official Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bits Code Review: FAIL

The ref_protected claim is not included in GitHub Actions OIDC tokens, so requiring it in the STS policy will reject token exchange and block rate-card publication even for the intended protected-branch workflow. Branch protection should be enforced via repository or environment rules instead.

Open Bits AI session

🤖 Bits Code Review · Commit 9faaa8e

claim_pattern:
event_name: (push|workflow_dispatch)
ref: refs/heads/main
ref_protected: "true"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Remove the unsupported ref_protected claim requirement

GitHub Actions OIDC tokens do not include ref_protected; it is a workflow-context property. Requiring this claim causes dd-octo-sts to reject even the intended publication job on protected main, preventing token acquisition and rate card publication. Remove this requirement and enforce branch protection through repository or environment rules.

Suggested change
ref_protected: "true"

React: 👍 useful · 👎 wrong · 😕 unclear · 👀 right, but not acting on it

What each reaction means
  • 👍 Useful: correct, and you're fixing it or will.
  • 👎 Wrong: the finding is incorrect, for example the bug can't happen or the code was misread.
  • 😕 Unclear: you can't tell what it means or why it matters.
  • 👀 Right, not acting: correct, but intended, out of scope for this PR, a known risk, or too minor.

🤖 Bits Code Review · Open Bits AI session

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping it: GitHub Actions OIDC tokens do carry a ref_protected claim, and dd-octo-sts matches it. For example, DataDog/dd-trace-py's .github/chainguard/self.update-system-tests.create-pr.sts.yaml requires ref_protected: "true", and its scheduled run 39437219812 on 2026-10-20 minted a token with that policy through DataDog/dd-octo-sts-action. DataDog/dd-trace-java's self.update-gradle-dependencies.create-pr policy requires it too.

@mr-lee
mr-lee merged commit c09c329 into main Oct 22, 2026
1 check passed
@mr-lee
mr-lee deleted the ratecard-publication-policy branch October 22, 2026 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant