AzureAD Priviledged Access Management (Group Management) from ServiceNow - Cannot assign time-bound (temporary) group assignment - api

Trying to use API to temporarily assign Users to Groups in Azure AD Azure AD - Privileged Identity Management (PIM) from ServiceNow using ServiceNow - Azure AD Spoke.
I can create group assignment in AzureAD as 'Permanent' but I cannot set it to temporary ('eligible').
My groups' types in AzureAd provisioned form ServiceNow
As per PIM docs, this is what I want:
-> Assign time-bound access to resources using start and end dates

I tried to reproduce the same in my environment:
The Azure AD Privileged Identity Management (PIM) service ,the eligible role can be activated when the role is needed to work, and its permissions expire once done.
Eligible is when use can decide to end it when needed , where as Active assignment is when the start and end dates are given prior to starting.
Both of them has the permanent option to enable role assignment that never ends.
In your case .It might have the permanent check box enabled by default:
The administrator can change this if need:
Then unselect the permanent check box , to give only temporary access:
Then the temporary access is given with the selected end date and time.
Same goes to active assignments:
Reference: What is Privileged Identity Management? - Azure AD - Microsoft Entra | Microsoft Learn

Related

New environment has all users added by default and cannot remove users?

I have created a new environment where I only want a sub set of people to be able to create apps and flows. However it seems like everybody is added by default and cannot be removed?
This is the expected functionality. When you create a Dataverse database in an environment all licensed users will be added. Users do not have any access to the database unless you assign them a security role.
Once a user is added to the Dataverse database that user record cannot be deleted. They can be inactivated, but not deleted.
You can control this behavior by defining a security group at the time of database creation. If you define a security group only the members of the security group will be added as users to the database.
When creating the database you can assign a security group:
From https://learn.microsoft.com/en-us/power-platform/admin/control-user-access:
When users are added to the security group, they are added to the Dataverse environment.
When users are removed from the group, they are disabled in the Dataverse environment.
When a security group is associated with an existing environment with users, all users in the environment that are not members of the group will be disabled.
If a Dataverse environment does not have an associated security group, all users with a Dataverse license (customer engagement apps (Dynamics 365 Sales, Dynamics 365 Customer Service, Dynamics 365 Field Service, Dynamics 365 Marketing, and Dynamics 365 Project Service Automation), Power Automate, Power Apps, etc.) or per app plan will be created as users and enabled in the environment.
If a security group is associated with an environment, only users with Dataverse licenses or per app plan that are members of the environment security group will be created as users in the Dataverse environment.
When you assign a security group to an environment, that environment will not show up in home.dynamics.com for users not in the group.
If you do not assign a security group to an environment, the environment will show up in home.dynamics.com even for those who have not been assigned a security role in that Dataverse environment.
If you do not specify a security group, all users who have a Dataverse license (customer engagement apps (such as Dynamics 365 Sales and Customer Service)) or per app plan will be added to the new environment.
New: Security groups cannot be assigned to default and developer environment types. If you've already assigned a security group to your default or developer environment, we recommend removing it since the default environment is intended to be shared with all users in the tenant and the developer environment is intended for use by only the owner of the environment.
Dataverse environments support associating the following group types: Security and Microsoft 365. Associating other group types is not supported.

How to add Azure AD Groups in Azure SQL Server

Can someone tell me how can I add Azure Active Directory groups into the azure sql server, I am using server manager tool to do this but cant find any way to figure this out, I can add simple Azure Active Directory user though..What about groups?
I will assume that you are wanting to provide access for end-users to connect, not Database Administrators. For my example below, let's say that the end-users are in a group called "AZ-Users", and that your Database Administrators (including you) are in a group called "AZ-DBAs".
For Azure SQL Databases, there are key things that must be in place to get this to work:
There must be an "Active Directory admin" configured for your server. This can be any AAD user or an AAD group. You can check if this has been set or not by going to the Azure portal page for your server. Be careful that you are looking at the Overview page for the server, not the individual database, they are not the same thing. Detailed instructions here. In our example, we would configure this to be the AAD group called "AZ-DBAs".
When you are ready to create the AAD login for "AZ-Users" on your Azure SQL Database, you must yourself be logged in using AAD... meaning a member of the "AZ-DBAs" group from my example above. You can use SSMS or any other similar tool for executing TSQL commands. Note that if you try a SQL auth connection instead, it won't work for step 4 below - you'll get this error:
Msg 33159, Level 16, State 1, Line 1
Principal 'AZ-Users' could not be created. Only connections established with Active Directory accounts can create other Active Directory users.
Change the context to the database you want to provide access to for your end users.
Execute this statement:
CREATE USER [AZ-Users] FROM EXTERNAL PROVIDER
Note that this will create a "contained database user", as detailed here. That's it. This process works for AAD groups and AAD users.
You will probably also want to grant some level of permissions as well, such as:
EXEC sp_addrolemember 'db_datareader', 'AZ-Users'
All you need to know about how to configure and manage Azure Active Directory Authentication you can find it in this article.
Then to connect to SQL Azure using Azure Active Directory authentication please read here.
Connect to the server via SSMS as your Azure AD admin. Create a new query with the db you want to affect. Run this:
ALTER ROLE db_datareader ADD MEMBER [AzureADGroupName];
GO
To modify permissions, do something like this:
ALTER ROLE db_datareader ADD MEMBER [AzureADGroupName];
GO

