Service accounts are used by applications or services to interact with other systems or resources, often with specific permissions and credentials. They facilitate automation, enhance security, and enable seamless integration between different components of a system or platform.
To show all service accounts on a specific platform within a system, we need to follow the relevant steps based on the platform. Here are instructions for a few common platforms:
Google Cloud Platform offers various ways to manage service accounts, including the Cloud console and Cloud SDK (command-line tool). We'll use both to demonstrate how to list all service accounts in a GCP project.
Go to the
Select the desired project.
Open the "IAM & Admin" menu.
Click on "Service accounts" to view a list of all service accounts in the project.
Here's the visual representation of all the mentioned steps:
If the Cloud SDK isn't installed, download it from the official
Authenticate with Google Cloud by running the following command and following the instructions to log in:
gcloud auth login
Run the following command to list all service accounts in the currently selected GCP project:
gcloud iam service-accounts list
In AWS, service accounts are called IAM (identity and access management) roles. We can list IAM roles using the AWS Management Console or the AWS CLI.
Go to the
From the AWS Management Console dashboard, search for "IAM" in the services search bar, and click on "IAM" to open the IAM dashboard.
Click on "Roles" in the left sidebar.
Filter the roles by the "Service" type to view all service accounts.
Here's the visual representation of all the mentioned steps:
If AWS CLI isn't installed, follow the installation instructions
After installation, configure it with the AWS credentials using the following command:
aws configure
To list all IAM roles (service accounts) in the AWS account, run the following command:
aws iam list-roles
This command will display JSON-formatted output containing details about each IAM role, including its name, ARN (Amazon Resource Name), and associated policies.
In Microsoft Azure, there are three service accounts native to Azure Active Directory: Managed identities, service principals, and user-based service accounts. We will use Azure Portal and Azure CLI to demonstrate how to list all these.
Go to the
From the Azure Portal dashboard, search for "Azure Active Directory" in the services search bar, and click on "Azure Active Directory" to open the Azure AD dashboard.
Managed identities: On the Azure AD dashboard, click on "Enterprise applications" in the left sidebar and then filter the applications by the "Managed Identities" category to view all service accounts.
Service principals: On the Azure AD dashboard, click on "App registrations" in the left sidebar. All service principals (app registrations) created in the directory will be listed.
User-based service accounts: On the Azure AD dashboard, click "Users" in the left sidebar. All user accounts will be listed here, including user-based service accounts.
Here's the visual representation of all the mentioned steps:
If Azure CLI isn't installed, follow the installation instructions
Sign in to the Azure account by running the following command:
az login
Managed Identities: To list all managed identities (service accounts) in the Azure subscription, use the following command:
az identity list
Service principals: To list all Service Principals, we can use the following command:
az ad sp list
User-based service accounts: User-based service accounts are essentially Azure AD users. To list all users, we can use the following command:
az ad user list
In conclusion, efficiently managing service accounts across cloud providers (GCP, AWS, and Azure) is essential for maintaining a secure and organized cloud infrastructure. Utilizing the portals and command-line interfaces provided by each platform allows for easy access and control over these service accounts, promoting best practices in cloud security and access management.
Free Resources