When you are logging in (obtaining a token) in the context of a user, the effective permissions you get are the cross-section of the permissions granted to the app (service principal) and those granted to the user. So in your scenario, the user still needs to have Contributor permissions on the resource group. And as you mentioned above, if you are too worried about this scenario, you can simply restrict the app/SP to specific users only. Or only enable the client credentials flow to begin with.
DevOps: Azure Enterprise Application - login via Secret vs. interactive -> Security Issue?
I have a rather (hopefully) theoretical question regarding the secure usage of Service Pricipals in Azure (Enterprise Applications)
Introduction
we currently deploy our DevOps Code via Azure Service Principals.
- AppRegistration/Enterprise App is created
- Secret is generated
- Permission (i.e. Contributor) to the Ressource Group is granted in Azure
- Service Connection is made in Devops everything works fine.
Assumption
By default the Service Principal (Enterprise Application) is not restricted to a specific user/group (Assignment Required => "no").
My assumption is now, that every user in the AAD-Tenant is able to login to the Enterprise Application as well.
I i.e. do this by using the "Graph Powershell API"-EnterpriseApp.
I can either use a Secret or use my User Credentials to access the Service Principal and its permissions.
Security issue?
coming back to our DevOps configuration:
The Service Principal has Contributor Permission on the dedicated Resource Group.
Assignment Required (of the Enterprise App) is set to no (default configuration).
if I (as a malicious user) have the Application ID, i could simply logon to the Service Principal and receive the Token.
Question:
With this token and my login to the EnterpriseApp, do i also have the Contributor Permissions of the App and could now manipulate the whole Resource Group?
Since i'm not an Azure Developer - but only an Azure AD Admin - my knowledge regarding this is limited, so i'm not able to test it.
Can someone maybe either provide code or prove that my assumptions are wrong or correct?!
Thanks
Azure Role-based access control
Microsoft Security Microsoft Entra Microsoft Entra ID
-
Vasil Michev 119.5K Reputation points MVP Volunteer Moderator
2022-12-10T08:29:53.107+00:00