|
| 1 | +--- |
| 2 | +title: "Octo STS FAQ" |
| 3 | +linktitle: "FAQ" |
| 4 | +type: "article" |
| 5 | +lead: "Frequently asked questions about Octo STS, including troubleshooting, security considerations, and common use cases" |
| 6 | +description: "Learn about Octo STS for GitHub token federation, including setup issues, security best practices, and integration patterns" |
| 7 | +date: 2025-12-22T15:04:05+01:00 |
| 8 | +lastmod: 2025-12-22T15:04:05+01:00 |
| 9 | +tags: ["octo-sts", "FAQ"] |
| 10 | +draft: false |
| 11 | +images: [] |
| 12 | +menu: |
| 13 | + docs: |
| 14 | + parent: "octo-sts" |
| 15 | +weight: 60 |
| 16 | +toc: true |
| 17 | +--- |
| 18 | + |
| 19 | +This page answers frequently asked questions about Octo STS, including setup, security, troubleshooting, and common use cases. |
| 20 | + |
| 21 | +## General Questions |
| 22 | + |
| 23 | +### What is Octo STS? |
| 24 | + |
| 25 | +Octo STS is a GitHub App developed by Chainguard that acts as a Security Token Service for GitHub. It allows workloads with OIDC tokens from various identity providers (GitHub Actions, cloud providers, Kubernetes, etc.) to exchange those tokens for short-lived GitHub access tokens. The primary goal is to eliminate the need for long-lived Personal Access Tokens (PATs). |
| 26 | + |
| 27 | +### Why should I use Octo STS instead of Personal Access Tokens? |
| 28 | + |
| 29 | +Personal Access Tokens pose security risks as they allow provide persistent access to resources and are not tied to a given workload. Attackers regularly abuse leaked PATs to gain access to systems and resources. |
| 30 | + |
| 31 | +By comparison, Octo STS tokens are short-lived (1 hour) and typically tightly scoped to the workload in question. This vastly reduces the scope for abuse. |
| 32 | + |
| 33 | +### How does Octo STS compare to GitHub's built-in GITHUB\_TOKEN? |
| 34 | + |
| 35 | +GitHub Actions provides a `GITHUB_TOKEN` automatically, but it has limitations: |
| 36 | +- Cannot update workflow files |
| 37 | +- Cannot trigger other workflows |
| 38 | +- Limited to a fixed set of permissions |
| 39 | + |
| 40 | +Octo STS tokens can: |
| 41 | +- Update workflow files (useful for Renovate) |
| 42 | +- Have any permissions defined in your trust policy |
| 43 | +- Work consistently across all automation platforms, not just GitHub Actions |
| 44 | + |
| 45 | +### Is Octo STS free to use? |
| 46 | + |
| 47 | +Yes, Octo STS is open source and the hosted service at octo-sts.dev is free to use. You can also self-host Octo STS if you prefer. |
| 48 | + |
| 49 | +### Can I self-host Octo STS? |
| 50 | + |
| 51 | +Yes, Octo STS is open source and can be self-hosted. See the [Octo STS repository](https://github.com/octo-sts/app) for deployment instructions. |
| 52 | + |
| 53 | +## Setup and Configuration |
| 54 | + |
| 55 | +### How do I install Octo STS? |
| 56 | + |
| 57 | +Install the GitHub App: |
| 58 | +1. Visit [https://github.com/apps/octo-sts](https://github.com/apps/octo-sts) |
| 59 | +2. Click **Install** |
| 60 | +3. Select the organization or user account |
| 61 | +4. Choose which repositories to grant access |
| 62 | +5. Approve the permissions |
| 63 | + |
| 64 | +Then create trust policies in your repositories at `.github/chainguard/{name}.sts.yaml`. |
| 65 | + |
| 66 | +### Why does Octo STS request so many permissions? |
| 67 | + |
| 68 | +Octo STS requests a superset of permissions to support a large range of use cases. However, it only creates tokens with the specific permissions defined in your trust policies. The app needs `contents: read` to read trust policy files, but all other permissions are only granted based on your policies. |
| 69 | + |
| 70 | +### What happens if I don't create any trust policies? |
| 71 | + |
| 72 | +If you install Octo STS but don't create trust policies, the app cannot issue any tokens. Trust policies are required to specify which identities are trusted and what permissions to grant them. |
| 73 | + |
| 74 | +### Can I use Octo STS with private repositories? |
| 75 | + |
| 76 | +Yes, Octo STS works with both public and private repositories. The app needs access to read the repository's trust policy files. |
| 77 | + |
| 78 | +### How do I update trust policy permissions? |
| 79 | + |
| 80 | +Edit the trust policy file in your repository, commit, and push the changes. The new permissions take effect immediately for subsequent token exchanges. Existing tokens retain their original permissions until they expire. |
| 81 | + |
| 82 | +### Can I have multiple trust policies in one repository? |
| 83 | + |
| 84 | +Yes, you can create multiple policy files with different names: |
| 85 | +- `.github/chainguard/renovate.sts.yaml` |
| 86 | +- `.github/chainguard/deploy.sts.yaml` |
| 87 | +- `.github/chainguard/ci.sts.yaml` |
| 88 | + |
| 89 | +Each policy can have different identity requirements and permissions. Specify which policy to use via the `identity` parameter when exchanging tokens. |
| 90 | + |
| 91 | +## Security |
| 92 | + |
| 93 | +### Are Octo STS tokens safe? |
| 94 | + |
| 95 | +Octo STS tokens are as safe as the trust policies you create. They're short-lived (1 hour), reducing the window of opportunity if compromised. |
| 96 | + |
| 97 | +### Can Octo STS tokens bypass branch protection? |
| 98 | + |
| 99 | +No. Branch protection rules are enforced by GitHub regardless of the token type. Even with `contents: write` permission, Octo STS tokens must follow branch protection requirements like pull request reviews and status checks. |
| 100 | + |
| 101 | +### Should I use pattern matching or exact subjects? |
| 102 | + |
| 103 | +Prefer exact subject matching when possible: |
| 104 | + |
| 105 | +```yaml |
| 106 | +# Better: Exact match |
| 107 | +subject: repo:org/repo:ref:refs/heads/main |
| 108 | +``` |
| 109 | +
|
| 110 | +Use pattern matching only when you need flexibility: |
| 111 | +
|
| 112 | +```yaml |
| 113 | +# When necessary: Pattern match |
| 114 | +subject_pattern: "repo:org/repo:ref:refs/heads/.*" |
| 115 | +``` |
| 116 | +
|
| 117 | +Exact matching is more secure because it's harder to accidentally grant broader access than intended. |
| 118 | +
|
| 119 | +## Integration |
| 120 | +
|
| 121 | +### Can I use Octo STS from a CI/CD system other than GitHub Actions? |
| 122 | +
|
| 123 | +Yes, Octo STS works with any system that can: |
| 124 | +1. Obtain OIDC tokens (Jenkins, GitLab CI, CircleCI, etc.) |
| 125 | +2. Make HTTP requests to exchange tokens |
| 126 | +3. Use the resulting GitHub token |
| 127 | +
|
| 128 | +The key is having an OIDC identity provider that Octo STS can validate. |
| 129 | +
|
| 130 | +### How do I use Octo STS with Terraform? |
| 131 | +
|
| 132 | +Use Terraform's `external` data source to exchange tokens: |
| 133 | + |
| 134 | +```hcl |
| 135 | +data "external" "github_token" { |
| 136 | + program = ["bash", "-c", <<-EOT |
| 137 | + OIDC_TOKEN=$(get_oidc_token) |
| 138 | + RESPONSE=$(curl -s -H "Authorization: Bearer $OIDC_TOKEN" \ |
| 139 | + "https://octo-sts.dev/sts/exchange?scope=org/repo&identity=terraform") |
| 140 | + echo $RESPONSE | jq '{token: .access_token}' |
| 141 | + EOT |
| 142 | + ] |
| 143 | +} |
| 144 | +
|
| 145 | +provider "github" { |
| 146 | + token = data.external.github_token.result.token |
| 147 | +} |
| 148 | +``` |
| 149 | + |
| 150 | +### Can I use Octo STS to access multiple repositories? |
| 151 | + |
| 152 | +Yes, use organization trust policies with a `repositories` field: |
| 153 | + |
| 154 | +```yaml |
| 155 | +issuer: https://token.actions.githubusercontent.com |
| 156 | +subject: repo:org/automation-repo:ref:refs/heads/main |
| 157 | +
|
| 158 | +permissions: |
| 159 | + contents: read |
| 160 | +
|
| 161 | +repositories: |
| 162 | + - org/repo-one |
| 163 | + - org/repo-two |
| 164 | + - org/repo-three |
| 165 | +``` |
| 166 | + |
| 167 | +The resulting token can access all listed repositories. |
| 168 | + |
| 169 | +## Troubleshooting |
| 170 | + |
| 171 | +### Token exchange fails |
| 172 | + |
| 173 | +Common causes: |
| 174 | +- **Trust policy doesn't exist**: Verify the file exists at `.github/chainguard/{identity}.sts.yaml` |
| 175 | +- **OIDC token doesn't match policy**: Check that issuer and subject match your OIDC token |
| 176 | +- **App not installed**: Ensure Octo STS is installed and has access to the repository |
| 177 | +- **Wrong branch**: Trust policies are typically read from the default branch (main/master) |
| 178 | +- **Invalid permissions**: The policy requests permissions that don't exist or can't be granted by the app |
| 179 | + |
| 180 | +## Operational Questions |
| 181 | + |
| 182 | +### How long do Octo STS tokens last? |
| 183 | + |
| 184 | +By default, tokens expire after 1 hour. |
| 185 | + |
| 186 | +### Can I refresh Octo STS tokens? |
| 187 | + |
| 188 | +No, Octo STS tokens cannot be refreshed. When a token expires, exchange a new OIDC token with Octo STS to obtain a new GitHub token. This is intentional - short-lived tokens should be regularly renewed. |
| 189 | + |
| 190 | +### What happens when Octo STS permissions are updated? |
| 191 | + |
| 192 | +Octo STS periodically adds or removes GitHub permissions to support new use cases. When this happens: |
| 193 | +- An issue is created in the Octo STS repository explaining the changes |
| 194 | +- You'll receive a notification to approve the updated permissions in your GitHub App installation |
| 195 | +- Updates are applied quarterly, with exceptions for critical changes |
| 196 | + |
| 197 | +## Migration |
| 198 | + |
| 199 | +### How do I migrate from PATs to Octo STS? |
| 200 | + |
| 201 | +1. Identify where PATs are currently used |
| 202 | +2. Determine if those systems can provide OIDC tokens |
| 203 | +3. Create appropriate trust policies for each use case |
| 204 | +4. Update automation to exchange OIDC tokens instead of using PATs |
| 205 | +5. Test thoroughly in a non-production environment |
| 206 | +6. Revoke PATs once Octo STS is working |
| 207 | + |
| 208 | +### Can I use both PATs and Octo STS during migration? |
| 209 | + |
| 210 | +Yes, you can use both during a transition period. This allows gradual migration and rollback capability if issues arise. |
| 211 | + |
| 212 | +## Getting Help |
| 213 | + |
| 214 | +### Where can I report bugs? |
| 215 | + |
| 216 | +Report bugs in the [Octo STS GitHub repository](https://github.com/octo-sts/app/issues). |
| 217 | + |
| 218 | +### Where can I ask questions? |
| 219 | + |
| 220 | +- GitHub Discussions in the [Octo STS repository](https://github.com/octo-sts/app/discussions) |
| 221 | +- Open an issue for specific problems |
| 222 | +- Review existing FAQ and documentation |
| 223 | + |
| 224 | +### How can I contribute to Octo STS? |
| 225 | + |
| 226 | +Octo STS is open source. Contributions are welcome: |
| 227 | +- Report bugs and request features |
| 228 | +- Improve documentation |
| 229 | +- Submit pull requests for code changes |
| 230 | +- Share your use cases and integration patterns |
| 231 | + |
| 232 | +See the [repository](https://github.com/octo-sts/app) for contribution guidelines. |
| 233 | + |
| 234 | +## Next Steps |
| 235 | + |
| 236 | +- [Getting Started with Octo STS](/open-source/octo-sts/getting-started-with-octo-sts/) - Set up octo-sts for the first time |
| 237 | +- [Trust Policy Reference](/open-source/octo-sts/trust-policy-reference/) - Detailed trust policy documentation |
| 238 | +- [GitHub Actions Integration](/open-source/octo-sts/how-to-use-octo-sts-with-github-actions/) - Use octo-sts with GitHub Actions |
0 commit comments