This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Guides

Guides for Elastx The Vault

1 - Object locking

Protect objects from deletion and changes

Object locking requires a bucket created with --with-lock. See Buckets.

Modes

Mode Locked versions can be deleted before expiry
governance Only by users with the admin role, with an explicit bypass
compliance Never, by any user, including admins

Warning: A compliance lock cannot be removed or shortened by any user. Test with governance and short durations.

Default retention for a bucket

New objects are locked automatically:

mc retention set --default governance 30d thevault/<prefix>.<bucket-name>
mc retention info --default thevault/<prefix>.<bucket-name>

Lock a single object

mc retention set governance 30d thevault/<prefix>.<bucket-name>/<object>
mc retention info thevault/<prefix>.<bucket-name>/<object>

Locks an object until the hold is removed, regardless of retention. It also blocks deletion with bypass; clear the hold first.

mc legalhold set thevault/<prefix>.<bucket-name>/<object>
mc legalhold clear thevault/<prefix>.<bucket-name>/<object>

Delete a locked version (governance)

Requires the admin role. Find the version ID:

mc ls --versions thevault/<prefix>.<bucket-name>/<object>

Delete it with bypass:

mc rm --version-id <version-id> --bypass thevault/<prefix>.<bucket-name>/<object>

AWS CLI:

aws --profile thevault s3api delete-object \
  --bucket <prefix>.<bucket-name> --key <object> --version-id <version-id> \
  --bypass-governance-retention

Other clients: send the header x-amz-bypass-governance-retention: true.

Note: mc rm without --version-id or --versions does not delete locked data. It only adds a delete marker that hides the object.