forked from docs/doc-exports
Reviewed-by: Sarda, Priya <prsarda@noreply.gitea.eco.tsi-dev.otc-service.com> Co-authored-by: Qin Ying, Fan <fanqinying@huawei.com> Co-committed-by: Qin Ying, Fan <fanqinying@huawei.com>
62 lines
4.5 KiB
HTML
62 lines
4.5 KiB
HTML
<a name="nat_permission_0003"></a><a name="nat_permission_0003"></a>
|
|
|
|
<h1 class="topictitle1">NAT Gateway Custom Policies</h1>
|
|
<div id="body8662426"><p id="nat_permission_0003__p16767103712216">Custom policies can be created to supplement the system-defined policies of NAT Gateway. For the actions that can be added to custom policies, see section "Permissions Policies and Supported Actions" in the <em id="nat_permission_0003__i388321114920">NAT Gateway API Reference</em>.</p>
|
|
<p id="nat_permission_0003__p05559511579">You can create custom policies in either of the following ways:</p>
|
|
<ul id="nat_permission_0003__ul7608134252211"><li id="nat_permission_0003__li131893469221">Visual editor: Select cloud services, actions, resources, and request conditions. This does not require knowledge of policy syntax.</li><li id="nat_permission_0003__li186081242142216">JSON: Edit JSON policies from scratch or based on an existing policy.<p id="nat_permission_0003__p16675111816315"><a name="nat_permission_0003__li186081242142216"></a><a name="li186081242142216"></a>For details, see <a href="https://docs.otc.t-systems.com/identity-access-management/umn/user_guide/fine-grained_policy_management/creating_a_custom_policy.html" target="_blank" rel="noopener noreferrer">Creating a Custom Policy</a> The following section contains examples of common NAT Gateway custom policies.</p>
|
|
</li></ul>
|
|
<div class="section" id="nat_permission_0003__en-us_topic_0171158981_section14211748585"><h4 class="sectiontitle">Example Policies</h4><ul id="nat_permission_0003__en-us_topic_0171158981_ul3541174820819"><li id="nat_permission_0003__en-us_topic_0171158981_li954174811818">Example 1: Allowing users to create and delete NAT gateways<pre class="screen" id="nat_permission_0003__en-us_topic_0171158981_screen1984581351618">{
|
|
"Version": "1.1",
|
|
"Statement": [
|
|
{
|
|
"Effect": "Allow",
|
|
"Action": [
|
|
"nat:natGateways:create",
|
|
"nat:natGateways:delete"
|
|
]
|
|
}
|
|
]
|
|
}</pre>
|
|
</li><li id="nat_permission_0003__en-us_topic_0171158981_li054154812819">Example 2: Denying NAT gateway deletion<p id="nat_permission_0003__en-us_topic_0171158981_p9541164816811"><a name="nat_permission_0003__en-us_topic_0171158981_li054154812819"></a><a name="en-us_topic_0171158981_li054154812819"></a>A deny policy must be used in conjunction with other policies to take effect. If the permissions assigned to a user contain both "Allow" and "Deny", the "Deny" permissions take precedence over the "Allow" permissions.</p>
|
|
<p id="nat_permission_0003__en-us_topic_0171158981_p54631559214">The following method can be used if you need to assign permissions of the NAT Gateway <strong id="nat_permission_0003__b6938115411491">FullAccess</strong> policy to a user but also forbid the user from deleting NAT gateways. Create a custom policy for denying NAT gateway deletion, and attach both policies to the group to which the user belongs. Then the user can perform all operations on NAT gateways except deleting NAT gateways. The following is an example of a deny policy:</p>
|
|
<pre class="screen" id="nat_permission_0003__en-us_topic_0171158981_screen15930122720235">{
|
|
"Version": "1.1",
|
|
"Statement": [
|
|
{
|
|
"Action": [
|
|
"nat:natGateways:delete"
|
|
],
|
|
"Effect": "Deny"
|
|
}
|
|
]
|
|
}</pre>
|
|
</li><li id="nat_permission_0003__li53625446377">Example 3: Defining permissions for multiple services in a policy<p id="nat_permission_0003__p2610194519379"><a name="nat_permission_0003__li53625446377"></a><a name="li53625446377"></a>A custom policy can contain actions of multiple services that are of the global or project-level type. The following is an example policy containing actions of multiple services:</p>
|
|
<pre class="screen" id="nat_permission_0003__screen198174024711">{
|
|
"Version": "1.1",
|
|
"Statement": [
|
|
{
|
|
"Action": [
|
|
"nat:natGateways:update",
|
|
"nat:natGateways:create"
|
|
],
|
|
"Effect": "Allow"
|
|
},
|
|
{
|
|
"Action": [
|
|
"vpc:vpcs:update"
|
|
],
|
|
"Effect": "Allow"
|
|
}
|
|
]
|
|
}</pre>
|
|
<p id="nat_permission_0003__p869325211462"></p>
|
|
</li></ul>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="nat_permission_0001.html">Permissions Management</a></div>
|
|
</div>
|
|
</div>
|
|
|