Azure RBAC
Last updated
Last updated
Access management for cloud resources is a critical function for any organization that is using the cloud. Azure role-based access control (Azure RBAC) helps you manage who has access to Azure resources, what they can do with those resources, and what areas they have access to
Azure RBAC is an authorization system built on that provides fine-grained access management to Azure resources.
Cái này giống như là đại diện cho một user, group, service principal, or managed identity để request đến các resource của azure.
Trong azure có nhiều role để tập hợp các permission của Security Principal. Về danh sách các permission là các hành động mà user đó được phép thao tác.
Ví dụ: Product.Create có nghĩa là đây là permission cho phép user thực hiện. Nếu mà role nào có permission này thì sẽ được quyền tạo product, ngược lại thì không có quyền.
Trong azure có 2 dạng role là builtin và custom role.
Built-in role là role mà azure đã định nghĩa sẵn trong hệ thống của azure, bạn chỉ cần sử dụng của azure. Về built-in role thì có các role phổ biến như: Owner, Contributor, Reader, .. có thể xem thêm tại
Custome role là role mà azure cho phép người dùng tự định nghĩa, và tự sử dụng. Xem thêm tại
Nói đơn giản là tài nguyên để mà user có thể thao tác như view, edit, create, delete bất kỳ resource nào đó. Trong azure thì có sự phân cấp từ trên xuống dưới với 4 level.
Khi scope cao nhất được assign thì scope thấp nhất cũng sẽ được assign theo.
Role assignment là phần chỉ định rằng user sẽ được gán role, và dựa vào role đó sẽ dựa trên permission để xác định user đó có những quyền thao tác nào trên scope của azure.
Trong azure thì cho rằng có thể assign được ở group thay vì từng user, và các user trong group đó cũng sẽ có quyền tương tự như nhau bởi đã được assign theo group.
Trong azure docs thì họ diễn giả khá nhiều bước, và có thể làm hoang mang nên tôi sẽ giải thích theo cách hiểu của tôi cho cho mọi người dễ hình dung nhất.
Các bước kiểm tra sẽ như sau:
User request đến server bằng và kèm theo token, nếu không có token thì sẽ không có access.
User phải call RestAPI đến Azure Resource Manager với token.
Azure Resource Manager sẽ load Role assignment và deny assignment, nếu user nằm trong deny assignment thì sẽ bị block.
Azure xác định vai trò của user và resource cần access.
Azure Resource Manager determines if the action in the API call is included in the roles the user has for this resource.
If the roles include Actions
that have a wildcard (*
), the effective permissions are computed by subtracting the NotActions
from the allowed Actions
. Similarly, the same subtraction is done for any data actions.
Actions - NotActions = Effective management permissions
DataActions - NotDataActions = Effective data permissions
If the user doesn't have a role with the action at the requested scope, access isn't allowed. Otherwise, any conditions are evaluated.
If the role assignment includes conditions, they're evaluated. Otherwise access is allowed.
If conditions are met, access is allowed. Otherwise access isn't allowed.
The following diagram is a summary of the evaluation logic.
In Azure, you can specify a scope at four levels: , subscription, , or resource. Scopes are structured in a parent-child relationship. You can assign roles at any of these levels of scope.