forked from docs/doc-exports
Reviewed-by: Hajba, László Antal <laszlo-antal.hajba@t-systems.com> Co-authored-by: Qin Ying, Fan <fanqinying@huawei.com> Co-committed-by: Qin Ying, Fan <fanqinying@huawei.com>
73 lines
4.0 KiB
HTML
73 lines
4.0 KiB
HTML
<a name="dns_usermanual_0051"></a><a name="dns_usermanual_0051"></a>
|
|
|
|
<h1 class="topictitle1">Creating Custom Policies</h1>
|
|
<div id="body1575371441803"><p id="dns_usermanual_0051__p624113263018">You can create custom policies to supplement system-defined policies and implement more refined access control. </p>
|
|
<p id="dns_usermanual_0051__p1391019913815">You can create custom policies in either of the following two ways:</p>
|
|
<ul id="dns_usermanual_0051__ul1146431393818"><li id="dns_usermanual_0051__li5764181518386">Visual editor: Select cloud services, actions, resources, and request conditions without the need to know policy syntax.</li><li id="dns_usermanual_0051__li546410135389">JSON: Edit JSON policies from scratch or based on an existing policy.</li></ul>
|
|
<p id="dns_usermanual_0051__p1282918279201">The following describes how to create a custom policy that allows users to modify DNS zones in the visual editor and JSON view.</p>
|
|
<p id="dns_usermanual_0051__p4121195312484"> Some examples of common custom DNS policies are provided.</p>
|
|
<div class="section" id="dns_usermanual_0051__section51981826152017"><h4 class="sectiontitle">Example Custom Policies</h4><ul id="dns_usermanual_0051__ul783572752011"><li id="dns_usermanual_0051__li5323113501">Example 1: Authorize users to create zones, add record sets, and view the zones and record sets.<pre class="screen" id="dns_usermanual_0051__screen1464193292417">{
|
|
"Version": "1.1",
|
|
"Statement": [
|
|
{
|
|
"Effect": "Allow",
|
|
"Action": [
|
|
"dns:zone:create",
|
|
"dns:recordset:create",
|
|
"dns:zone:list"
|
|
"dns:recordset:list"
|
|
]
|
|
},
|
|
{
|
|
"Effect": "Allow",
|
|
"Action": [
|
|
"vpc:*:get*,
|
|
"vpc:*:list*"
|
|
]
|
|
}
|
|
]
|
|
}</pre>
|
|
</li><li id="dns_usermanual_0051__li1083502772018">Example 2: Disallow users to delete DNS resources.<p id="dns_usermanual_0051__p11835122732018"><a name="dns_usermanual_0051__li1083502772018"></a><a name="li1083502772018"></a>A deny policy must be used together with other policies. If the permissions assigned to a user contain both "Allow" and "Deny", the "Deny" permissions take precedence over the "Allow" permissions.</p>
|
|
<p id="dns_usermanual_0051__p16835182716203">The following method can be used if you need to assign permissions of the <strong id="dns_usermanual_0051__b6501131164514">DNS FullAccess</strong> policy to a user but also forbid the user from deleting DNS resources. Create a custom policy to disallow resource deletion and assign both policies to the group the user belongs to. Then the user can perform all operations on DNS except deleting resources. The following is an example deny policy:</p>
|
|
<pre class="screen" id="dns_usermanual_0051__screen0212155773014">{
|
|
"Version": "1.1",
|
|
"Statement": [
|
|
{
|
|
"Effect": "Deny",
|
|
"Action": [
|
|
"dns:*:delete*"
|
|
]
|
|
}
|
|
]
|
|
}</pre>
|
|
</li></ul>
|
|
<ul id="dns_usermanual_0051__ul1670121010522"><li id="dns_usermanual_0051__li17701151010525">Example 3: Defining permissions for multiple services in a policy<p id="dns_usermanual_0051__p67465472524"><a name="dns_usermanual_0051__li17701151010525"></a><a name="li17701151010525"></a>A custom policy can contain actions of multiple services that are all of the global or project-level type. The following is a policy with multiple actions:</p>
|
|
<pre class="screen" id="dns_usermanual_0051__screen4611172116914">{
|
|
"Version": "1.1",
|
|
"Statement": [
|
|
{
|
|
"Effect": "Allow",
|
|
"Action": [
|
|
"dns:zone:update",
|
|
"dns:zone:list"
|
|
]
|
|
},
|
|
{
|
|
"Effect": "Allow",
|
|
"Action": [
|
|
"vpc:subnets:create",
|
|
"vpc:vips:update"
|
|
]
|
|
}
|
|
]
|
|
}</pre>
|
|
</li></ul>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dns_usermanual_0025.html">Permissions Management</a></div>
|
|
</div>
|
|
</div>
|
|
|