What good a service principal does over exposing a password

Viewed 77

I am looking at the documentation of service principals , and come across these phrases

It's important to remove old service principals for the same reason that you delete old user accounts: attackers might gain access to their keys. It's best not to have credentials that aren't actively used.

You might wonder why you need to create this whole new type of object just to authenticate a pipeline, when you have user accounts that work perfectly well. User accounts aren't designed for unattended use. The authentication process for a user account often checks that a human is the entity that's trying to sign in. Increasingly, organizations use additional security checks during authentication. These checks include MFA, CAPTCHA checks, and inspecting the device and network that the user is using so that they can verify the legitimacy of a request to sign in.

It's also a bad idea to save your username and password anywhere, because someone else might get access to them and then use them to impersonate you.

In "both" theories, it seems it is not a good idea to keep / share service principals ( aka passwords ). Is it only reason that passwords are not designed for unattended use we should use service principals which offers secure measures on a case to case basis ?

1 Answers

As per the Official Microsoft Documentation,

When you have applications, hosted services, or automated tools that needs to access or modify resources, you can create an identity for the app. This identity is known as a service principal. Access to resources is restricted by the roles assigned to the service principal, giving you control over which resources can be accessed and at which level.

The user accounts and passwords are not designed for unattended use. Service princpals can be used to give the access to the resources based on the Role-based access control(RBAC).

What service principal object exactly do is it sets the information about a particular app and its resources access.

If you want to avoid the need to manage the credentials you can use Managed Identity.

Reference:

https://docs.microsoft.com/en-us/azure/active-directory/develop/app-objects-and-service-principals#service-principal-object

Related