iam:GetWebIdentityToken on that role’s CRN. Restrict the audience to
the destination service:
basalt:IdentityTokenDurationSeconds contains the requested lifetime
in seconds, including the default 300 when no duration is supplied.
Request a token inside the VM
First obtain an IMDSv2 session token. Then request an identity JWT with one external audience:token and expires_at. Tokens default to 300 seconds;
you can request 60–300 seconds. Repeated requests can return a still-valid cached
token, so use the returned expiration. Every request checks current role
permissions, including cache hits.
This endpoint always requires IMDSv2, even if ordinary metadata permits IMDSv1.
It accepts only audience and optional duration_seconds. The platform supplies
the VM identity; a request cannot choose another VM, account, organization, or
subject. The audience basaltic is reserved for API access and is rejected here.
The three tokens involved are different:
Identity claims
The issuer ishttps://iam.basaltic.sh. JWTs use ES256 and include iss, sub,
aud, iat, exp, and jti.
The subject is:
Maintain a token file
Guest-agent version1.15.11-1 or later includes an identity-token command.
Upgrade basaltic-guest-agent from your VM’s configured Basaltic package
repository before using it.
Run the helper as the same user as your application, with a private output
directory. It refreshes the proof before expiration and atomically replaces a
mode-0600 file:
--once for a single short task; that file is not
refreshed. Continuous mode removes the file when stopped and removes an expired
proof if refresh has failed. A second helper cannot own the same output file.
For a service running as the existing app user, use a separate systemd unit:
/etc/systemd/system/basaltic-aws-identity.service

