Skip to content

Commit 5d929e7

Browse files
authored
Merge pull request #250182 from MicrosoftDocs/main
Publish to live, Sunday 4:00PM PDT, 9/3
2 parents 7b4f2a0 + de5faed commit 5d929e7

File tree

4 files changed

+53
-45
lines changed

4 files changed

+53
-45
lines changed

articles/active-directory/roles/custom-create.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ Your custom role will show up in the list of available roles to assign.
5959

6060
### Connect to Azure
6161

62-
To connect to Azure Active Directory, use the following command:
62+
To connect to Microsoft Graph PowerShell, use the following command:
6363

6464
``` PowerShell
65-
Connect-AzureAD
65+
Connect-MgGraph -Scopes "RoleManagement.Read.All"
6666
```
6767

6868
### Create the custom role
@@ -81,10 +81,10 @@ $allowedResourceAction =
8181
"microsoft.directory/applications/basic/update",
8282
"microsoft.directory/applications/credentials/update"
8383
)
84-
$rolePermissions = @{'allowedResourceActions'= $allowedResourceAction}
84+
$rolePermissions = @(@{AllowedResourceActions= $allowedResourceAction})
8585
8686
# Create new custom admin role
87-
$customAdmin = New-AzureADMSRoleDefinition -RolePermissions $rolePermissions -DisplayName $displayName -Description $description -TemplateId $templateId -IsEnabled $true
87+
$customAdmin = New-MgRoleManagementDirectoryRoleDefinition -RolePermissions $rolePermissions -DisplayName $displayName -IsEnabled -Description $description -TemplateId $templateId
8888
```
8989

9090
### Assign the custom role using PowerShell
@@ -93,15 +93,15 @@ Assign the role using the below PowerShell script:
9393

9494
``` PowerShell
9595
# Get the user and role definition you want to link
96-
$user = Get-AzureADUser -Filter "userPrincipalName eq '[email protected]'"
97-
$roleDefinition = Get-AzureADMSRoleDefinition -Filter "displayName eq 'Application Support Administrator'"
96+
$user = Get-MgUser -Filter "userPrincipalName eq '[email protected]'"
97+
$roleDefinition = Get-MgRoleManagementDirectoryRoleDefinition -Filter "DisplayName eq 'Application Support Administrator'"
9898
9999
# Get app registration and construct resource scope for assignment.
100-
$appRegistration = Get-AzureADApplication -Filter "displayName eq 'f/128 Filter Photos'"
100+
$appRegistration = Get-MgApplication -Filter "Displayname eq 'POSTMAN'"
101101
$resourceScope = '/' + $appRegistration.objectId
102102
103103
# Create a scoped role assignment
104-
$roleAssignment = New-AzureADMSRoleAssignment -DirectoryScopeId $resourceScope -RoleDefinitionId $roleDefinition.Id -PrincipalId $user.objectId
104+
$roleAssignment = New-MgRoleManagementDirectoryRoleAssignment -DirectoryScopeId $resourcescope -RoleDefinitionId $roledefinition.Id -PrincipalId $user.Id
105105
```
106106

107107
## Create a role with the Microsoft Graph API

articles/active-directory/roles/manage-roles-portal.md

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -101,65 +101,69 @@ Follow these steps to assign Azure AD roles using PowerShell.
101101
1. Open a PowerShell window and use [Import-Module](/powershell/module/microsoft.powershell.core/import-module) to import the AzureADPreview module. For more information, see [Prerequisites to use PowerShell or Graph Explorer](prerequisites.md).
102102

103103
```powershell
104-
Import-Module -Name AzureADPreview -Force
104+
Import-Module -Name Microsoft.Graph.Identity.Governance -Force
105105
```
106106
107-
1. In a PowerShell window, use [Connect-AzureAD](/powershell/module/azuread/connect-azuread) to sign in to your tenant.
107+
1. In a PowerShell window, use [Connect-MgGraph](/powershell/microsoftgraph/authentication-commands?view=graph-powershell-1.0&preserve-view=true) to sign in to your tenant.
108108
109109
```powershell
110-
Connect-AzureAD
110+
Connect-MgGraph -Scopes "RoleManagement.ReadWrite.Directory"
111111
```
112112
113-
1. Use [Get-AzureADUser](/powershell/module/azuread/get-azureaduser) to get the user you want to assign a role to.
113+
1. Use [Get-MgUser](/powershell/module/microsoft.graph.users/get-mguser?view=graph-powershell-1.0&preserve-view=true) to get the user you want to assign a role to.
114114
115115
```powershell
116-
$user = Get-AzureADUser -Filter "userPrincipalName eq 'user@contoso.com'"
116+
$user = Get-MgUser -Filter "userPrincipalName eq 'johndoe@contoso.com'"
117117
```
118118
119119
### Assign a role
120120
121-
1. Use [Get-AzureADMSRoleDefinition](/powershell/module/azuread/get-azureadmsroledefinition) to get the role you want to assign.
121+
1. Use [Get-MgRoleManagementDirectoryRoleDefinition](/powershell/module/microsoft.graph.identity.governance/get-mgrolemanagementdirectoryroledefinition?view=graph-powershell-1.0&preserve-view=true) to get the role you want to assign.
122122
123123
```powershell
124-
$roleDefinition = Get-AzureADMSRoleDefinition -Filter "displayName eq 'Billing Administrator'"
124+
$roledefinition = Get-MgRoleManagementDirectoryRoleDefinition -Filter "DisplayName eq 'Billing Administrator'"
125125
```
126126
127-
1. Use [New-AzureADMSRoleAssignment](/powershell/module/azuread/new-azureadmsroleassignment) to assign the role.
127+
1. Use [New-MgRoleManagementDirectoryRoleAssignment](/powershell/module/microsoft.graph.identity.governance/new-mgrolemanagementdirectoryroleassignment?view=graph-powershell-1.0&preserve-view=true) to assign the role.
128128
129129
```powershell
130-
$roleAssignment = New-AzureADMSRoleAssignment -DirectoryScopeId '/' -RoleDefinitionId $roleDefinition.Id -PrincipalId $user.objectId
130+
$roleassignment = New-MgRoleManagementDirectoryRoleAssignment -DirectoryScopeId '/' -RoleDefinitionId $roledefinition.Id -PrincipalId $user.Id
131131
```
132132
133133
### Assign a role as eligible using PIM
134134
135135
If PIM is enabled, you have additional capabilities, such as making a user eligible for a role assignment or defining the start and end time for a role assignment. These capabilities use a different set of PowerShell commands. For more information about using PowerShell and PIM, see [PowerShell for Azure AD roles in Privileged Identity Management](../privileged-identity-management/powershell-for-azure-ad-roles.md).
136136
137137
138-
1. Use [Get-AzureADMSRoleDefinition](/powershell/module/azuread/get-azureadmsroledefinition) to get the role you want to assign.
138+
1. Use [Get-MgRoleManagementDirectoryRoleDefinition](/powershell/module/microsoft.graph.identity.governance/get-mgrolemanagementdirectoryroledefinition?view=graph-powershell-1.0&preserve-view=true) to get the role you want to assign.
139139
140140
```powershell
141-
$roleDefinition = Get-AzureADMSRoleDefinition -Filter "displayName eq 'Billing Administrator'"
141+
$roledefinition = Get-MgRoleManagementDirectoryRoleDefinition -Filter "DisplayName eq 'Billing Administrator'"
142142
```
143143
144-
1. Use [Get-AzureADMSPrivilegedResource](/powershell/module/azuread/get-azureadmsprivilegedresource) to get the privileged resource. In this case, your tenant.
144+
1. Use the following command to create a hash table to store all the necessary attributes required to assign the role to the user. The Principal ID will be the user id to which you want to assign the role. In this example, the assignment will be valid only for **10 hours**.
145145
146146
```powershell
147-
$aadTenant = Get-AzureADMSPrivilegedResource -ProviderId aadRoles
148-
```
149-
150-
1. Use [New-Object](/powershell/module/microsoft.powershell.utility/new-object) to create a new `AzureADMSPrivilegedSchedule` object to define the start and end time of the role assignment.
151-
152-
```powershell
153-
$schedule = New-Object Microsoft.Open.MSGraph.Model.AzureADMSPrivilegedSchedule
154-
$schedule.Type = "Once"
155-
$schedule.StartDateTime = (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss.fffZ")
156-
$schedule.EndDateTime = "2021-07-25T20:00:00.000Z"
147+
$params = @{
148+
"PrincipalId" = "053a6a7e-4a75-48bc-8324-d70f50ec0d91"
149+
"RoleDefinitionId" = "b0f54661-2d74-4c50-afa3-1ec803f12efe"
150+
"Justification" = "Add eligible assignment"
151+
"DirectoryScopeId" = "/"
152+
"Action" = "AdminAssign"
153+
"ScheduleInfo" = @{
154+
"StartDateTime" = Get-Date
155+
"Expiration" = @{
156+
"Type" = "AfterDuration"
157+
"Duration" = "PT10H"
158+
}
159+
}
160+
}
157161
```
158162
159-
1. Use [Open-AzureADMSPrivilegedRoleAssignmentRequest](/powershell/module/azuread/open-azureadmsprivilegedroleassignmentrequest) to assign the role as eligible.
163+
1. Use [New-MgRoleManagementDirectoryRoleEligibilityScheduleRequest](/powershell/module/microsoft.graph.identity.governance/new-mgrolemanagementdirectoryroleeligibilityschedulerequest?view=graph-powershell-1.0&preserve-view=true) to assign the role as eligible. Once the role has been assigned, it will reflect on the Azure portal under **Privileged Identity Management -> Azure AD Roles -> Assignments -> Eligible Assignments** section.
160164
161165
```powershell
162-
$roleAssignmentEligible = Open-AzureADMSPrivilegedRoleAssignmentRequest -ProviderId 'aadRoles' -ResourceId $aadTenant.Id -RoleDefinitionId $roleDefinition.Id -SubjectId $user.objectId -Type 'AdminAdd' -AssignmentState 'Eligible' -schedule $schedule -reason "Review billing info"
166+
New-MgRoleManagementDirectoryRoleEligibilityScheduleRequest -BodyParameter $params | Format-List Id, Status, Action, AppScopeId, DirectoryScopeId, RoleDefinitionId, IsValidationOnly, Justification, PrincipalId, CompletedDateTime, CreatedDateTime
163167
```
164168
165169
## Microsoft Graph API

articles/azure-monitor/logs/basic-logs-configure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ All custom tables created with or migrated to the [data collection rule (DCR)-ba
190190
| Container Apps | [ContainerAppConsoleLogs](/azure/azure-monitor/reference/tables/containerappconsoleLogs) |
191191
| Container Insights | [ContainerLogV2](/azure/azure-monitor/reference/tables/containerlogv2) |
192192
| Container Apps Environments | [AppEnvSpringAppConsoleLogs](/azure/azure-monitor/reference/tables/AppEnvSpringAppConsoleLogs) |
193-
| Communication Services | [ACSCallAutomationIncomingOperations](/azure/azure-monitor/reference/tables/ACSCallAutomationIncomingOperations)<br>[ACSCallAutomationMediaSummary](/azure/azure-monitor/reference/tables/ACSCallAutomationMediaSummary)<br>[ACSCallRecordingIncomingOperations](/azure/azure-monitor/reference/tables/ACSCallRecordingIncomingOperations)<br>[ACSCallRecordingSummary](/azure/azure-monitor/reference/tables/ACSCallRecordingSummary)<br>[ACSCallSummary](/azure/azure-monitor/reference/tables/ACSCallSummary)<br>[ACSRoomsIncomingOperations](/azure/azure-monitor/reference/tables/acsroomsincomingoperations) |
193+
| Communication Services | [ACSCallAutomationIncomingOperations](/azure/azure-monitor/reference/tables/ACSCallAutomationIncomingOperations)<br>[ACSCallAutomationMediaSummary](/azure/azure-monitor/reference/tables/ACSCallAutomationMediaSummary)<br>[ACSCallRecordingIncomingOperations](/azure/azure-monitor/reference/tables/ACSCallRecordingIncomingOperations)<br>[ACSCallRecordingSummary](/azure/azure-monitor/reference/tables/ACSCallRecordingSummary)<br>[ACSCallSummary](/azure/azure-monitor/reference/tables/ACSCallSummary)<br>[ACSJobRouterIncomingOperations](/azure/azure-monitor/reference/tables/ACSJobRouterIncomingOperations)<br>[ACSRoomsIncomingOperations](/azure/azure-monitor/reference/tables/acsroomsincomingoperations) |
194194
| Confidential Ledgers | [CCFApplicationLogs](/azure/azure-monitor/reference/tables/CCFApplicationLogs) |
195195
| Data Manager for Energy | [OEPDataplaneLogs](/azure/azure-monitor/reference/tables/OEPDataplaneLogs) |
196196
| Dedicated SQL Pool | [SynapseSqlPoolSqlRequests](/azure/azure-monitor/reference/tables/synapsesqlpoolsqlrequests)<br>[SynapseSqlPoolRequestSteps](/azure/azure-monitor/reference/tables/synapsesqlpoolrequeststeps)<br>[SynapseSqlPoolExecRequests](/azure/azure-monitor/reference/tables/synapsesqlpoolexecrequests)<br>[SynapseSqlPoolDmsWorkers](/azure/azure-monitor/reference/tables/synapsesqlpooldmsworkers)<br>[SynapseSqlPoolWaits](/azure/azure-monitor/reference/tables/synapsesqlpoolwaits) |

articles/defender-for-cloud/just-in-time-access-usage.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how just-in-time VM access (JIT) in Microsoft Defender for Cl
44
ms.topic: how-to
55
author: dcurwin
66
ms.author: dacurwin
7-
ms.date: 06/29/2023
7+
ms.date: 08/27/2023
88
---
99

1010
# Enable just-in-time access on VMs
@@ -13,7 +13,7 @@ You can use Microsoft Defender for Cloud's just-in-time (JIT) access to protect
1313

1414
Learn more about [how JIT works](just-in-time-access-overview.md) and the [permissions required to configure and use JIT](#prerequisites).
1515

16-
In this article, you learn you how to include JIT in your security program, including how to:
16+
In this article, you learn how to include JIT in your security program, including how to:
1717

1818
- Enable JIT on your VMs from the Azure portal or programmatically
1919
- Request access to a VM that has JIT enabled from the Azure portal or programmatically
@@ -30,11 +30,11 @@ In this article, you learn you how to include JIT in your security program, incl
3030

3131
## Prerequisites
3232

33-
- JIT Requires [Microsoft Defender for Servers Plan 2](plan-defender-for-servers-select-plan.md#plan-features) to be enabled on the subscription.
33+
- JIT requires [Microsoft Defender for Servers Plan 2](plan-defender-for-servers-select-plan.md#plan-features) to be enabled on the subscription.
3434

3535
- **Reader** and **SecurityReader** roles can both view the JIT status and parameters.
3636

37-
- If you want to create custom roles that can work with JIT, you need the details from the following table:
37+
- If you want to create custom roles that work with JIT, you need the details from the following table:
3838

3939
| To enable a user to: | Permissions to set|
4040
| --- | --- |
@@ -50,9 +50,13 @@ In this article, you learn you how to include JIT in your security program, incl
5050
> [!TIP]
5151
> To create a least-privileged role for users that need to request JIT access to a VM, and perform no other JIT operations, use the [Set-JitLeastPrivilegedRole script](https://github.com/Azure/Azure-Security-Center/tree/main/Powershell%20scripts/JIT%20Scripts/JIT%20Custom%20Role) from the Defender for Cloud GitHub community pages.
5252
53+
54+
> [!NOTE]
55+
> In order to successfully create a custom JIT policy, the policy name, together with the targeted VM name, must not exceed a total of 56 characters.
56+
5357
## Work with JIT VM access using Microsoft Defender for Cloud
5458

55-
You can use Defender for Cloud or you can programmatically enable JIT VM access with your own custom options, or you can enable JIT with default, hard-coded parameters from Azure Virtual machines.
59+
You can use Defender for Cloud or you can programmatically enable JIT VM access with your own custom options, or you can enable JIT with default, hard-coded parameters from Azure virtual machines.
5660

5761
**Just-in-time VM access** shows your VMs grouped into:
5862

@@ -69,13 +73,13 @@ You can use Defender for Cloud or you can programmatically enable JIT VM access
6973

7074
### Enable JIT on your VMs from Microsoft Defender for Cloud
7175

72-
:::image type="content" source="./media/just-in-time-access-usage/configure-just-in-time-access.gif" alt-text="Screenshot showing configuring JIT VM access in Microsoft Defender for Cloud.":::
76+
:::image type="content" source="./media/just-in-time-access-usage/configure-just-in-time-access.gif" alt-text="Screenshot showing configuring JIT VM access in Microsoft Defender for Cloud." lightbox="media/just-in-time-access-usage/configure-just-in-time-access.gif":::
7377

7478
From Defender for Cloud, you can enable and configure the JIT VM access.
7579

7680
1. Open the **Workload protections** and, in the advanced protections, select **Just-in-time VM access**.
7781

78-
1. In the **Not configured** virtual machines, mark the VMs to protect with JIT and select **Enable JIT on VMs**.
82+
1. In the **Not configured** virtual machines tab, mark the VMs to protect with JIT and select **Enable JIT on VMs**.
7983

8084
The JIT VM access page opens listing the ports that Defender for Cloud recommends protecting:
8185
- 22 - SSH
@@ -102,7 +106,7 @@ To edit the existing JIT rules for a VM:
102106

103107
1. Open the **Workload protections** and, in the advanced protections, select **Just-in-time VM access**.
104108

105-
1. In the **Configured** virtual machines, right-click on a VM and select edit.
109+
1. In the **Configured** virtual machines tab, right-click on a VM and select **Edit**.
106110

107111
1. In the **JIT VM access configuration**, you can either edit the list of port or select **Add** a new custom port.
108112

@@ -114,7 +118,7 @@ When a VM has a JIT enabled, you have to request access to connect to it. You ca
114118

115119
1. From the **Just-in-time VM access** page, select the **Configured** tab.
116120

117-
1. Select the VMs you want to access.
121+
1. Select the VMs you want to access:
118122

119123
- The icon in the **Connection Details** column indicates whether JIT is enabled on the network security group or firewall. If it's enabled on both, only the firewall icon appears.
120124

@@ -126,8 +130,8 @@ When a VM has a JIT enabled, you have to request access to connect to it. You ca
126130

127131
1. Select **Open ports**.
128132

129-
> [!NOTE]
130-
> If a user who is requesting access is behind a proxy, you can enter the IP address range of the proxy.
133+
> [!NOTE]
134+
> If a user who is requesting access is behind a proxy, you can enter the IP address range of the proxy.
131135
132136
## Other ways to work with JIT VM access
133137

@@ -163,7 +167,7 @@ You can enable JIT on a VM from the Azure virtual machines pages of the Azure po
163167

164168
1. From Defender for Cloud's menu, select **Just-in-time VM access**.
165169

166-
1. From the **Configured** tab, right-click on the VM to which you want to add a port, and select edit.
170+
1. From the **Configured** tab, right-click on the VM to which you want to add a port, and select **Edit**.
167171

168172
![Editing a JIT VM access configuration in Microsoft Defender for Cloud.](./media/just-in-time-access-usage/jit-policy-edit-security-center.png)
169173

0 commit comments

Comments
 (0)