forked from docs/doc-exports
Reviewed-by: Sabelnikov, Dmitriy <dmitriy.sabelnikov@t-systems.com> Co-authored-by: zhangyue <zhangyue164@huawei.com> Co-committed-by: zhangyue <zhangyue164@huawei.com>
186 lines
15 KiB
HTML
186 lines
15 KiB
HTML
<a name="EN-US_TOPIC_0000001080838596"></a><a name="EN-US_TOPIC_0000001080838596"></a>
|
|
|
|
<h1 class="topictitle1">PUT Bucket Encryption</h1>
|
|
<div id="body0000001080838596"><p id="EN-US_TOPIC_0000001080838596__p199653120135">OBS uses the PUT method to create or update the default server-side encryption for a bucket.</p>
|
|
<p id="EN-US_TOPIC_0000001080838596__p15667131417392">After encryption is enabled for a bucket, objects uploaded to the bucket are encrypted with the encryption configuration the bucket. Currently, it only supports the server-side encryption using keys hosted by KMS (SSE-KMS). For details about SSE-KMS, see <a href="en-us_topic_0125560445.html">SSE-KMS</a>.</p>
|
|
<p id="EN-US_TOPIC_0000001080838596__p55541638152311">To perform this operation, you must have the <strong id="EN-US_TOPIC_0000001080838596__b385714265271">s3:PutEncryptionConfiguration</strong> permission. By default, the bucket owner has this permission and can assign this permission to other users.</p>
|
|
<div class="section" id="EN-US_TOPIC_0000001080838596__section57518732"><h4 class="sectiontitle">Request Syntax</h4><div class="codecoloring" codetype="Xml" id="EN-US_TOPIC_0000001080838596__screen656246211548"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
|
|
<span class="normal"> 2</span>
|
|
<span class="normal"> 3</span>
|
|
<span class="normal"> 4</span>
|
|
<span class="normal"> 5</span>
|
|
<span class="normal"> 6</span>
|
|
<span class="normal"> 7</span>
|
|
<span class="normal"> 8</span>
|
|
<span class="normal"> 9</span>
|
|
<span class="normal">10</span>
|
|
<span class="normal">11</span>
|
|
<span class="normal">12</span>
|
|
<span class="normal">13</span>
|
|
<span class="normal">14</span>
|
|
<span class="normal">15</span>
|
|
<span class="normal">16</span></pre></div></td><td class="code"><div><pre><span></span>PUT<span class="w"> </span>/?encryption<span class="w"> </span>HTTP/1.1
|
|
User-Agent:<span class="w"> </span>curl/7.29.0
|
|
Host:<span class="w"> </span>bucketname.obs.region.example.com
|
|
Accept:<span class="w"> </span>*/*
|
|
Date:<span class="w"> </span>date<span class="w"> </span>
|
|
Authorization:<span class="w"> </span>authorization<span class="w"> </span>string
|
|
Content-Length:<span class="w"> </span>length
|
|
|
|
<span class="nt"><ServerSideEncryptionConfiguration></span>
|
|
<span class="w"> </span><span class="nt"><Rule></span>
|
|
<span class="w"> </span><span class="nt"><ApplyServerSideEncryptionByDefault></span>
|
|
<span class="w"> </span><span class="nt"><SSEAlgorithm></span>aws:kms<span class="nt"></SSEAlgorithm></span>
|
|
<span class="w"> </span><span class="nt"><KMSMasterKeyID></span>kmskeyid-value<span class="nt"></KMSMasterKeyID></span>
|
|
<span class="w"> </span><span class="nt"></ApplyServerSideEncryptionByDefault></span>
|
|
<span class="w"> </span><span class="nt"></Rule></span>
|
|
<span class="nt"></ServerSideEncryptionConfiguration></span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001080838596__section47906541"><h4 class="sectiontitle">Request Parameters</h4><p class="msonormal" id="EN-US_TOPIC_0000001080838596__p66660433">This request contains no parameter.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001080838596__section28505693"><h4 class="sectiontitle">Request Headers</h4><p class="msonormal" id="EN-US_TOPIC_0000001080838596__p30785969">This request uses common headers. For details about common request headers, see the section <a href="en-us_topic_0125560462.html">Common Request Headers</a>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001080838596__section55224652"><h4 class="sectiontitle">Request Elements</h4><p id="EN-US_TOPIC_0000001080838596__p13726103911272">In this request, you need to carry the bucket encryption configuration in the request body. The bucket encryption configuration information is uploaded in the XML format. <a href="#EN-US_TOPIC_0000001080838596__table1181123018399">Table 1</a> lists the configuration elements.</p>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0000001080838596__table1181123018399"></a><a name="table1181123018399"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001080838596__table1181123018399" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Configuration elements of bucket encryption</caption><thead align="left"><tr id="EN-US_TOPIC_0000001080838596__row2018917307393"><th align="left" class="cellrowborder" valign="top" width="32.95%" id="mcps1.3.7.3.2.4.1.1"><p id="EN-US_TOPIC_0000001080838596__p19190143043913">Header</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="56.57%" id="mcps1.3.7.3.2.4.1.2"><p id="EN-US_TOPIC_0000001080838596__p019273012397">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="10.48%" id="mcps1.3.7.3.2.4.1.3"><p id="EN-US_TOPIC_0000001080838596__p2195113033915">Mandatory</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001080838596__row7197230193913"><td class="cellrowborder" valign="top" width="32.95%" headers="mcps1.3.7.3.2.4.1.1 "><p id="EN-US_TOPIC_0000001080838596__p125361017184212">ServerSideEncryptionConfiguration</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="56.57%" headers="mcps1.3.7.3.2.4.1.2 "><p id="EN-US_TOPIC_0000001080838596__p6536111718422">Root element of the default encryption configuration of a bucket.</p>
|
|
<p id="EN-US_TOPIC_0000001080838596__p85368172423">Type: element</p>
|
|
<p id="EN-US_TOPIC_0000001080838596__p125365178429">Ancestor: none</p>
|
|
<p id="EN-US_TOPIC_0000001080838596__p1555484273118">Children: Rule</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.3.7.3.2.4.1.3 "><p id="EN-US_TOPIC_0000001080838596__p553681720423">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001080838596__row12641636422"><td class="cellrowborder" valign="top" width="32.95%" headers="mcps1.3.7.3.2.4.1.1 "><p id="EN-US_TOPIC_0000001080838596__p3911152616425">Rule</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="56.57%" headers="mcps1.3.7.3.2.4.1.2 "><p id="EN-US_TOPIC_0000001080838596__p591252604217">Sub-element of the default encryption configuration of a bucket.</p>
|
|
<p id="EN-US_TOPIC_0000001080838596__p391202634216">Type: element</p>
|
|
<p id="EN-US_TOPIC_0000001080838596__p4912142604210">Root element: ServerSideEncryptionConfiguration</p>
|
|
<p id="EN-US_TOPIC_0000001080838596__p83382043312">Sub-element: ApplyServerSideEncryptionByDefault</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.3.7.3.2.4.1.3 "><p id="EN-US_TOPIC_0000001080838596__p3912326144211">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001080838596__row944320444211"><td class="cellrowborder" valign="top" width="32.95%" headers="mcps1.3.7.3.2.4.1.1 "><p id="EN-US_TOPIC_0000001080838596__p163325395428">ApplyServerSideEncryptionByDefault</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="56.57%" headers="mcps1.3.7.3.2.4.1.2 "><p id="EN-US_TOPIC_0000001080838596__p8333639114218">Sub-element of the default encryption configuration of a bucket.</p>
|
|
<p id="EN-US_TOPIC_0000001080838596__p1233323919429">Type: element</p>
|
|
<p id="EN-US_TOPIC_0000001080838596__p0333163974214">Ancestor: Rule</p>
|
|
<p id="EN-US_TOPIC_0000001080838596__p2559123813510">Children: SSEAlgorithm, KMSMasterKeyID</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.3.7.3.2.4.1.3 "><p id="EN-US_TOPIC_0000001080838596__p333319390424">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001080838596__row1314615104218"><td class="cellrowborder" valign="top" width="32.95%" headers="mcps1.3.7.3.2.4.1.1 "><p id="EN-US_TOPIC_0000001080838596__p11495174818425">SSEAlgorithm</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="56.57%" headers="mcps1.3.7.3.2.4.1.2 "><p id="EN-US_TOPIC_0000001080838596__p74952488427">Server-side encryption algorithm used for the default encryption configuration of a bucket.</p>
|
|
<p id="EN-US_TOPIC_0000001080838596__p1349514814423">Type: string</p>
|
|
<p id="EN-US_TOPIC_0000001080838596__p149512481428">Valid values: <strong id="EN-US_TOPIC_0000001080838596__b1580671512436">aws:kms</strong></p>
|
|
<p id="EN-US_TOPIC_0000001080838596__p1089135793715">Root element: ApplyServerSideEncryptionByDefault</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.3.7.3.2.4.1.3 "><p id="EN-US_TOPIC_0000001080838596__p18495154864216">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001080838596__row13866105154213"><td class="cellrowborder" valign="top" width="32.95%" headers="mcps1.3.7.3.2.4.1.1 "><p id="EN-US_TOPIC_0000001080838596__p196161654134219"><span style="color:#444444;">KMSMasterKeyID</span></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="56.57%" headers="mcps1.3.7.3.2.4.1.2 "><p id="EN-US_TOPIC_0000001080838596__p19616854174215">Customer master key (CMK) used in SSE-KMS encryption mode. If you do not specify this header, the default master key will be used.</p>
|
|
<p id="EN-US_TOPIC_0000001080838596__p7616135414424">Type: string</p>
|
|
<p id="EN-US_TOPIC_0000001080838596__p6679135313114">Valid value formats are as follows:</p>
|
|
<ol id="EN-US_TOPIC_0000001080838596__ol28871657184419"><li id="EN-US_TOPIC_0000001080838596__li388775774418"><em id="EN-US_TOPIC_0000001080838596__i1860613405">regionID:domainID (account ID)</em>:key/<em id="EN-US_TOPIC_0000001080838596__i143414910018">key_id</em></li><li id="EN-US_TOPIC_0000001080838596__li1216183134518">key_id</li></ol>
|
|
<p id="EN-US_TOPIC_0000001080838596__p558627121315"><strong id="EN-US_TOPIC_0000001080838596__b82501231174610">regionID</strong> is the ID of the region to which the key belongs. <strong id="EN-US_TOPIC_0000001080838596__b225117317461">domainID</strong> is the account ID of the tenant to which the key belongs. <strong id="EN-US_TOPIC_0000001080838596__b72521131104617">key_id</strong> is the key ID created with the Key Management Service(KMS).</p>
|
|
<p id="EN-US_TOPIC_0000001080838596__p2616105415423">Root element: ApplyServerSideEncryptionByDefault</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.3.7.3.2.4.1.3 "><p id="EN-US_TOPIC_0000001080838596__p11616115484210">No</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001080838596__section46270551"><h4 class="sectiontitle">Response Syntax</h4><div class="codecoloring" codetype="Xml" id="EN-US_TOPIC_0000001080838596__screen34072248"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span>HTTP/1.1<span class="w"> </span>status_code
|
|
Date:<span class="w"> </span>date
|
|
Content-Length:<span class="w"> </span>length
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001080838596__section13781782"><h4 class="sectiontitle">Response Headers</h4><p class="msonormal" id="EN-US_TOPIC_0000001080838596__p4179377">This response uses common headers. For details about common response headers, see the section <a href="en-us_topic_0125560484.html">Common Response Headers</a>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001080838596__section56927182"><h4 class="sectiontitle">Response Elements</h4><p id="EN-US_TOPIC_0000001080838596__p2025715391222">This response involves no elements.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001080838596__section42582590"><h4 class="sectiontitle">Error Responses</h4><p id="EN-US_TOPIC_0000001080838596__p2085119481221">No special error responses are returned. For details about error responses, see <a href="en-us_topic_0125560440.html#EN-US_TOPIC_0125560440__table30733758">Table 1</a>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001080838596__section32323009"><h4 class="sectiontitle">Sample Request</h4><div class="codecoloring" codetype="Xml" id="EN-US_TOPIC_0000001080838596__screen8484163863919"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
|
|
<span class="normal"> 2</span>
|
|
<span class="normal"> 3</span>
|
|
<span class="normal"> 4</span>
|
|
<span class="normal"> 5</span>
|
|
<span class="normal"> 6</span>
|
|
<span class="normal"> 7</span>
|
|
<span class="normal"> 8</span>
|
|
<span class="normal"> 9</span>
|
|
<span class="normal">10</span>
|
|
<span class="normal">11</span>
|
|
<span class="normal">12</span>
|
|
<span class="normal">13</span>
|
|
<span class="normal">14</span>
|
|
<span class="normal">15</span>
|
|
<span class="normal">16</span>
|
|
<span class="normal">17</span></pre></div></td><td class="code"><div><pre><span></span>PUT<span class="w"> </span>/?encryption<span class="w"> </span>HTTP/1.1
|
|
User-Agent:<span class="w"> </span>curl/7.29.0
|
|
Host:<span class="w"> </span>examplebucket.obs.region.example.com
|
|
Accept:<span class="w"> </span>*/*
|
|
Date:<span class="w"> </span>Thu,<span class="w"> </span>21<span class="w"> </span>Feb<span class="w"> </span>2019<span class="w"> </span>03:05:34<span class="w"> </span>GMT
|
|
Authorization:<span class="w"> </span>authorization
|
|
Content-Length:<span class="w"> </span>778
|
|
|
|
<span class="cp"><?xml version="1.0" encoding="UTF-8" standalone="yes"?></span><span class="w"> </span>
|
|
<span class="nt"><ServerSideEncryptionConfiguration</span><span class="w"> </span><span class="na">xmlns=</span><span class="s">"http://obs.region.example.com/doc/2015-06-30/"</span><span class="nt">></span>
|
|
<span class="w"> </span><span class="nt"><Rule></span>
|
|
<span class="w"> </span><span class="nt"><ApplyServerSideEncryptionByDefault></span>
|
|
<span class="w"> </span><span class="nt"><SSEAlgorithm></span>aws:kms<span class="nt"></SSEAlgorithm></span>
|
|
<span class="w"> </span><span class="nt"><KMSMasterKeyID></span>4f1cd4de-ab64-4807-920a-47fc42e7f0d0<span class="nt"></KMSMasterKeyID></span>
|
|
<span class="w"> </span><span class="nt"></ApplyServerSideEncryptionByDefault></span>
|
|
<span class="w"> </span><span class="nt"></Rule></span>
|
|
<span class="nt"></ServerSideEncryptionConfiguration></span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001080838596__section22471632"><h4 class="sectiontitle">Sample Response</h4><div class="codecoloring" codetype="Xml" id="EN-US_TOPIC_0000001080838596__screen8485113814"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span>
|
|
<span class="normal">6</span></pre></div></td><td class="code"><div><pre><span></span>HTTP/1.1<span class="w"> </span>200<span class="w"> </span>OK
|
|
Server:<span class="w"> </span>OBS
|
|
x-amz-request-id:<span class="w"> </span>BF26000001643670AC06E7B9A7767921
|
|
x-amz-id-2:<span class="w"> </span>32AAAQAAEAABSAAgAAEAABAAAQAAEAABCSvK6z8HV6nrJh49gsB5vqzpgtohkiFm
|
|
Date:<span class="w"> </span>Thu,<span class="w"> </span>21<span class="w"> </span>Feb<span class="w"> </span>2019<span class="w"> </span>03:05:34<span class="w"> </span>GMT
|
|
Content-Length:<span class="w"> </span>0
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0125560493.html">Operations on Buckets</a></div>
|
|
</div>
|
|
</div>
|
|
|