Compliance With the Wasabi S3 API
    • 06 Jun 2024
    • 1 Minute to read
    • PDF

    Compliance With the Wasabi S3 API

    • PDF

    Article summary

    The compliance settings for any one object in a bucket with compliance can also be changed within the limits of the compliance on the bucket. Specify the object compliance settings with the following XML tags.

    Tag

    Description

    ConditionalHold

    A Boolean value “false” to release the object from the conditional hold setting in the bucket policy. The retention period in days is started from the point when the conditional hold is released. Once the conditional hold is set false, it may not be returned to conditional hold.

    LegalHold

    A Boolean value “true” or “false” to set the legal hold status. When an object has a legal hold status of true, the object cannot be deleted regardless of the retention period.

    RetentionTime

    An ISO time giving a new retention time for the object in which the object cannot be deleted before this time. Note that the new retention time must be past the retention period given by the bucket policy or an error is returned.

    The following is an example of setting the compliance on an object:

    PUT http://s3.wasabisys.com/my-bucket/my-object?complianceHTTP/1.1
    
    <ObjectComplianceConfiguration>
    
         <ConditionalHold>false</ConditionalHold>
    
         <RetentionTime>2018-03-13T10:45:00Z</RetentionTime>
    
    </ObjectComplianceConfiguration>

    The compliance settings for any specific object can also be retrieved using the “?compliance” query string. In addition to the object compliance settings above, the query returns the calculated SHA256 hash for the object, which can be used to determine that the object has not been modified. Note that the SHA256 value is only available for objects that are uploaded as a single object and is not available for multi-part or composed objects.

    The following is an example of getting the compliance on an object:

    GET http://s3.wasabisys.com/my-bucket/my-object?complianceHTTP/1.1

    Response body:

    <ObjectComplianceConfiguration xml ns="http://s3.amazonaws.com/doc/2006-03-01/">
    
         <RetentionTime>2016-10-31T15:08:05Z</RetentionTime>
    
         <ConditionalHold>false</ConditionalHold>
    
         <LegalHold>false</LegalHold>
    
         <SHA256>14b4be3894e92166b508007b6c2e4fb6e88d3d0ad652c76475089a50ebe6e33b</SHA256>
    
    </ObjectComplianceConfiguration>

    The object compliance settings also appear in the bucket listings when the bucket has compliance enabled.