Ensure that encryption is enabled for EFS file systems
Description
EFS data should be encrypted at rest using AWS KMS (Key Management Service).
Rationale
Data should be encrypted at rest to reduce the risk of a data breach via direct access to the storage device.
Impact
EFS file system data-at-rest encryption must be turned on when creating the file system. If an EFS file system has been created without data-at-rest encryption enabled, then you must create another EFS file system with the correct configuration and transfer the data. There is no way to enable encryption on an existing unencrypted EFS file system.
Audit Procedure
Using AWS Console
- Login to the AWS Management Console and Navigate to the Elastic File System (EFS) dashboard.
- Select
File Systemsfrom the left navigation panel. - Each item on the list has a visible Encrypted field that displays data at rest encryption status.
- Validate that this field reads
Encryptedfor all EFS file systems in all AWS regions.
Using AWS CLI
- Run the
describe-file-systemscommand using custom query filters to list the identifiers of all AWS EFS file systems currently available within the selected region:
aws efs describe-file-systems --region --output table --query 'FileSystems[*].[FileSystemId,Encrypted]' --output table
The command output should return a table with the requested file system IDs.
Run the
describe-file-systemscommand using the ID of the file system that you want to examine asfile-system-idand the necessary query filters:
aws efs describe-file-systems --region <region> --file-system-id <file-system-id> --query 'FileSystems[*].Encrypted'
- The command output should return the file system encryption status as
trueorfalse. If the returned value isfalse, the selected AWS EFS file system is not encrypted and if the returned value istrue, the selected AWS EFS file system is encrypted.
Expected Result
The Encrypted field should return true for all EFS file systems, indicating that encryption at rest is enabled using AWS KMS.
Remediation
It is important to note that EFS file system data-at-rest encryption must be turned on when creating the file system. If an EFS file system has been created without data-at-rest encryption enabled, then you must create another EFS file system with the correct configuration and transfer the data.
Using AWS Console
Steps to create an EFS file system with data encrypted at rest:
- Login to the AWS Management Console and Navigate to the
Elastic File System (EFS)dashboard. - Select
File Systemsfrom the left navigation panel. - Click the
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 an appropriate VPC from the VPC dropdown list.
- Within the
Create mount targetssection, check the boxes 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. - Check the
Enable encryptionbox and chooseaws/elasticfilesystemfrom theSelect KMS master keydropdown 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 the other AWS regions.
Using AWS CLI
- Run the
describe-file-systemscommand to view the configuration information for the selected unencrypted file system identified in the Audit steps:
aws efs describe-file-systems --region <region> --file-system-id <file-system-id>
The command output should return the configuration information.
To provision a new AWS EFS file system, you need to generate a universally unique identifier (UUID) to create the token required by the
create-file-systemcommand. To create the required token, you can use a randomly generated UUID from "https://www.uuidgenerator.net".Run the
create-file-systemcommand using the unique token created at the previous step:
aws efs create-file-system --region <region> --creation-token <uuid> --performance-mode generalPurpose --encrypted
The command output should return the new file system configuration metadata.
Run the
create-mount-targetcommand using the EFS file system ID returned from step 4 as the identifier and the ID of the Availability Zone (AZ) that will represent the mount target:
aws efs create-mount-target --region <region> --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 to 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> --file-system-id <unencrypted-file-system-id>
- Change the AWS region by updating the --region and repeat the entire process for the other AWS regions.
Default Value
By default, when creating an EFS file system through the AWS Management Console, encryption at rest is enabled. When creating a file system using the AWS CLI, API, or SDKs, encryption is not enabled by default and must be explicitly specified.
References
- https://docs.aws.amazon.com/efs/latest/ug/encryption-at-rest.html
- https://awscli.amazonaws.com/v2/documentation/api/latest/reference/efs/index.html#efs
CIS Controls
| Controls Version | Control | IG 1 | IG 2 | IG 3 |
|---|---|---|---|---|
| v8 | 3.11 Encrypt Sensitive Data at Rest | x | x | |
| v7 | 14.8 Encrypt Sensitive Information at Rest | x |
MITRE ATT&CK Mappings
| Techniques / Sub-techniques | Tactics | Mitigations |
|---|---|---|
| T1530 | TA0009 | M1041 |
Profile
Level 1 | Automated