Permissions for EFS Endpoints - Amazon Elastic File System
Services or capabilities described in AWS documentation might vary by Region. To see the differences applicable to the AWS European Sovereign Cloud Region, see the AWS European Sovereign Cloud User Guide.

Permissions for EFS Endpoints

IAM permissions control access through EFS Endpoints to an EFS file system. Access through EFS Endpoints is denied by default, and a principal can connect through EFS Endpoints only when its identity policy or the file system policy explicitly allows the EFS Endpoint actions. To connect through a mount target, a principal needs only the existing client actions. For more information about how Amazon EFS evaluates identity policies and file system policies together, see Using IAM to control access to file systems.

The elasticfilesystem-endpoint IAM name

EFS Endpoint actions use a separate IAM name, elasticfilesystem-endpoint, so you control access through EFS Endpoints independently of your existing EFS permissions. This IAM name contains the same three client actions as the elasticfilesystem IAM name: ClientMount, ClientWrite, and ClientRootAccess.

For a connection through EFS Endpoints, Amazon EFS authorizes each client action under both IAM names, and both must be allowed. For example, to read data through EFS Endpoints, a principal needs both elasticfilesystem:ClientMount and elasticfilesystem-endpoint:ClientMount. An existing deny on an elasticfilesystem client action also applies to connections through EFS Endpoints.

Required IAM actions

An EFS Endpoint connection is authorized at two points. The mount helper first calls the CreateMountSession API to get connection information for your file system. The client then connects to the file system, and Amazon EFS authorizes the client actions for the connection. The following table lists the actions each step requires.

Required IAM actions for EFS Endpoints
Step Required actions
Get connection information (CreateMountSession) elasticfilesystem:CreateMountSession
Connect and read elasticfilesystem:ClientMount and elasticfilesystem-endpoint:ClientMount
Write elasticfilesystem:ClientWrite and elasticfilesystem-endpoint:ClientWrite
Root access elasticfilesystem:ClientRootAccess and elasticfilesystem-endpoint:ClientRootAccess

The mount helper calls CreateMountSession automatically, so you don't need to call this API directly. A principal that has only elasticfilesystem:CreateMountSession can get connection information, but can't connect to the file system. Before it uses EFS Endpoints, the mount helper can also use elasticfilesystem:DescribeMountTargets to look for a mount target that the client can reach. This action isn't required for EFS Endpoints.

Default file system policy

The default file system policy grants access only to clients that connect through a mount target, so it doesn't grant access through EFS Endpoints. If your file system uses the default file system policy, grant access through EFS Endpoints to principals in your AWS account through an identity policy. To grant access through EFS Endpoints to principals in another AWS account, add a file system policy that grants the access. When you add a file system policy, the default file system policy no longer applies, so the new policy must also grant any mount target access that your clients need. For more information, see Default EFS file system policy.

Condition keys for network path

You can use the following condition keys in identity policies, file system policies, and service control policies (SCPs) to allow or deny access based on how a client connects. Both keys apply to client actions in the elasticfilesystem and elasticfilesystem-endpoint IAM names, so you can group all client actions in a single statement. The keys don't apply to elasticfilesystem:CreateMountSession. Access through AWS Transfer Family uses neither a mount target nor EFS Endpoints, so both keys are false.

Condition keys for network path
Network path elasticfilesystem:AccessedViaMountTarget elasticfilesystem:AccessedViaRegionalEndpoint
Mount target true false
EFS Endpoints false true
AWS Transfer Family false false

Policies that use "elasticfilesystem:AccessedViaMountTarget": "true" continue to allow access only through mount targets. A statement that uses "elasticfilesystem:AccessedViaMountTarget": "false" to match AWS Transfer Family now also matches access through EFS Endpoints. To match only AWS Transfer Family, also add "elasticfilesystem:AccessedViaRegionalEndpoint": "false".

To restrict a file system to mount targets only, deny all elasticfilesystem-endpoint actions. This approach requires one statement with no condition keys. You can also deny the elasticfilesystem client actions with the condition "Bool": {"elasticfilesystem:AccessedViaRegionalEndpoint": "true"}. For examples, see Policy examples for network access.

For connections through EFS Endpoints, Amazon EFS evaluates the aws:SourceIp condition key against the public IP address of the client. For a client in a VPC that connects through a NAT gateway, this is the public IP address of the NAT gateway. You can use aws:SourceIp to allow access through EFS Endpoints only from IP address ranges that you specify.

AWS managed policies

Amazon EFS provides AWS managed policies that bundle the actions required for each access tier. Each EFS Endpoint policy also grants mount target access at the same tier, so you can attach one policy for both paths. For more information, see AWS managed policies for Amazon EFS.

AWS managed policies for EFS Endpoints
Managed policy Grants
AmazonElasticFileSystemEndpointClientFullAccess Read, write, and root access through mount targets and EFS Endpoints
AmazonElasticFileSystemEndpointClientReadWriteAccess Read and write access through mount targets and EFS Endpoints
AmazonElasticFileSystemEndpointClientReadOnlyAccess Read access through mount targets and EFS Endpoints

The existing AmazonElasticFileSystemClientFullAccess, AmazonElasticFileSystemClientReadWriteAccess, and AmazonElasticFileSystemClientReadOnlyAccess policies don't grant access through EFS Endpoints. Principals that use these policies continue to connect only through mount targets.

Revoking access through EFS Endpoints

When you add a policy that denies access through EFS Endpoints, Amazon EFS rejects new EFS Endpoint connections immediately. Clients that are already connected through EFS Endpoints continue operating until their next reauthentication, which occurs every 5 minutes. At that point, the connection fails. Connections through mount targets aren't affected.

Logging

AWS CloudTrail records each CreateMountSession call, including the calling principal and source IP address. When the client connects, Amazon EFS also records a NewClientConnection event, the same as for any connection that uses IAM authorization. You can use these events to audit which principals connect to your file system through EFS Endpoints. The mount helper also logs each mount attempt and the network path used, locally and to Amazon CloudWatch Logs when enabled. For more information, see Logging Amazon EFS API calls with AWS CloudTrail.