Skip to content

Commit 920eafe

Browse files
author
awstools
committed
feat(client-fsx): This release adds root squash support to FSx for Lustre to restrict root level access from clients by mapping root users to a less-privileged user/group with limited permissions.
1 parent 212b3e3 commit 920eafe

File tree

5 files changed

+236
-7
lines changed

5 files changed

+236
-7
lines changed

clients/client-fsx/src/FSx.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1722,6 +1722,11 @@ export class FSx extends FSxClient {
17221722
* </li>
17231723
* <li>
17241724
* <p>
1725+
* <code>LustreRootSquashConfiguration</code>
1726+
* </p>
1727+
* </li>
1728+
* <li>
1729+
* <p>
17251730
* <code>StorageCapacity</code>
17261731
* </p>
17271732
* </li>

clients/client-fsx/src/commands/UpdateFileSystemCommand.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ export interface UpdateFileSystemCommandOutput extends UpdateFileSystemResponse,
8989
* </li>
9090
* <li>
9191
* <p>
92+
* <code>LustreRootSquashConfiguration</code>
93+
* </p>
94+
* </li>
95+
* <li>
96+
* <p>
9297
* <code>StorageCapacity</code>
9398
* </p>
9499
* </li>

clients/client-fsx/src/models/models_0.ts

Lines changed: 82 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,13 +385,72 @@ export namespace LustreLogConfiguration {
385385
});
386386
}
387387

