morningman opened a new pull request, #4712: URL: https://github.com/apache/doris-website/pull/4712
## Summary Opt in to GitHub Actions' immutable OIDC subject claim format by setting `github.oidc_subject.use_immutable_subject: true` in `.asf.yaml`. This changes the `sub` claim in GitHub-issued OIDC tokens for this repository: - **Before**: `repo:apache/doris-website:ref:refs/heads/master` - **After**: `repo:apache@47359/doris-website@149782046:ref:refs/heads/master` The suffix (`:ref:refs/heads/master`) is unchanged; the repository is now identified by its immutable owner and repository IDs (owner `apache` = `47359`, repository `doris-website` = `149782046`). ## Why Cloud trust policies authorize a workflow by matching the OIDC `sub` claim. The name-based claim can match a different repository if `apache/doris-website` were renamed, deleted, and re-created. The ID-based claim cannot: a re-created repository gets different IDs, so it cannot satisfy a trust policy written for the original one. This follows GitHub's [immutable subject claims](https://docs.github.com/en/actions/reference/security/oidc#immutable-subject-claims) guidance. GitHub uses this format by default for repositories created after 2026-07-15; older repositories keep the name-based format until they opt in. ## Required coordinated change (Aliyun RAM) — do this BEFORE merging `.asf.yaml` changes the token GitHub issues, but Aliyun validates it. Both OIDC roles must accept the new subject first: - the website deploy role (`vars.ALIYUN_WEBSITE_ROLE_ARN`) - the archived-PDF role (`vars.ALIYUN_WEBSITE_PDF_ROLE_ARN`) Current trust condition (both roles): ```json "StringEquals": { "oidc:iss": "https://token.actions.githubusercontent.com", "oidc:aud": "sts.aliyuncs.com", "oidc:sub": "repo:apache/doris-website:ref:refs/heads/master" } ``` Recommended migration: 1. Add the new `sub` while keeping the old one (two statements, or a list of values), so both formats are accepted: `repo:apache@47359/doris-website@149782046:ref:refs/heads/master` 2. Merge this `.asf.yaml` change. 3. Run the **Verify Website OSS OIDC** workflow (`workflow_dispatch`, master only) to confirm the new subject can assume the website role. Optionally run a manual deploy or the archived-PDF workflow. 4. Remove the old `sub` from both trust policies. If this is merged before RAM is updated, OIDC token exchange fails and the website deploy (push to `master` / manual deploy) plus the archived-PDF upload will fail until the trust policy is corrected. ## Scope and non-goals - This pins **who the repository is** (immutable IDs), not **which workflow** may assume the role. Any workflow on `refs/heads/master` with `id-token: write` still produces a matching subject. Pinning the workflow (`include_claim_keys: [repo, context, job_workflow_ref]`) would require per-workflow RAM trust statements — the website role is shared by the cron deploy, manual deploy, and the OIDC probe — and is left as a follow-up. - This does not replace branch protection or review requirements. A malicious commit merged to `master` can still use the role; review hardening is the control for that. - No change to the `aud`, `iss`, or session duration. ## Rollback Reverting requires `use_immutable_subject: false` (removing the key leaves the format as-is, per the asfyaml documentation), plus the corresponding RAM trust policy change. ## Validation - `.asf.yaml` parses as valid YAML and the block matches the `github.oidc_subject` schema documented by `apache/infrastructure-asfyaml`. - `oidc_subject` is a newer asfyaml setting; please validate it against the ASF asfyaml deployment/sandbox before merge. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
