Hierarchical Support for Service Accounts
Steps to configure and use account-level service accounts at project level.
Service accounts can be created at a higher scope and inherited by lower scopes with the necessary permissions, eliminating the need to create separate accounts for each organization or project.
The following example shows how to use an account-level service account in a project. You can apply the same process to use account-level service accounts in organizations.
Before you begin
Before you inherit an account-level service account in a project, ensure you have the following:
Feature flag enabled: The
PL_ENABLE_SERVICE_ACCOUNT_HIERARCHYfeature flag, described above.Account-level service account: An existing service account created at the account scope.
Project-level permissions: A role with permission to manage service accounts, roles, and resource groups at the project scope.
Step 1: Create account-level service account
Create a Service Account at the account level. This service account can then be inherited by organizations or projects.
Step 2: Create project-level role and resource group
In your target project:
Create a Role with the required permissions
Create a Resource Group defining what resources can be accessed
Step 3: Inherit and assign permissions
To inherit the account-level service account and assign it permissions, do the following:
Navigate to Project Settings → Access Control → Service Accounts
Select Inherit Service Account & Assign Roles
Choose your account-level service account
Assign the project-level role and resource group
Select Apply
The service account is now available for this project.
Benefits
Hierarchical support for service accounts provides the following benefits:
Centralized Service Account Management: Reduces the need to create and manage multiple service accounts for each project.
Simplified Permissions: Easily manage permissions at the project level by assigning roles to service accounts created at the account or organization level.
Seamless Pipeline Execution: One or more service accounts can be given the necessary permissions, if required, to execute pipelines from multiple projects.
Additional resources
For more information on how to manage service accounts, create roles, and assign permissions in Harness, go to the following documentation on Harness Developer Hub:
Last updated
Was this helpful?