Chapter 3. Robot account tokens
Robot account tokens are persistent password-type credentials for Docker v2 registry access in Red Hat Quay. You can use them for automation and continuous integration without interactive user authentication.
Robot account tokens are password-type credentials used to access a Red Hat Quay registry by using normal Docker v2 endpoints. The UI labels these credentials as tokens because the password itself is encrypted.
By default, Red Hat Quay robot account tokens do not expire and do not require user interaction, which makes robot accounts ideal for non-interactive use cases.
Robot account tokens are automatically generated at the time of a robot’s creation and are not user-specific; they are connected to the user and organization namespace where they are created. For example, a robot named project_tools+<robot_name> belongs to the project_tools namespace.
Robot account tokens provide access without needing a user’s personal credentials. How the robot account is configured, for example, with one of READ, WRITE, or ADMIN permissions, ultimately defines the actions that the robot account can take.
Because robot account tokens are persistent and do not expire by default, they are ideal for automated workflows that require consistent access to Red Hat Quay without manual renewal. Despite this, you can regenerate robot account tokens by using the UI or by using the proper API endpoint from the CLI. To enhance the security of your Red Hat Quay deployment, administrators should regularly refresh robot account tokens. With the keyless authentication with robot accounts feature, you can exchange robot account tokens for external OIDC tokens so that they last only one hour, which enhances the security of your registry.
When a namespace is deleted, or when the robot account itself is deleted, the tokens are garbage collected when the collector is scheduled to run.
3.1. Regenerating a robot account token by using the Red Hat Quay UI Copy linkLink copied to clipboard!
To replace a robot account credential from the Red Hat Quay UI, you can regenerate the robot account token for an organization robot account.
Prerequisites
- You have logged into Red Hat Quay.
Procedure
- Click the name of an organization.
- In the navigation pane, click Robot accounts.
- Click the name of your robot account, for example, testorg3+test.
- Click Regenerate token in the popup box.
3.2. Regenerating a robot account token by using the Red Hat Quay API Copy linkLink copied to clipboard!
To replace a compromised or outdated robot account credential, you can regenerate a robot account token by using the Red Hat Quay API for organization or user robots.
Prerequisites
- You have created an OAuth access token.
Procedure
Enter the following command to regenerate a robot account token for an organization by using the
POST /api/v1/organization/{orgname}/robots/{robot_shortname}/regenerateendpoint:$ curl -X POST \ -H "Authorization: Bearer <bearer_token>" \ "<quay-server.example.com>/api/v1/organization/<orgname>/robots/<robot_shortname>/regenerate"Example output
{"name": "test-org+test", "created": "Fri, 10 May 2024 17:46:02 -0000", "last_accessed": null, "description": "", "token": "<example_secret>"}Enter the following command to regenerate a robot account token for the current user by using the
POST /api/v1/user/robots/{robot_shortname}/regenerateendpoint:$ curl -X POST \ -H "Authorization: Bearer <bearer_token>" \ "<quay-server.example.com>/api/v1/user/robots/<robot_shortname>/regenerate"Example output
{"name": "quayadmin+test", "created": "Fri, 10 May 2024 14:12:11 -0000", "last_accessed": null, "description": "", "token": "<example_secret>"}