doc-exports/docs/obs/perms-cfg/obs_40_0008.html
zhangyue 2c8baf104e OBS PERM DOC
Reviewed-by: Sabelnikov, Dmitriy <dmitriy.sabelnikov@t-systems.com>
Co-authored-by: zhangyue <zhangyue164@huawei.com>
Co-committed-by: zhangyue <zhangyue164@huawei.com>
2024-10-29 16:45:36 +00:00

50 lines
8.1 KiB
HTML

<a name="obs_40_0008"></a><a name="obs_40_0008"></a>
<h1 class="topictitle1">Accessing OBS Using Temporary Access Keys</h1>
<div id="body1597060383204"><div class="section" id="obs_40_0008__section9831018134415"><h4 class="sectiontitle">Temporary Access Keys</h4><p id="obs_40_0008__p13730171513276">You can assign temporary security credentials (including an AK, an SK, and a security token) to a third-party application or an IAM user, so that they can access OBS only for a specified period of time.</p>
<p id="obs_40_0008__p1046714345219">You can obtain temporary security credentials by calling an IAM API. For details, see <a href="https://docs.otc.t-systems.com/en-us/api/iam/en-us_topic_0097949518.html" target="_blank" rel="noopener noreferrer">Obtaining a Temporary AK/SK</a>.</p>
<p id="obs_40_0008__p15487641192319">The least privilege principle is granted for temporary security credentials to ensure security. Both a temporary AK/SK pair and a security token are required to call an API for authentication, which means that the request header needs to include <strong id="obs_40_0008__b24394441318">x-obs-security-token</strong> field.</p>
<p id="obs_40_0008__p886610168273">Temporary access keys have the following advantages over permanent access keys of IAM users:</p>
<ul id="obs_40_0008__ul48663167279"><li id="obs_40_0008__li118661716152719">Temporary access keys are valid for 15 minutes to 24 hours. Permanent access keys of IAM users are not exposed, reducing the risk of identity theft or fraud.</li><li id="obs_40_0008__li957912263442">When obtaining temporary access keys, you can send the policy parameter to request for the least temporary permissions that can be granted to IAM users.</li></ul>
<p id="obs_40_0008__p132948119510">For details, see <a href="https://docs.otc.t-systems.com/api_obs/obs/en-us_topic_0125560435.html" target="_blank" rel="noopener noreferrer">Authenticating a Request</a>.</p>
</div>
<div class="section" id="obs_40_0008__section114813400459"><h4 class="sectiontitle">Permissions of Temporary Access Keys</h4><p id="obs_40_0008__p88917031019">When an IAM user calls the IAM API for <a href="https://docs.otc.t-systems.com/en-us/api/iam/en-us_topic_0097949518.html" target="_blank" rel="noopener noreferrer">Obtaining a Temporary AK/SK</a>, the user can send the <strong id="obs_40_0008__b194816914418">policy</strong> parameter to add a temporary policy to further restrict the permissions that can be granted to other users. The format and content of a temporary policy should be consistent with those specified in <a href="obs_40_0003.html">IAM Permissions</a>.</p>
<ul id="obs_40_0008__ul9969419203210"><li id="obs_40_0008__li3649172273215">If the <strong id="obs_40_0008__b755383815918">policy</strong> parameter is not specified, the temporary access keys have the IAM user's permissions.</li><li id="obs_40_0008__li220117270328">If the <strong id="obs_40_0008__b176589621310">policy</strong> parameter is specified, the temporary access keys' permissions are the overlaps between the temporary policy's permissions and the IAM user's permissions.</li></ul>
<p id="obs_40_0008__p96091528153211">As shown in the following figure, circle 1 indicates an IAM user's permissions, and circle 2 indicates the temporary policy's permissions. The overlapping part 3 is the permissions of the temporary access keys.</p>
<div class="fignone" id="obs_40_0008__fig479016438362"><span class="figcap"><b>Figure 1 </b>Intersection of IAM user permissions and temporary policy permissions</span><br><span><img id="obs_40_0008__image1769334518330" src="en-us_image_0269157281.png"></span></div>
<p id="obs_40_0008__p15917195513116">Temporary access keys have the least privilege. You are advised to restrict a temporary policy's permissions within an IAM user's permissions. If a temporary policy's permissions are not all within the IAM user's permissions, the temporary access keys' permissions are definitely not the temporary policy's permissions. As illustrated by the following figure, the finally granted permissions are the temporary policy's permissions.</p>
<div class="fignone" id="obs_40_0008__fig78106108396"><span class="figcap"><b>Figure 2 </b>Restricting temporary permissions within IAM user permissions</span><br><span><img id="obs_40_0008__image79784541391" src="en-us_image_0269160697.png"></span></div>
<p id="obs_40_0008__p2062985411216">For a temporary policy's permissions, Deny always overrides Allow. Unspecified permissions are all Deny permissions by default.</p>
<div class="note" id="obs_40_0008__note1450962491713"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="obs_40_0008__p9509524111715">Therefore, you are advised to specify only Allow permissions.</p>
</div></div>
</div>
<div class="section" id="obs_40_0008__section1586812104015"><h4 class="sectiontitle">Application Scenarios</h4><p id="obs_40_0008__p582375113811">Temporary access keys are authorized to third parties to allow them to temporarily access OBS. For example, some companies have user management systems that manage app users and local users. These users do not have IAM user permissions, so IAM can grant temporary access keys to allow these users to temporarily access OBS.</p>
<p id="obs_40_0008__p2028733765210"><strong id="obs_40_0008__b171291233598">Typical application scenario:</strong></p>
<p id="obs_40_0008__p1722820165317">A company has a large number of apps that need to access OBS. Different apps require different access permissions. In this case, temporary access keys can be granted to app users to allow them to temporarily access OBS.</p>
<div class="fignone" id="obs_40_0008__fig1578555615594"><span class="figcap"><b>Figure 3 </b>Application scenarios of temporary access keys</span><br><span><img id="obs_40_0008__image8785185610591" src="en-us_image_0268971273.jpg"></span></div>
<ol id="obs_40_0008__ol13913571123"><li id="obs_40_0008__li187401810623">The customer server has permanent access keys, so it can request IAM to generate different temporary access keys for different apps.<p id="obs_40_0008__p1515944241010"><a name="obs_40_0008__li187401810623"></a><a name="li187401810623"></a>IAM users can call the IAM API for <a href="https://docs.otc.t-systems.com/en-us/api/iam/en-us_topic_0097949518.html" target="_blank" rel="noopener noreferrer">Obtaining a Temporary AK/SK</a>. IAM users can also send the <strong id="obs_40_0008__b17874234156">policy</strong> parameter to request for temporary policy's permissions. An example is provided as follows:</p>
<pre class="screen" id="obs_40_0008__screen895118193314">{
"auth": {
"identity": {
"methods": [
... ...
],
<strong id="obs_40_0008__b10174183511418"> "policy": {</strong>
<strong id="obs_40_0008__b49022111524"> ... ...</strong>
<strong id="obs_40_0008__b39038111622"> }</strong>
}
}
}</pre>
<p id="obs_40_0008__p196416033516">The policy's syntax and format are the same as those specified in <a href="obs_40_0003.html">IAM Permissions</a>.</p>
</li><li id="obs_40_0008__li02417287213">IAM generates temporary access keys with different permissions and validity periods based on the <strong id="obs_40_0008__b955865417114">policy</strong> parameter and returns the access keys to the customer server.</li><li id="obs_40_0008__li11742153019213">The customer server distributes the temporary access keys to apps.</li><li id="obs_40_0008__li173616331227">Apps can use the temporary access keys to access OBS through OBS SDKs or APIs. Temporary access keys are valid for the specified period of time. If the apps need to prolong the access to OBS, they should request to the customer server to update temporary access keys before they expire.</li></ol>
</div>
<div class="section" id="obs_40_0008__section68052393915"><h4 class="sectiontitle">Configuration Example</h4><p id="obs_40_0008__p14371168163915">For details, see <a href="obs_40_0037.html">Granting Temporary Access to OBS</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="obs_40_0006.html">Access Requests</a></div>
</div>
</div>