Locking a File System
Lock a File Storage file system to prevent updates, moves, and deletions of the resource. Locks help protect resources against tampering.
A lock on a file system resource doesn't prevent authorized users from changing the contents of the file system. Users can still create, change, and delete files on a file system with a resource lock.
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 file system locks.
Required IAM Policy
To create locks, in addition to permissions to manage the file system, you need permissions to manage locks.
To lock a file system, you must have RESOURCE_LOCK_ADD
permissions.
- Open the navigation menu and click Storage. Under File Storage, click File Systems.
-
In the List scope section, under Compartment, select a compartment.
- In the list of file systems, click the name of the file system that you want to lock.
- On the file system'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 file-system add
command and required parameters to lock a file system:oci fs file-system add --file-system-id <file_system_OCID> --type <lock_type>
For a complete list of parameters and values for CLI commands, see the CLI Command Reference.
Run the AddFileSystemLock operation to lock a file system.
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.