Azure DataSync with SQL Azure databases across subscriptions

I am trying to synchronise databases in two different subscriptions using Azure datasync on the new portal
https://learn.microsoft.com/en-us/azure/sql-database/sql-database-get-started-sql-data-sync
On the portal, I do not get the ability to choose subscription or connection string to connect to a Azure database on a different subscription (this is not on premise)
The options presented are either
a) Database from existing subscription + database server
b) on-premise database- with a sync agent to be downloaded
Can linking to another database via connection string be implemented via API's or is there any restriction or feature limitation around this?
Based on your comment, your issue is due to you having different logins for each subscription. In order to achieve what you want to do, you will need to cross add the various users to the subscriptions.
First, log into your Azure portal. Navigate to the subscription you are the admin for. Click on Access control (IAM) to manage the permissions for it.
Click the Add button which will bring up a dialog to add permissions. Simply select the role you wish to grant (I believe you will need contributor for this) and enter the email address of the user that you want to grant permissions to.

Creating database role in sql server that can be mapped to multiple logins

Scenario..
1 database role - 5 developers needs to be mapped with same access.
All 5 developers must login to sql server using there own username and password.
I want all these 5 developers must be mapped to 1 unique database role. So that if I changes permissions of this roles. All the developers are promoted to same permissions.
How to do this.
Currently when I creates a login using wizard It asks me for creating database user along with it. Which I don't want bcoz I want all logins to be mapped to single role.
Never create database logins for individual users.
First step is to create an NT group:
Net Localgroup MyDatabaseLoginGroup /Add
Net LocalGroup MyDatabaseLoginGroup /Add UserName1
Alternatively you could use a Domain login for this.
Second step is to create a Server and Database login for the group DOMAIN\MyDatabaseLoginGroup. Call it MydatabaseLoginGroup.
Third step is to create a database Role, DatabaseRoleName and make the group a member of it.
You should manage all internal permissions via database roles. You can make the Database logins map to as many roles as you like. Ideally each role would encompass a reasonable set of required functionality which can be granted as a block.

microsoft sql server: check users own permissions

I have a Microsoft SQL server database and a set of users.
Now in my app I want to make some functionality only visible, if the user has entered username and password with certain rights (admin).
Since the databases and the usernames and their rights can change, how do i check what permissions/rights an Microsoft SQL server user has?
You can check current user's right on certain securables using [sys.fn_mypermissions][1] which returns all permission on the securable. You can also check a specific permission with HAS_PERMS_BY_NAME. Eg. you can check for CONTROL SERVER permission which implies an administrator is logged in:
SELECT HAS_PERMS_BY_NAME(null, null, 'CONTROL SERVER');
The simplest way to do this is using the IS_MEMBER('rolename') function, that checks whether the user is in the role/group 'db_owner'. The function will perform a check at database level, and returns 1 (Int32), if the user has the specified role.
If you need to check at server level, you can use the IS_SRVROLEMEMBER function. Both are available since SQL Server 2005.
I'm not entirely certain that I understand your problem definition however assuming I do.....
I would suggest that you create a SQL Server Database Role that you can add the relevant application users to, perhaps via some group membership maintained within the App (or a Windows Domain Group). You can use the group to Role mapping to independently manage user membership, from managing the relevant permissions to securables within the database via the Role.
This way, you just need to check that an application User is a member of the relevant application or windows group, without the need to query the security configuration of SQL Server.