Remediation
EFS file system data-at-rest encryption must be enabled when you create the file system. If an EFS file system was created without encryption, you must create another file system with the correct configuration and transfer the data.
Steps to create an EFS file system with data encrypted at rest:
From Consoleβ
-
Log in to the AWS Management Console and navigate to the
Elastic File System (EFS)dashboard. -
Select
File Systemsfrom the left navigation panel. -
Click
Create File Systembutton from the dashboard top menu to start the file system setup process. -
On the
Configure file system accessconfiguration page, perform the following actions.- Choose the right VPC from the VPC dropdown list.
- Within
Create mount targetssection, select the checkboxes for all of the Availability Zones (AZs) within the selected VPC. These will be your mount targets. - Click
Next stepto continue.
-
Perform the following on the
Configure optional settingspage.- Create
tagsto describe your new file system. - Choose
performance modebased on your requirements. - Select the
Enable encryptioncheckbox and chooseaws/elasticfilesystemfrom the Select KMS master key dropdown list to enable encryption for the new file system using the default master key provided and managed by AWS KMS. - Click
Next stepto continue.
- Create
-
Review the file system configuration details on the
review and createpage and then clickCreate File Systemto create your new AWS EFS file system. -
Copy the data from the old unencrypted EFS file system onto the newly created encrypted file system.
-
Remove the unencrypted file system as soon as your data migration to the newly created encrypted file system is completed.
-
Change the AWS region from the navigation bar and repeat the entire process for other AWS regions.
From Command Lineβ
-
Run
describe-file-systemscommand to describe the configuration information available for the selected (unencrypted) file system (see Audit section to identify the right resource):aws efs describe-file-systems --region {{region-name}} --file-system-id {{file-system-id}} -
The command output should return the requested configuration information.
-
To provision a new AWS EFS file system, generate a universally unique identifier (UUID) to create the token required by the
create-file-systemcommand. You can use a randomly generated UUID from https://www.uuidgenerator.net. -
Run
create-file-systemcommand using the unique token created at the previous step:aws efs create-file-system \
--region {{region-name}} \
--creation-token {{creation-token}} \
--performance-mode generalPurpose \
--encrypted -
The command output should return the new file system configuration metadata.
-
Run the
create-mount-targetcommand using the newly created EFS file system ID returned at the previous step as the identifier and the ID of the Availability Zone (AZ) that will represent the mount target:aws efs create-mount-target --region {{region-name}} --file-system-id {{file-system-id}} --subnet-id {{subnet-id}} -
The command output should return the new mount target metadata.
-
Now you can mount your file system from an EC2 instance.
-
Copy the data from the old unencrypted EFS file system onto the newly created encrypted file system.
-
Remove the unencrypted file system as soon as your data migration to the newly created encrypted file system is completed.
aws efs delete-file-system --region {{region-name}} --file-system-id {{unencrypted-file-system-id}} -
Change the AWS region by updating
--regionand repeat the entire process for other AWS regions.