【Azure 環境】由為儲存賬號(Storage Account)拒絕分配許可權而引出的Azure 藍圖(Blueprint)使用問題

路邊兩盞燈發表於2021-06-15

問題描述

當開啟Azure儲存賬號(Storage Account)門戶頁面時,從 “訪問控制(標識和訪問管理)” 頁面中發現有“拒絕分配”的功能,所以就思考,是不是可以拒絕每一個使用者對儲存的讀取許可權呢?

【Azure 環境】由為儲存賬號(Storage Account)拒絕分配許可權而引出的Azure 藍圖(Blueprint)使用問題

問題分析及答案

在藍圖(Blueprint)的鎖定模式和狀態的介紹文件中,鎖定模式適用於藍圖分配,具有三個選項:“不鎖定”、“只讀”或“不刪除”。由藍圖分配中的專案建立的資源有四種狀態:“未鎖定”、“只讀”、“無法編輯/刪除”或“無法刪除”。當在建立對資源進行“拒絕分配”許可權的操作中,同樣也是隻能對其進行三種操作【“不鎖定”、“只讀”或“不刪除”】。

【Azure 環境】由為儲存賬號(Storage Account)拒絕分配許可權而引出的Azure 藍圖(Blueprint)使用問題

在問題的需求中,是拒絕分配對儲存的只讀許可權。然後,在藍圖的只讀鎖定中,它的定義是“The deny assignment is preventing all operations with the * and Action configuration, but it allows read access by excluding */read via NotActions.“,也就是說,通過Azure藍圖所控制的許可權,恰巧是除了只讀的許可權,其他的操作都可以被拒絕。

 

所以結論是,Azure 藍圖並不能滿足問題的需求 (拒絕一個使用者對儲存的讀取許可權)。迴歸到如何來解決問題許可權問題呢?當預設的AAD角色(如 Contributer(貢獻者))不能解決許可權問題,就需要使用自定義角色來完成 (注:自定義Azure AAD Role不在本文中包含,可參考官網:https://docs.azure.cn/zh-cn/role-based-access-control/custom-roles-powershell)。

 

在使用Blueprint(藍圖)入門時候遇見的兩個有關賬號(訂閱)許可權問題及解決辦法

問題一:在建立藍圖是,選擇”定義位置“時,沒有任何可選項列出。

這是因為定義位置是Azure管理組層次結構中的一個位置,所以要選擇它,需要當前使用的訂閱有”Azure 資源的訪問管理“的許可權。此點需要在AAD中屬性中開啟。

  • 沒有啟用Azure資源訪問管理時候的藍圖”定義位置“列表無法選擇

【Azure 環境】由為儲存賬號(Storage Account)拒絕分配許可權而引出的Azure 藍圖(Blueprint)使用問題

  • 如何在AAD中啟用”Azure 資源的訪問管理“
    • 登入到Azure門戶
    • 開啟AAD ( Azure Active Directory)
    • 選擇”屬性“目錄
    • 在”Azure 資源的訪問管理“設定中,選擇是。

【Azure 環境】由為儲存賬號(Storage Account)拒絕分配許可權而引出的Azure 藍圖(Blueprint)使用問題

 

When you set the toggle to Yes, you are assigned the User Access Administrator role in Azure RBAC at root scope (/). This grants you permission to assign roles in all Azure subscriptions and management groups associated with this Azure AD directory. This toggle is only available to users who are assigned the Global Administrator role in Azure AD.

When you set the toggle to No, the User Access Administrator role in Azure RBAC is removed from your user account. You can no longer assign roles in all Azure subscriptions and management groups that are associated with this Azure AD directory. You can view and manage only the Azure subscriptions and management groups to which you have been granted access. 

 

問題二:還是無法選擇藍圖“定義位置”和在分配藍圖時候,無法選擇組織中的其他訂閱號

已經有Azure資源的訪問管理許可權後,有可能還是遇見無法選擇“定義位置”,這個因為當前登入的訂閱還需要是改“管理組織”的Owner(所有者)。也只有是Owner後,分配藍圖才可以選擇你想分配的訂閱號。

 

為管理組設定Owner的步驟:

1)登入Azure 門戶,進入管理組頁面(管理組 - Microsoft Azure 由世紀互聯運營)(注意:不是資源組

2)選擇需要設定Owner的管理組,在“訪問控制(標識和訪問管理)”中新增“Owner所有者”角色

3)儲存,然後重新登陸“藍圖”頁面。 

 【Azure 環境】由為儲存賬號(Storage Account)拒絕分配許可權而引出的Azure 藍圖(Blueprint)使用問題

 

 

附錄一:什麼是Azure Blueprint?

Just as a blueprint allows an engineer or an architect to sketch a project's design parameters, Azure Blueprints enables cloud architects and central information technology groups to define a repeatable set of Azure resources that implements and adheres to an organization's standards, patterns, and requirements. Azure Blueprints makes it possible for development teams to rapidly build and stand up new environments with trust they're building within organizational compliance with a set of built-in components, such as networking, to speed up development and delivery.

Blueprints are a declarative way to orchestrate the deployment of various resource templates and other artifacts such as:

  • Role Assignments
  • Policy Assignments
  • Azure Resource Manager templates (ARM templates)
  • Resource Groups

正如工程師或建築師使用藍圖勾勒出專案的設計引數一樣,通過 Azure 藍圖,雲架構師和資料中心資訊科技組同樣可以定義一組可重複的 Azure 資源,這些資源實現並遵守組織的標準、模式和要求。 通過 Azure 藍圖,開發團隊可以快速生成和構建新環境,並確信這些生成的環境符合組織規定,還可以使用一組有助於加快開發和交付過程的內建元件(如網路)。

藍圖是一種宣告性方法,用於協調各個資源模板和其他專案的部署,例如:

  • 角色分配
  • 策略分配
  • Azure 資源管理器模板(ARM 模板)
  • 資源組

 

參考資料 

使用 Azure PowerShell 建立或更新 Azure 自定義角色https://docs.azure.cn/zh-cn/role-based-access-control/custom-roles-powershell

Elevate access for a Global Administratorhttps://docs.microsoft.com/en-us/azure/role-based-access-control/elevate-access-global-admin#elevate-access-for-a-global-administrator

Define and assign a blueprint in the portalhttps://docs.microsoft.com/en-us/azure/governance/blueprints/create-blueprint-portal

What is Azure Blueprintshttps://docs.microsoft.com/en-us/azure/governance/blueprints/overview

 

相關文章