Preventing an IAM User from Logging In to DataArts Studio by Setting Specific Conditions
This section describes how to prevent an IAM user from logging in to DataArts Studio by setting specific conditions. This section uses the time condition as an example, which prevents an IAM user from logging in to DataArts Studio after a specified time.
Prerequisites
You have created an IAM user. For details, see Creating an IAM User.
Creating a Custom Policy
The system default permissions cannot be modified. To set specific conditions, you need to create a custom authorization policy.
- Log in to the console as the administrator.
Figure 1 Logging in to the console
- Hover the mouse over the username in the upper right corner and select Identity and Access Management.
Figure 2 Identity and Access Management
- In the navigation pane, choose Permissions > Policies/Roles.
Figure 3 Policies/Roles
- Click Create Custom Policy in the upper right corner. For details about how to configure custom permissions, see Policy Syntax.
- On the Create Custom Policy page, enter CurrentTime for Policy Name and select Visual editor for Policy View.
Figure 4 Create Custom Policy
- Configure the policy content.
- Allow/Deny: Select Deny.
Figure 5 Allow/Deny
- Select service: Enter a keyword to search for and select it.
Figure 6 Select service
- Select action: Select all actions.
Figure 7 Select action
- (Optional) Select resource: By default, all resources are selected.
Figure 8 Select resource
- (Optional) Add request condition: Click Add Request Condition. In the displayed dialog box, select g:CurrentTime for Condition Key, DateGreaterThan for Qualifier, and set the time.
Figure 9 Add Request Condition
- Click OK.
Figure 10 Clicking OK
- Select JSON for Policy View to view the code for the custom policy.
{ "Version": "1.1", "Statement": [ { "Effect": "Deny", "Action": [ "DGC:*:*" ], "Condition": { "DateGreaterThan": { "g:CurrentTime": [ "2023-01-01T00:00:00Z" ] } } } ] }
- Allow/Deny: Select Deny.
Granting the Custom Policy to an IAM User
The custom policy cannot be directly granted to an IAM user. You must grant the policy to a user group and then add the IAM user to the user group.
- On the IAM console, choose User Groups in the navigation pane. Then click Create User Group in the upper right corner.
Figure 11 Create User Group
- Enter the user group name and click OK.
Figure 12 Entering the user group name
- On the User Groups page, locate the create user group and click Authorize in the Operation column.
Figure 13 Authorize
- Select the created custom policy and click Next.
Figure 14 Selecting the custom policy
- Set the authorization scope. By default, All resources are selected. Then click OK.
Figure 15 Setting the authorization scope
- You can select Do not show again so that the following dialog box will not be displayed when you grant permissions to the user group in the future.
Figure 16 Effective time notification
- Click Finish to go back to the User Groups page.
Figure 17 Successful authorization
- Click the name of the created user group.
Figure 18 User group
- Click the Users tab and then Add.
Figure 19 Adding a user
- Select an IAM user and click OK.
Figure 20 Selecting an IAM user
- The IAM user is added successfully, and the custom policy has been granted to the IAM user.
Figure 21 IAM user added
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.