388+
/**
389+
* <p>The configuration for Lustre root squash used to restrict root-level access
390+
* from clients that try to access your FSx for Lustre file system as root.
391+
* Use the <code>RootSquash</code> parameter to enable root squash. To learn more
392+
* about Lustre root squash,
393+
* see <a href="https://docs.aws.amazon.com/fsx/latest/LustreGuide/root-squash.html">Lustre root squash</a>.</p>
394+
* <p>You can also use the <code>NoSquashNids</code> parameter to provide an array of clients
395+
* who are not affected by the root squash setting. These clients will access the file system as root,
396+
* with unrestricted privileges.</p>
397+
*/
398+
export interface LustreRootSquashConfiguration {
399+
/**
400+
* <p>You enable root squash by setting a user ID (UID) and group ID (GID) for the file
401+
* system in the format <code>UID:GID</code> (for example, <code>365534:65534</code>).
402+
* The UID and GID values can range from <code>0</code> to <code>4294967294</code>:</p>
403+
* <ul>
404+
* <li>
405+
* <p>A non-zero value for UID and GID enables root squash. The UID and GID
406+
* values can be different, but each must be a non-zero value.</p>
407+
* </li>
408+
* <li>
409+
* <p>A value of <code>0</code> (zero) for UID and GID indicates root,
410+
* and therefore disables root squash.</p>
411+
* </li>
412+
* </ul>
413+
* <p>When root squash is enabled, the user ID and group ID of a root user accessing
414+
* the file system are re-mapped to the UID and GID you provide.</p>
415+
*/
416+
RootSquash?: string;
417+
418+
/**
419+
* <p>When root squash is enabled, you can optionally specify an array of NIDs of clients
420+
* for which root squash does not apply. A client NID is a Lustre Network Identifier used
421+
* to uniquely identify a client. You can specify the NID as either a single address or a
422+
* range of addresses:</p>
423+
* <ul>
424+
* <li>
425+
* <p>A single address is described in standard Lustre NID format by specifying
426+
* the client’s IP address followed by the Lustre network ID (for example,
427+
* <code>10.0.1.6@tcp</code>).</p>
428+
* </li>
429+
* <li>
430+
* <p>An address range is described using a dash to separate the range (for example,
431+
* <code>10.0.[2-10].[1-255]@tcp</code>).</p>
432+
* </li>
433+
* </ul>
434+
*/
435+
NoSquashNids?: string[];
436+
}
437+
438+
export namespace LustreRootSquashConfiguration {
439+
/**
440+
* @internal
441+
*/
442+
export const filterSensitiveLog = (obj: LustreRootSquashConfiguration): any => ({
443+
...obj,
444+
});
445+
}
446+
388447
/**
389448
* <p>The configuration for the Amazon FSx for Lustre file system.</p>
390449
*/
391450
export interface LustreFileSystemConfiguration {
392451
/**
393452
* <p>The preferred start time to perform weekly maintenance, formatted d:HH:MM in the UTC
394-
* time zone. Here, d is the weekday number, from 1 through 7, beginning with Monday and
453+
* time zone. Here, <code>d</code> is the weekday number, from 1 through 7, beginning with Monday and
395454
* ending with Sunday.</p>
396455
*/
397456
WeeklyMaintenanceStartTime?: string;
@@ -512,6 +571,13 @@ export interface LustreFileSystemConfiguration {
512571
* events for your file system to Amazon CloudWatch Logs.</p>
513572
*/
514573
LogConfiguration?: LustreLogConfiguration;
574+
575+
/**
576+
* <p>The Lustre root squash configuration for an Amazon FSx for Lustre
577+
* file system. When enabled, root squash restricts root-level access from clients that
578+
* try to access your file system as a root user.</p>
579+
*/
580+
RootSquashConfiguration?: LustreRootSquashConfiguration;
515581
}
516582

517583
export namespace LustreFileSystemConfiguration {
@@ -3513,6 +3579,13 @@ export interface CreateFileSystemLustreConfiguration {
35133579
* associated with your file system to Amazon CloudWatch Logs.</p>
35143580
*/
35153581
LogConfiguration?: LustreLogCreateConfiguration;
3582+
3583+
/**
3584+
* <p>The Lustre root squash configuration used when creating an Amazon FSx for Lustre
3585+
* file system. When enabled, root squash restricts root-level access from clients that
3586+
* try to access your file system as a root user.</p>
3587+
*/
3588+
RootSquashConfiguration?: LustreRootSquashConfiguration;
35163589
}
35173590

35183591
export namespace CreateFileSystemLustreConfiguration {
@@ -3560,8 +3633,7 @@ export interface CreateFileSystemOntapConfiguration {
35603633
* </li>
35613634
* </ul>
35623635
* <p>For information about the use cases for Multi-AZ and Single-AZ deployments, refer to
3563-
* <a href="https://docs.aws.amazon.com/fsx/latest/ONTAPGuide/high-availability-multiAZ.html">Choosing Multi-AZ or
3564-
* Single-AZ file system deployment</a>. </p>
3636+
* <a href="https://docs.aws.amazon.com/fsx/latest/ONTAPGuide/high-availability-AZ.html">Choosing a file system deployment type</a>. </p>
35653637
*/
35663638
DeploymentType: OntapDeploymentType | string | undefined;
35673639

@@ -7221,6 +7293,13 @@ export interface UpdateFileSystemLustreConfiguration {
72217293
* data repositories associated with your file system to Amazon CloudWatch Logs.</p>
72227294
*/
72237295
LogConfiguration?: LustreLogCreateConfiguration;
7296+
7297+
/**
7298+
* <p>The Lustre root squash configuration used when updating an Amazon FSx for Lustre
7299+
* file system. When enabled, root squash restricts root-level access from clients that
7300+
* try to access your file system as a root user.</p>
7301+
*/
7302+
RootSquashConfiguration?: LustreRootSquashConfiguration;
72247303
}
72257304

72267305
export namespace UpdateFileSystemLustreConfiguration {

clients/client-fsx/src/protocols/Aws_json1_1.ts

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ import {
242242
LustreFileSystemConfiguration,
243243
LustreLogConfiguration,
244244
LustreLogCreateConfiguration,
245+
LustreRootSquashConfiguration,
245246
MissingFileSystemConfiguration,
246247
MissingVolumeConfiguration,
247248
NotServiceResourceError,
@@ -3479,6 +3480,13 @@ const serializeAws_json1_1CreateFileSystemLustreConfiguration = (
34793480
}),
34803481
...(input.PerUnitStorageThroughput !== undefined &&
34813482
input.PerUnitStorageThroughput !== null && { PerUnitStorageThroughput: input.PerUnitStorageThroughput }),
3483+
...(input.RootSquashConfiguration !== undefined &&
3484+
input.RootSquashConfiguration !== null && {
3485+
RootSquashConfiguration: serializeAws_json1_1LustreRootSquashConfiguration(
3486+
input.RootSquashConfiguration,
3487+
context
3488+
),
3489+
}),
34823490
...(input.WeeklyMaintenanceStartTime !== undefined &&
34833491
input.WeeklyMaintenanceStartTime !== null && { WeeklyMaintenanceStartTime: input.WeeklyMaintenanceStartTime }),
34843492
};
@@ -4229,6 +4237,30 @@ const serializeAws_json1_1LustreLogCreateConfiguration = (
42294237
};
42304238
};
42314239

4240+
const serializeAws_json1_1LustreNoSquashNids = (input: string[], context: __SerdeContext): any => {
4241+
return input
4242+
.filter((e: any) => e != null)
4243+
.map((entry) => {
4244+
if (entry === null) {
4245+
return null as any;
4246+
}
4247+
return entry;
4248+
});
4249+
};
4250+
4251+
const serializeAws_json1_1LustreRootSquashConfiguration = (
4252+
input: LustreRootSquashConfiguration,
4253+
context: __SerdeContext
4254+
): any => {
4255+
return {
4256+
...(input.NoSquashNids !== undefined &&
4257+
input.NoSquashNids !== null && {
4258+
NoSquashNids: serializeAws_json1_1LustreNoSquashNids(input.NoSquashNids, context),
4259+
}),
4260+
...(input.RootSquash !== undefined && input.RootSquash !== null && { RootSquash: input.RootSquash }),
4261+
};
4262+
};
4263+
42324264
const serializeAws_json1_1OpenZFSClientConfiguration = (
42334265
input: OpenZFSClientConfiguration,
42344266
context: __SerdeContext
@@ -4634,6 +4666,13 @@ const serializeAws_json1_1UpdateFileSystemLustreConfiguration = (
46344666
input.LogConfiguration !== null && {
46354667
LogConfiguration: serializeAws_json1_1LustreLogCreateConfiguration(input.LogConfiguration, context),
46364668
}),
4669+
...(input.RootSquashConfiguration !== undefined &&
4670+
input.RootSquashConfiguration !== null && {
4671+
RootSquashConfiguration: serializeAws_json1_1LustreRootSquashConfiguration(
4672+
input.RootSquashConfiguration,
4673+
context
4674+
),
4675+
}),
46374676
...(input.WeeklyMaintenanceStartTime !== undefined &&
46384677
input.WeeklyMaintenanceStartTime !== null && { WeeklyMaintenanceStartTime: input.WeeklyMaintenanceStartTime }),
46394678
};
@@ -5957,6 +5996,10 @@ const deserializeAws_json1_1LustreFileSystemConfiguration = (
59575996
: undefined,
59585997
MountName: __expectString(output.MountName),
59595998
PerUnitStorageThroughput: __expectInt32(output.PerUnitStorageThroughput),
5999+
RootSquashConfiguration:
6000+
output.RootSquashConfiguration !== undefined && output.RootSquashConfiguration !== null
6001+
? deserializeAws_json1_1LustreRootSquashConfiguration(output.RootSquashConfiguration, context)
6002+
: undefined,
59606003
WeeklyMaintenanceStartTime: __expectString(output.WeeklyMaintenanceStartTime),
59616004
} as any;
59626005
};
@@ -5968,6 +6011,31 @@ const deserializeAws_json1_1LustreLogConfiguration = (output: any, context: __Se
59686011
} as any;
59696012
};
59706013

6014+
const deserializeAws_json1_1LustreNoSquashNids = (output: any, context: __SerdeContext): string[] => {
6015+
const retVal = (output || [])
6016+
.filter((e: any) => e != null)
6017+
.map((entry: any) => {
6018+
if (entry === null) {
6019+
return null as any;
6020+
}
6021+
return __expectString(entry) as any;
6022+
});
6023+
return retVal;
6024+
};
6025+
6026+
const deserializeAws_json1_1LustreRootSquashConfiguration = (
6027+
output: any,
6028+
context: __SerdeContext
6029+
): LustreRootSquashConfiguration => {
6030+
return {
6031+
NoSquashNids:
6032+
output.NoSquashNids !== undefined && output.NoSquashNids !== null
6033+
? deserializeAws_json1_1LustreNoSquashNids(output.NoSquashNids, context)
6034+
: undefined,
6035+
RootSquash: __expectString(output.RootSquash),
6036+
} as any;
6037+
};
6038+
59716039
const deserializeAws_json1_1MissingFileSystemConfiguration = (
59726040
output: any,
59736041
context: __SerdeContext

0 commit comments

Comments
 (0)