【Azure 环境】由为存储账号(Storage Account)拒绝分配权限而引出的Azure 蓝图(Blueprint)使用问题

问题描述

当打开Azure存储账号(Storage Account)门户页面时,从 “访问控制(标识和访问管理)” 页面中发现有“拒绝分配”的功能,所以就思考,是不是可以拒绝每一个用户对存储的读取权限呢?

问题分析及答案

在蓝图(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资源访问管理时候的蓝图”定义位置“列表无法选择

  • 如何在AAD中启用”Azure 资源的访问管理“
    • 登录到Azure门户
    • 打开AAD ( Azure Active Directory)
    • 选择”属性“目录
    • 在”Azure 资源的访问管理“设置中,选择是。

 

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 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

 

posted @ 2021-06-15 17:08  路边两盏灯  阅读(272)  评论(0编辑  收藏  举报