Skip to content

Commit 0a299a2

Browse files
Google APIscopybara-github
authored andcommitted
feat: Add Squash Mode to Export Policy
This change introduces squash mode options to the export policy rules. Squash mode determines how user and group IDs are mapped for NFS volume access. The following squash modes are added: * **NO_ROOT_SQUASH** Root user retains full access. * **ROOT_SQUASH** Root user is mapped to the anonymous user ID. * **ALL_SQUASH** All users are mapped to the anonymous user ID. A new field anon_uid is also added to specify the anonymous user ID when ALL_SQUASH is used. The squash_mode field takes precedence over the existing has_root_access field, which will be deprecated in the future. PiperOrigin-RevId: 834629780
1 parent 7037104 commit 0a299a2

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

google/cloud/netapp/v1/volume.proto

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,25 @@ message ExportPolicy {
437437

438438
// An export policy rule describing various export options.
439439
message SimpleExportPolicyRule {
440+
// SquashMode defines how remote user privileges are restricted when accessing
441+
// an NFS export. It controls how user identities (like root) are mapped to
442+
// anonymous users to limit access and enforce security.
443+
enum SquashMode {
444+
// Defaults to NO_ROOT_SQUASH.
445+
SQUASH_MODE_UNSPECIFIED = 0;
446+
447+
// The root user (UID 0) retains full access. Other users are
448+
// unaffected.
449+
NO_ROOT_SQUASH = 1;
450+
451+
// The root user (UID 0) is squashed to anonymous user ID. Other users are
452+
// unaffected.
453+
ROOT_SQUASH = 2;
454+
455+
// All users are squashed to anonymous user ID.
456+
ALL_SQUASH = 3;
457+
}
458+
440459
// Comma separated list of allowed clients IP addresses
441460
optional string allowed_clients = 1;
442461

@@ -484,6 +503,15 @@ message SimpleExportPolicyRule {
484503
// mount using 'privacy' kerberos security mode. The 'kerberos5pReadOnly'
485504
// value be ignored if this is enabled.
486505
optional bool kerberos_5p_read_write = 11;
506+
507+
// Optional. Defines how user identity squashing is applied for this export
508+
// rule. This field is the preferred way to configure squashing behavior and
509+
// takes precedence over `has_root_access` if both are provided.
510+
optional SquashMode squash_mode = 12 [(google.api.field_behavior) = OPTIONAL];
511+
512+
// Optional. An integer representing the anonymous user ID. Range is 0 to
513+
// 4294967295. Required when squash_mode is ROOT_SQUASH or ALL_SQUASH.
514+
optional int64 anon_uid = 13 [(google.api.field_behavior) = OPTIONAL];
487515
}
488516

489517
// Snapshot Policy for a volume.

0 commit comments

Comments
 (0)