如果系統權限原則不能滿足您的要求,您可以建立自訂權限原則實現最小授權。使用自訂權限原則有助於實現許可權的精細化管控,是提升資源訪問安全的有效手段。本文介紹Web Application Firewall使用自訂權限原則的情境和策略樣本。
什麼是自訂權限原則
在基於RAM的存取控制體系中,自訂權限原則是指在系統權限原則之外,您可以自主建立、更新和刪除的權限原則。自訂權限原則的版本更新需由您來維護。
建立自訂權限原則後,需為RAM使用者、使用者組或RAM角色綁定權限原則,這些RAM身份才能獲得權限原則中指定的存取權限。
已建立的權限原則支援刪除,但刪除前需確保該策略未被引用。如果該權限原則已被引用,您需要在該權限原則的引用記錄中移除授權。
自訂權限原則支援版本控制,您可以按照RAM規定的版本管理機制來管理您建立的自訂權限原則版本。
操作文檔
授權資訊參考
使用自訂權限原則,您需要瞭解業務的許可權管控需求,並瞭解Web Application Firewall的授權資訊。更多資訊,請參見授權資訊。
自訂權限原則樣本
為了向您提供對雲上網路流量的存取控制、監控分析等功能,Web防火牆需要訪問您的Elastic Compute Service、負載平衡、Log Service、CloudMonitor等雲端服務資源,您可通過系統自動建立的Web Application Firewall服務關聯角色AliyunServiceRoleForWaf進行訪問授權。服務關聯角色無需您手動建立或做任何修改。相關內容,請參見服務關聯角色。
說明
AliyunServiceRoleForWaf預設擁有AliyunServiceRolePolicyForWaf系統權限原則的授權。
授予NLB接入許可權
{
"Action": [
"nlb:ListLoadBalancers",
"nlb:ListListeners",
"nlb:GetLoadBalancerAttribute",
"nlb:ListListenerCertificates",
"nlb:ListSecurityPolicy",
"nlb:ListSystemSecurityPolicy"
],
"Resource": "*",
"Effect": "Allow"
}授予ALB接入許可權
{
"Action": [
"alb:ListLoadBalancers",
"alb:GetLoadBalancerAttribute",
"alb:ListListeners",
"alb:GetListenerAttribute",
"alb:ListListenerCertificates",
"alb:DescribeRegions",
"alb:ListSystemSecurityPolicies",
"alb:ListSecurityPolicies"
],
"Resource": "*",
"Effect": "Allow"
},授予CLB接入許可權
{
"Action": [
"slb:DescribeServerCertificates",
"slb:DescribeDomainExtensions",
"slb:DescribeLoadBalancers",
"slb:DescribeListenerAccessControlAttribute",
"slb:DescribeLoadBalancerAttribute",
"slb:DescribeLoadBalancerHTTPListenerAttribute",
"slb:DescribeLoadBalancerHTTPSListenerAttribute",
"slb:DescribeLoadBalancerTCPListenerAttribute",
"slb:DescribeLoadBalancerUDPListenerAttribute",
"slb:DescribeTLSCipherPolicies",
"slb:ListTLSCipherPolicies",
"slb:DescribeLoadBalancers"
],
"Resource": "*",
"Effect": "Allow"
}授予ECS接入許可權
{
"Action": [
"ecs:DescribeInstances",
"ecs:DescribeNetworkInterfaces",
"ecs:CreateNetworkInterface",
"ecs:DeleteNetworkInterface",
"ecs:AttachNetworkInterface",
"ecs:DetachNetworkInterface",
"ecs:DescribeNetworkInterfacePermissions",
"ecs:CreateNetworkInterfacePermission",
"ecs:DeleteNetworkInterfacePermission",
"ecs:DescribeSecurityGroups",
"ecs:DescribeSecurityGroupAttribute",
"ecs:CreateSecurityGroup",
"ecs:DeleteSecurityGroup",
"ecs:AuthorizeSecurityGroup",
"ecs:RevokeSecurityGroup",
"ecs:DescribeDisks"
],
"Resource": "*",
"Effect": "Allow"
}