Managing service accounts
Manage access and permissions with service accounts
Service accounts overview
A service account is an identity that provides automated processes, applications, and services with the necessary permissions to interact securely with your infrastructure. Service accounts can manage access and permissions programmatically, ensuring secure and efficient operations within your environment.
Coderfesh supports creating service accounts and assigning them to teams with RBAC (Role-Based Access Control) compliance for CI pipelines. See Create service accounts.
Each service account can hold multiple API keys, making it easy to manage access for different purposes. See Generate API keys for service accounts.
Create service accounts
Create service accounts in Codefresh to manage processes, integrations, at the account level.
Assign teams to service accounts to ensure RBAC access for those teams and their users (see Access control for pipelines).
Note that service account creation is not supported via CLI and Terraform.
Before you begin
- Make sure you have created one or more teams
How to
- In the Codefresh UI, on the toolbar, click the Settings icon, and then from the sidebar, select Service Accounts.
- Click Add Service Account.
- Do the following:
- Name: Enter a name for the service account according to the requirements.
- Team: Assign this service account to one or more of the teams available.
- Assign Admin role to service account: Optional. Automatically assign admin permissions to this service account.
- Continue with Generate API keys for service accounts.
Generate API keys for service accounts
Generate API keys for a service account after creating it. The procedure is similar to generating API keys for individual users. There is no limit to the number of API keys you can generate for a single service account.
After generating API keys, you can modify the scopes defined for the API key, or delete it.
- In the Codefresh UI, on the toolbar, click the Settings icon, and then from the sidebar, select Service Accounts.
- Select the service account for which to generate API keys.
- Click Generate API Key.
- In the Generate Codefresh API key form, do the following:
- Enter the Key Name.
- Click Generate. Codefresh generates the key and pastes it in the API Key field.
- If required, copy the key to the clipboard and save it in a safe location.
- Select the required scopes.
- Click OK.
View service accounts
The Service Accounts page shows the list of service accounts defined for the account.
Service Account Setting | Description |
---|---|
Name | The name of the service account. The Admin label to the right of the name indicates that the service account has been assigned an admin role. |
API Keys | The number of API keys assigned to the service account. Selecting a service account displays the API keys generated for that account. Modify selected scopes by clicking Edit, or delete the API key. |
Teams | The names of the teams the service account is assigned to. |
Status | Indicates if the service account is currently active (Enabled) or inactive (Disabled). You may want to disable a service account to invalidate its API keys without having to remove the service account, and simply reenable when needed. |
Actions | The options available to manage the service account through its context menu:
|
Authenticating to Amazon ECR with service account
Authenticate to Amazon ECR registries with credentials from the service account instead of the Access Key ID and Secret Access Key.
This allows pipelines to seamlessly authenticate to Amazon ECR via service account credentials, enhancing security and simplifying access management.
There are two requirements:
- Set the option to authenticate via service accounts at the account level for pipelines. See Advanced options for pipelines.
- Configure Amazon ECR integration to use service account credentials. See Amazon ECR Container Registry pipeline integration.