Active Directory membership permissions Domain ello - active-directory

I need some help understanding the behavior of AD and the security around it.
In a nutshell I have a requirement to automate just in time elevation to certain privileged groups, where Domain Admins is one of the groups we need to add membership to.
Here is a summary on the way I set things up
I created a new group called DomainAdminJit which is a member of "Domain Admins", I add a service account as a delegate to DomainAdminJit to modify membership where I expect to add users to this group instead of the domain admin group directly, for organization purposes mainly.
This works fine but a few minutes later all permissions are to the service account are being stripped, researching this turms out to be done because the AdminSDHolder is reverting those permissions.
My initial reaction was to add the service account with write properties and write permissions to the AdminSDHolder container, but somehow that doesn't work.
I do see the service account now at the DomainAdminsJit group however I get insufficient rights when attempting to add a user to the DomainAdminsJit using that service account.
What am I missing and how do I ensure that service account is always able to add members to a group that is a member of Domain admins and not have the permissions revert?
Your help would greatly be appreciated
Thank you

Related

For a Service Principal which permission to give to use command Get-AzNetworkServiceTag?

I create successfully a ServicePrincipal (SP) in AzureAD and able to do a lot of stull like {Connect to Azure, Create resource, etc...}
I need my SP to use command Get-AzNetworkServiceTag but it always return empty values.
When I try command command Get-AzNetworkServiceTag with my own account I get expected result. I believe problem come from permission and your help is very welcome to set least privilege.
My current permissions looks like:
Do you know which one should I use ?
Alternative question is what is best practices to determine permissions based on powershell command ? Although permissions could name to determine there is so many that it's difficult to choose correct one. Thanks you.
The command Get-AzNetworkServiceTag essentially calls the Azure Management REST API - Service Tags - List, it is not related to Azure AD, to solve the issue, you need to assign the Azure RBAC role(not Azure AD admin role) to your service principal.
To solve the issue, the easiest way is to assign the built-in role e.g. Reader, Contributor to your service principal at the subscription scope. But if you want to the
least privilege, your option is to create a custom role then use it, you could follow the steps below.
1.Navigate to your subscription in the portal -> Access control (IAM) -> Add -> Add custom role, follow the screenshots.
Then skip the Permissions, in the JSON, click Edit, add Microsoft.Network/*/read to actions -> Next and create it.
After creating the custom role, wait for a while, navigate to the Access control (IAM) -> add the custom role to your service principal.
In conclusion, the Microsoft.Network/*/read action permission is the least privilege in this case, after giving the role, it will work fine.
Alternative question is what is best practice to determine permissions based on powershell command?
You just need to know what does the command do, then find the operation in the Azure resource provider operations, in this case, there is no such operation like Microsoft.Network/serviceTags/read, so we need to use Microsoft.Network/*/read at least.
You are facing this issue because Powershell cmdlet works differently than compared to MS Graph. Instead of permissions, Powershell require roles to do this operations. Please add Global Administrator role to your service principle and then try the Connect-AzAccount so that, the issue will be fixed.
For more details, you may refer to Assigning administrator roles in Azure Active Directory.

Multiple PIM Profiles

Is it possible to have multiple profiles for a PIM role within Azure? If not, is this something that is on the roadmap?
Question from customer: "as you know you can customize the roles to specify the window for that privilege, the approvers and so on. Could you have multiple profiles for each role in the future?"
This is possible with the privileged access groups feature. Simply create two groups, apply different policies and make the users eligible for the group (do not assign the group as eligible, since the members are eligible for the group, which would require them to activate twice). Documentation can be found at aka.ms/pag
Thanks Steve, but what I can see it's only for Azure AD roles, right? It's not possible to assign Azure resources.
Thanks again!
When you create a new privileged access group you can only assign Azure AD roles but not Azure resources roles during the creation, that's what I meant... because with that you can modify the properties for that specific role, in terms of time of the privileged mode, who are the approvers, and so on... will it be available in the future?
Do we know when will it be in GA?
Thanks!!
Ignore assigning roles at group creation time. Simply create the role and enable it for role assignment (this part is required if you want to use it with PIM). Once it's created (even with no AAD roles assigned to it) you can enable the group for Privileged access. After enabling the group for privileged access you can assign members as Eligible, and configure assignment and activation settings for the member and/or owner roles. ETA for GA of this feature (privileged access groups) is end of the calendar year.

Check group add remove permissions for Active Directory service account

We need to now how we can check whether an account in AD has permissions to add/remove membership on AD group. AD team will be giving our service account permissions for 1000 groups at one time and we want to know a way to check quickly if we really do have permissions before confirming. Any help would be appreciated!
This is hard to answer except for the fact that when they give you permission you can test adding and removing a test user to a group. But this will all depend on the fact if the groups have all the standard default permissions when created, also the method that the AD team will give you access. Adding you to a built in group that has permission to edit the AD group, or if they are going to create a new group and add that to the AD groups. Sorry to be vague but a lot of variable here.

Not able to add new user in VSTS

I am added to project collection administrator group in VSTS. Still not able to add a new user. I am added using my official email ID i.e. Microsoft work account.
Its says
Guest users are not allowed to perform this action.
I saw the reason on this link
I believe the primary reason for this error is because when a co-admin
with Microsoft account is added to a subscription, it gets added into
the subscription AD as Guest user type.
but since it is very old thread i like to know if there is an easy way to get myself ability to add new user or basically manage VSTS on behalf of client. I hate requesting client to add a new user in team. Also he is not tech savvy so I would like suggest him a simple solution (running Powershell might be annoying for him).
You are inviting users from outside directory. The user will be able to access the account and its resources, so you need the enough permission to add new user to the AD, but you are the Guest user, so it throws Guest Users are not allowed to perform this action.
You need to contact to the corresponding user (e.g. AD admin) to add users to AD or grant the enough role and permission to you to add user to AD.
No easy way to do this, because it is related to security.

Appication Active Directory Support, what does it exactly mean?

I can check user in active directory, if he exist then I give him permission to open app window, but what if an application has many levels of permission? Do I create special groups of permission in active direcotry and check if user belongs to one of them? . Can application log in automaticaly, or there is always need to enter password?
Active Directory can fulfill two related but seperate functions for an application: Authorization and Authentication.
Authentication is validating that the person using your application is a valid user. If you have the user's credentials (i.e. the application prompts the user for their username and password), you can authenticate them against AD by attempting a connection using their username/password.
Authorization is what lets you determine the level of permissions a particular user has in your application. Active Directory groups are a relatively straightforward and flexible way to implement the various permissions levels. Typically, I will create very fine-grained permissions groups that represent each securable action users can perform in the application (i.e. CanDeleteWidgets, CanAddWidgets, CanEditWidgets ). Then create functional or role groups where you place the users for that role (i.e. Managers, Coordinators, Technicians, etc). Finally, you just nest the role groups into the permissions groups so if, for example, the business requirement is that Managers can delete widgets, you would add the Managers group as a member of the CanDeleteWidgets group. While this may seem more complex, it makes it extremely simple to respond to changing business security requirements (i.e. "Technicians need to be able to delete widgets" - Piece of cake. Add the Technicians role group to the CanDeleteWidgets permissions group and you're done).
As far as logging in automatically, yes, there are a number of ways you can automatically log in a user. For winforms apps, you should just be able to grab the currently logged in user and use that. For web apps, if you can use integrated authentication, you end up with the same thing. Your web server will handle the authentication piece and send over the DOMAIN\USERNAME of the user in a server header variable.

Resources