Self Remove Contributor access from all my Azure subscriptions - azure

I have been assigned to a lot of Azure subscriptions as a contributor by our customers its more than 200. But I need to remove my contributor access and remove the attachment from their subscriptions. How can I self remove my access or is there any other way I can automate this task without asking the customers one by one?

Simple answer to your question is no, you can't.
By default Contributor role does not give access to granting/revoking permissions and role assignments. Because of this you can't remove yourself (or anybody else).
What you would need to do is contact owner in individual subscriptions and request them to remove yourself. You would also need to contact Azure AD administrators to remove from the Azure ADs associated with these Azure Subscriptions.

Related

Restrict SQL Server access for users having contributor access to subscription in azure

We have added the Contributor role to my azure subscription. And all the user in my directory having the Contributor role. So all the user are able to access the databases/sql servers created in my subscription.
So the problem here is, we have production sql databases exist in same subscription. We wanted to restrict the access for the specific databases. How can we do restrict access to the sql server/database?(Consider all the users are having contributor role and contributor role is assigned to subscription)
Thanks
I do not believe this is possible, unless the resources were created using Azure Blueprints, in which case, you can use a Deny Assignment to restrict access.
You will either need to assign the RBAC roles directly to the resource groups or the individual resources, rather than at the subscription level. Or, if possible, you should consider moving your production resources to another subscription.

Azure Lighthouse onboarding customers not in customers list

Days ago I onboarded a customer using Service Principal with an ARM template in our blob storage, then the client went to this URL:
https://portal.azure.com/#create/Microsoft.Template/uri/{Blob Url}, accepted us as their resource manager, and we could make connections and go-to resources but via PowerShell, why it doesn't show to us in our Azure Lighthouse Customers page?
I can work with the resources, make deployments, and such but doesn't show in the list, I want to know if it is because we need to be gold competency or an expert MSP because we don't want to make a public offer in the market, we just want to manage certain customers.
It should be displayed there. No special conditions are required such as the ones you've mentioned. Are you definitely signed in to your own partner/MSP tenant with an account that has delegated access to the customers? Does anything show up under delegations within the Azure Lighthouse section?
If you have access to the customer tenant, does your company show up under Service Providers within Azure Lighthouse on the Azure portal?
Case closed, the Service Principal itself doesn't have the privileges on the service provider's tenant to make your user a reader. So the solution for this was:
Remove the offer in the customer tenant.
Add new authorization in the ARM template for a user/group with "Reader" built-in role id. (In our case, we decided to use an AD group because people in the organization is temporary)
Upload the new ARM template and re-onboarded the client.
After a couple of hours, the client's subscription showed in the subscription list in the section: Directories + subscriptions, checked it, and saw all the resources from the service provider's tenant.
I found a solution for this issue.
The Azure Lighthouse->My customers list on the azure portal only shows subscriptions activated in the global directories and subscription filter.
Please go to the global directories and subscriptions filter (in the portal top navigation) and open the drop downs for directories and for subscriptions and check, if your customer subscription appears here.
If yes, select all entries in both drop downs.
After that go back to Azure Lighthouse->My customers
and check, if the customer subscription appears now.

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).

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

Can Contributor role in Azure see the data of resources like DB, DWH & blobs?

I want to know if we assign somebody as a contributor role on Azure, then can he or she see the data by default for resources?
Of course, the Contributor role can create and manage all of types of Azure resources. But you should add the role under the subscription, if you just add it in e.g. storage, then it will not be able to access the other resource.
See : https://learn.microsoft.com/en-us/azure/role-based-access-control/rbac-and-directory-admin-roles#azure-rbac-roles
Update:
If we try to download the blob in the portal with an contributor role, we can download it successfully. But we should note, the permission is not from the contributor directly, because the contributor has the permission to list account keys, the portal will do the operations on behalf of us. So more accurately, the contributor could not access the blob directly.
Generally, a contributor role is like a person who can contribute to the resources on Azure, to contribute he also gets read/write access as well. So if a user is a contribute on a database, he can view everything and modify everything in the database resource on Azure.

Resources