如果授權要求待核准,要求者可以撤銷要求;如果授權已啟用,要求者可以在完成具權限的工作或不再需要存取權時,終止授權。
撤銷授權
控制台
前往「Privileged Access Manager」頁面。
選取要撤銷補助的機構、資料夾或專案。
依序點選「補助金」分頁標籤和「我的補助金」分頁標籤。 這份清單會列出你的授權,以及授權狀態和相關權利詳細資料。
在表格中,針對要撤銷的授權,按一下「更多選項」,然後按一下「撤銷」。
再次按一下「提款」確認。
gcloud
gcloud alpha pam grants withdraw
指令會撤銷授權。
使用下列任何指令資料之前,請先替換以下項目:
ENTITLEMENT_ID:授權所屬的權利 ID。GRANT_ID:要撤銷的授權 ID。 您可以透過 查看授權來擷取 ID。RESOURCE_TYPE:選用。權利所屬的資源類型。請使用organization、folder或project值。RESOURCE_ID:與RESOURCE_TYPE搭配使用。要管理權限的 Google Cloud專案、資料夾或機構的 ID。專案 ID 為英數字串,例如my-project。 資料夾和機構 ID 為數字,例如123456789012。
執行下列指令:
Linux、macOS 或 Cloud Shell
gcloud alpha pam grants withdraw \ GRANT_ID \ --entitlement=ENTITLEMENT_ID \ --location=global \ --RESOURCE_TYPE=RESOURCE_ID
Windows (PowerShell)
gcloud alpha pam grants withdraw ` GRANT_ID ` --entitlement=ENTITLEMENT_ID ` --location=global ` --RESOURCE_TYPE=RESOURCE_ID
Windows (cmd.exe)
gcloud alpha pam grants withdraw ^ GRANT_ID ^ --entitlement=ENTITLEMENT_ID ^ --location=global ^ --RESOURCE_TYPE=RESOURCE_ID
您應該會收到類似以下的回應:
Parsed [grant] resource: RESOURCE_TYPE/RESOURCE_ID/locations/global/entitlements/ENTITLEMENT_ID/grants/GRANT_ID Grant withdrawal initiated. The operation will complete in some time. To track its status, run: `gcloud alpha pam operations wait RESOURCE_TYPE/RESOURCE_ID/locations/global/operations/OPERATION_ID` Note that the wait command requires you to have the `privilegedaccessmanager.operations.get` permission on the resource. metadata: apiVersion: v1 createTime: '2024-08-20T10:10:10.101010101Z' target: RESOURCE_TYPE/RESOURCE_ID/locations/global/entitlements/ENTITLEMENT_ID/grants/GRANT_ID name: RESOURCE_TYPE/RESOURCE_ID/locations/global/operations/OPERATION_ID
REST
Privileged Access Manager API 的 withdrawGrant 方法會撤銷授權。
使用任何要求資料之前,請先替換以下項目:
SCOPE:授權所在的機構、資料夾或專案,格式為organizations/ORGANIZATION_ID、folders/FOLDER_ID或projects/PROJECT_ID。專案 ID 為英數字串,例如my-project。資料夾和機構 ID 都是數字,例如123456789012。ENTITLEMENT_ID:授權所屬的權利 ID。GRANT_ID:要撤銷的授權 ID。 您可以透過 查看授權來擷取 ID。
HTTP 方法和網址:
POST https://privilegedaccessmanager.googleapis.com/v1beta/SCOPE/locations/global/entitlements/ENTITLEMENT_ID/grants/GRANT_ID:withdraw
JSON 要求主體:
{
}
如要傳送要求,請展開以下其中一個選項:
您應該會收到如下的 JSON 回應:
{
"name": "SCOPE/locations/global/operations/OPERATION_ID",
"metadata": {
"@type": "type.googleapis.com/google.cloud.privilegedaccessmanager.v1beta.OperationMetadata",
"createTime": "2024-03-06T23:07:48.716396505Z",
"target": "SCOPE/locations/global/entitlements/ENTITLEMENT_ID/grants/GRANT_ID",
"verb": "update",
"requestedCancellation": false,
"apiVersion": "v1beta"
},
"done": false
}