Locking an Export
Lock a File Storage export to prevent updates, moves, and deletions. Locks help protect resources against tampering.
A lock on an export doesn't prevent authorized users from mounting and accessing a file system, or changing the contents of the mounted file system.
OCI resource locks include the following types:
- Delete lock: Prevents deletion of the locked resource.
- Full lock: Prevents update, move, and deletion of the locked resource.
You can only add or remove one lock type at a time, but both locks can be applied to a resource. For example, you might initially apply a delete lock, but choose to apply a full lock at a later time.
The user who places a lock is the lock owner. Any authorized user with lock privilege or users with global manage permission of the tenancy has the authorization to create and remove any lock in the tenancy. You can override or remove locks.
Required IAM Policy
To create locks, in addition to permission to manage exports, you need permissions to manage locks.
To lock an export, you must have RESOURCE_LOCK_ADD
permissions.
- Open the navigation menu and select Storage. Under File Storage, select Mount Targets.
- In the List scope section, under Compartment, select a compartment. All the file systems in the selected compartment are displayed.
- Click the name of the file system for which you want to lock the export.
- On the file system's details page, under Resources, click Exports.
- In the Exports list, click the name of the export that you want to lock.
- On the export's details page, next to Resource Locking, select Add.
- In the Add Lock window, select the lock type and click Save changes.
Use the
oci fs export add
command and required parameters to lock an export:oci fs export add --export-id <export_OCID> --type <lock_type>
For a complete list of parameters and values for CLI commands, see the CLI Command Reference.
Run the AddExportLock operation to lock an export.
For information about using the API and signing requests, see REST API documentation and Security Credentials. For information about SDKs, see SDKs and the CLI.