AssumeRoleWithWebIdentity endpoint. The resulting bearer token authorizes deployment API calls according to the Basaltic role’s policies.
Register GitHub in the deployment account
Follow provider registration in the same account as the deployment role. Use these values:- API
sts.amazonaws.com as its example audience.
Restrict the role to your workflow
Create an IAM role namedgithub-deployer in account production. Its trust policy should name your provider and the exact GitHub subject. This example uses a protected environment named production:
sub. GitHub supports both name-based and immutable-ID subject formats. Renames, transfers, or subject customization can change the value. See GitHub’s subject reference.
An environment subject does not also bind the branch. Configure GitHub environment protection to restrict deployment branches and approvals. The example workflow uses an environment, so its trust must use the environment subject.
Basaltic evaluates the verified issuer, subject, and audience. Claims such as
repository_id, ref, and job_workflow_ref are not separate Basaltic policy keys. Put required restrictions in the supported subject and GitHub environment configuration.
Grant deployment permissions
Attach permission policies for the specific resources your deployment changes. Trust permits login; it does not grant deployment access. To run the verification step below, add this small policy, then add your application’s deployment permissions separately:Obtain a session in GitHub Actions
Add the following workflow after replacing the account, role, audience, and environment values. GitHub’sid-token: write permission allows the job to request its identity token; Basaltic permissions still come from the role. The exchange uses no pre-existing Basaltic credential.
Set BASALTIC_ROLE_ID to the role UUID returned when you create the role; the verification endpoint takes a UUID.
.github/workflows/deploy.yml
BASALTIC_TOKEN in subsequent deployment steps as the HTTP bearer token. Replace or follow the verification step with your deployment commands, granting only their required IAM actions. This variable is set by the example; tools need their own documented token configuration. Do not print the token or upload the exchange response as an artifact.
The sample requests a 15-minute session. For longer jobs, obtain a fresh GitHub proof and exchange it again before the Basaltic session expires. There is no refresh token in this flow. See GitHub’s OIDC workflow guidance.
Troubleshooting
A401 during exchange usually points to issuer registration, audience, signature, or expiration. A 403 points to role trust: compare the exact subject, including immutable IDs, branch versus environment, and the audience set operator. A 403 after login indicates missing role permissions or a permission boundary. See the federation overview.
