Azure role that can't create resources - azure

I want to find or create an azure role that has the same capabilities as an Owner, or at the very least a contributer. But this role should not have access to create azure resources.
I've been going through the pre-defined roles that exist.

this makes no sense in Azure RBAC context. you cant edit but not create resources, because this is being governed by the same permission: resource/write.
you can achieve something like that by having a role that can do anything except writes, but that would mean that it cannot edit resources, which is not what you are after, probably.
technically you can grant contributor permissions to each individual resource, that way user wont be able to create new resources, only modify existing ones (he would be able to delete resource).

I have the same requirements, and I managed to configure it by taking the Contributor role as base and adding
"Microsoft.Resources/*/write"
in notActions section of role JSON configuration.
What it does is that it prevents deployments. Every resource creation is a deployment.
As far as I have tested every "edit" operation on resources works, even deployment slot creation for Web Apps, but you can disable that too if you need.

Related

How to create an user in azure portal with read only access to all resources in all subscription?

I want to create an user in azure portal with read only access to all resources in all of my subscription.
This user should not be able to modify any thing in any of my available subscriptions.
Seems You are trying to add a user who should have read only access to all resources in all of your subscription beside This user should not be able to modify anything on the tenant.
So the best way is to add that user as Global Reader(Can read everything that a global administrator can, but not update anything.) Role
Which provides authority to access all resources in all of your
subscription but cannot modify anything among the available
subscriptions.
Hope this would help you.
This only covers Azure Active Directory resources. If you are trying to give read-only to Azure SUBSCRIPTION Resources, add the users to the Azure Role: "Readers".
The best recommendation here will be to add users with the reader permission to each subscription.
You would need to set your RBAC assignments per subscription. In case you have many subscriptions, you can automate this with a Logic App and doing requests to the Management API. Reference here. So on your logic app, you basically get a list of subscriptions, and then iterate them, and make the RBAC add assignment request for each of the subscriptions and for your given user(s).

How to deploy an ARM Template without granting ownership over the entire subscription?

I want to use a service principal to deploy a single ARM template to our Azure account.
I cannot find documentation for how to grant the least possible privilege, but it appears the only way to make this work is to grant contributor on the subscription.
Is there a way to limit the role on my service principal to only deploy ARM Templates or at the very least limit it to a single resource group?
actually, for each template you can figure out the minimum possible permissions by looking at the template, they would be resourcetype + /write. and the permissions to create deployments Microsoft.Resources/deployments/write.
but its really easier to just give a person contributor over the resource group. if you are concerned about security you can use Privileged Identity Management in Azure AD
In the access control (IAM) section under a Resource group you can make the service principle you created 'Contributer'. this will make sure that that user can only deploy resources within that resource group. This way the account doesn't need any permissions on the subscription level.
When you go to the Access Control section click Add, and select "Add role Assignment"
In the panel that shows you can select the role "Contributer" and lookup the Service principle you created.
Then click 'Save' to finish and you should be good to go
I tend to make service connections (with separate Service Principles) in DevOps per environment this makes it clear what resources you can touch and prevents people from accidentally deploying to incorrect locations from a pipeline because the typed in the wrong resource group name.

Divide Owner RBAC Role of Azure

I am trying to divide the Azure Owner RBAC role between IAM actions and Other Actions, is it possible if yes then please help.
I have tried to list out all the actions of all the Azure RBAC roles and tried to distinguish between IAM and Other actions but this is not a good practice i know, even i have tried to list out actions of Owner role which is "*". i have tried 100's of websites as well for the solutions but dint work for me
As mentioned in the comment, I think you can use the Contributor, compared to Owner, it can do anything as the Owner but not manage the access to resources(the AD related thing you said).
For the AD related thing of Owner, you could just check the NotActions of Contributor.
And if you want to divide the Owner's permissions in two, I think it does not make sense, because once your custom role has the permission to manage the access to resources, he can assign other roles(e.g. Owner) to anyone like himself.
So in your case, you could just assign the Owner to the user who should need the most permissions, assign the Contributor to the user that you don't want to give the permissions of AD related thing.
As far as I know, Azure RABC role is used to manage azure resource. Regarding how to manage actions in Azure AD, Azure provides other roles to control it. For more details, please refer to
https://learn.microsoft.com/en-us/azure/active-directory/users-groups-roles/directory-assign-admin-roles
https://learn.microsoft.com/en-us/azure/role-based-access-control/overview
https://learn.microsoft.com/en-us/azure/role-based-access-control/rbac-and-directory-admin-roles

Blocking RBAC inheritance

I'm creating subscriptions in Azure with a number of RBAC roles assigned: hosting team and project team. The hosting team should have full access to everything, and the project team should have full access to everything baring a few exception, e.g. no access to the 'Networking' resource group (although they are allowed to create their own resource group(s) containing networking). We have set the RBAC owner for the project team at the subscription level, but in doing so, this also allows them to fully manage the restricted areas.
In principal the 'deny' assignments in Azure Portal would fit our needs, however they are currently only available for Azure Blueprints. Any ideas?
Block inheritance doesnt exist yet, your only option is to carefully craft and assing custom rbac roles or carefully assing built-in roles (so, never at sub level, only at resource group level).
Or use Azure Blueprints, it appears they added support for that there.

Azure Migration of Resources To New Account Before Deletion of User Account

I had one doubt regarding resource management via Azure Portal.
Although, I am aware that migration to another subscription and tenant is possible along with movement of resources between resource groups but I am not sure if the access to resources will still remain available after I add someone via access control but the account giving access itself gets deleted or removed.
I wanted to know if it was possible to migrate the resources with full permissions to another user account if some account is removed from Azure which was used to create the resources in first place.
The account used to create a resource is no longer relevant after the resource is created. Other than the activity log entry, Azure doesn't track who created a resource, and if that original user account is deleted it will have no effect on the resource or any other user's access to it.

Resources