Info icon
End of Life Notice: For Trend Cloud One™ - Conformity Customers, Conformity will reach its End of Sale on “July 31st, 2025” and End of Life “July 31st, 2026”. The same capabilities and much more is available in TrendAI Vision One™ Cloud Risk Management. For details, please refer to Upgrade to TrendAI Vision One™
Use the Knowledge Base AI to help improve your Cloud Posture

Enable Automatic Backups for Elastic File Systems

TrendAI Vision One™ provides continuous assurance that gives peace of mind for your cloud infrastructure, delivering over 1400 automated best practice checks.

Risk Level: High (not acceptable risk)

Ensure that your Amazon EFS file systems are configured to take automatic daily backups for point-in-time recovery.

Reliability

Amazon EFS automatic backups can help you simplify the backup management of your EFS file systems, enable you to meet regulatory backup requirements, and allow you to handle efficiently your data restoration process in case of data corruption or data loss. Once automatic backups are enabled, Amazon EFS service will take a full snapshot of your file system data every day and keep the backups for a limited period of time that you configure, known as backup retention period. These automatic daily backups are stored in a default EFS backup vault which is created by the Amazon EFS service on your behalf.


Audit

To determine if your Amazon EFS file systems have automatic backups enabled, perform the following actions:

Using AWS Console

  1. Sign in to the AWS Management Console.

  2. Navigate to Amazon Elastic File System (EFS) console at https://console.aws.amazon.com/efs/.

  3. In the main navigation panel, under Elastic File System, choose File systems.

  4. Click on the name/ID (link) of the Amazon EFS file system that you want to examine.

  5. In the General section, check the Automatic backups attribute value. If the Automatic backups value (status) is set to Disabled, automatic backups are not enabled for the selected Amazon EFS file system.

  6. Repeat steps no. 4 and 5 for each Amazon EFS file system available within the current AWS region.

  7. Change the AWS cloud region from the navigation bar and repeat the Audit process for other AWS regions.

Using AWS CLI

  1. Run describe-file-systems command (OSX/Linux/UNIX) with custom query filters to list the name of each Amazon EFS file system provisioned in the selected AWS region:

    aws efs describe-file-systems
      --region us-east-1
      --output table
      --query 'FileSystems[*].FileSystemId'
    
  2. The command output should return a table with the requested file system ID(s):

    --------------------------
    |   DescribeFileSystems  |
    +------------------------+
    |  fs-0abcd1234abcd1234  |
    |  fs-01234abcd1234abcd  |
    +------------------------+
    
  3. Run describe-backup-policy command (OSX/Linux/UNIX) using the ID of the EFS file system that you want to examine as the identifier and the custom query filters to describe the status of the backup policy configured for the selected file system:

    aws efs describe-backup-policy
      --region us-east-1
      --file-system-id fs-0abcd1234abcd1234
      --query 'BackupPolicy.Status'
    
  4. The command output should return the requested backup policy status:

    "DISABLED"
    

    If the describe-backup-policy command output returns "DISABLED" as the status of the file system backup policy, as shown in the example above, the Automatic Backups feature is not enabled for the selected Amazon EFS file system.

  5. Repeat steps no. 3 and 4 for each Amazon EFS file system available in the selected AWS region.

  6. Change the AWS cloud region by updating the --region command parameter value and repeat the Audit process for other regions.

Remediation / Resolution

To enable automatic backups for your existing Amazon EFS file systems, perform the following actions:

Using AWS CloudFormation

  1. CloudFormation template (JSON):

    {
    	"AWSTemplateFormatVersion": "2010-09-09",
    	"Description": "Enable Automatic Backups",
    	"Resources": {
    		"MountTargetVPC": {
    			"Type": "AWS::EC2::VPC",
    			"Properties": {
    				"CidrBlock": "172.16.0.0/16"
    			}
    		},
    		"MountTargetSubnet": {
    			"Type": "AWS::EC2::Subnet",
    			"Properties": {
    				"CidrBlock": "172.16.1.0/24",
    				"VpcId": {
    					"Ref": "MountTargetVPC"
    				},
    				"AvailabilityZone": "us-east-1a"
    			}
    		},
    		"EFSFileSystem": {
    			"Type": "AWS::EFS::FileSystem",
    			"Properties": {
    				"Encrypted": true,
    				"PerformanceMode": "generalPurpose",
    				"ThroughputMode": "bursting",
    				"FileSystemPolicy": {
    					"Version": "2012-10-17",
    					"Statement": [
    						{
    							"Effect": "Allow",
    							"Action": [
    								"elasticfilesystem:ClientMount"
    							],
    							"Principal": {
    								"AWS": "arn:aws:iam::123456789012:role/EFSReadOnlyRole"
    							}
    						}
    					]
    				},
    				"BackupPolicy": {
    					"Status": "ENABLED"
    				}
    			}
    		},
    		"EFSMountTarget": {
    			"Type": "AWS::EFS::MountTarget",
    			"Properties": {
    				"FileSystemId": {
    					"Ref": "EFSFileSystem"
    				},
    				"SubnetId": {
    					"Ref": "MountTargetSubnet"
    				},
    				"SecurityGroups": [
    					{
    						"Fn::GetAtt": [
    							"MountTargetVPC",
    							"DefaultSecurityGroup"
    						]
    					}
    				]
    			}
    		},
    		"EFSAccessPoint": {
    			"Type": "AWS::EFS::AccessPoint",
    			"Properties": {
    				"FileSystemId": {
    					"Ref": "EFSFileSystem"
    				},
    				"PosixUser": {
    					"Uid": "13234",
    					"Gid": "1322",
    					"SecondaryGids": [
    						"1344",
    						"1452"
    					]
    				},
    				"RootDirectory": {
    					"CreationInfo": {
    						"OwnerGid": "708798",
    						"OwnerUid": "7987987",
    						"Permissions": "0755"
    					},
    					"Path": "/web/production"
    				}
    			}
    		}
    	}
    }
    
  2. CloudFormation template (YAML):

    AWSTemplateFormatVersion: '2010-09-09'
    	Description: Enable Automatic Backups
    	Resources:
    		MountTargetVPC:
    		Type: AWS::EC2::VPC
    		Properties:
    			CidrBlock: 172.16.0.0/16
    		MountTargetSubnet:
    		Type: AWS::EC2::Subnet
    		Properties:
    			CidrBlock: 172.16.1.0/24
    			VpcId: !Ref 'MountTargetVPC'
    			AvailabilityZone: us-east-1a
    		EFSFileSystem:
    		Type: AWS::EFS::FileSystem
    		Properties:
    			Encrypted: true
    			PerformanceMode: generalPurpose
    			ThroughputMode: bursting
    			FileSystemPolicy:
    			Version: '2012-10-17'
    			Statement:
    				- Effect: Allow
    				Action:
    					- elasticfilesystem:ClientMount
    				Principal:
    					AWS: arn:aws:iam::123456789012:role/EFSReadOnlyRole
    			BackupPolicy:
    			Status: ENABLED
    		EFSMountTarget:
    		Type: AWS::EFS::MountTarget
    		Properties:
    			FileSystemId: !Ref 'EFSFileSystem'
    			SubnetId: !Ref 'MountTargetSubnet'
    			SecurityGroups:
    			- !GetAtt 'MountTargetVPC.DefaultSecurityGroup'
    		EFSAccessPoint:
    		Type: AWS::EFS::AccessPoint
    		Properties:
    			FileSystemId: !Ref 'EFSFileSystem'
    			PosixUser:
    			Uid: '13234'
    			Gid: '1322'
    			SecondaryGids:
    				- '1344'
    				- '1452'
    			RootDirectory:
    			CreationInfo:
    				OwnerGid: '708798'
    				OwnerUid: '7987987'
    				Permissions: '0755'
    			Path: /web/production
    

Using Terraform (AWS Provider)

  1. Terraform configuration file (.tf):

    terraform {
    	required_providers {
    		aws = {
    			source  = "hashicorp/aws"
    			version = "~> 4.0"
    		}
    	}
    
    	required_version = ">= 0.14.9"
    }
    
    provider "aws" {
    	profile = "default"
    	region  = "us-east-1"
    }
    
    resource "aws_efs_file_system" "efs-file-system" {
    	creation_token   = "abcdabcd-abcd-abcd-abcd-abcdabcdabcd"
    	performance_mode = "generalPurpose"
    	throughput_mode  = "bursting"
    	encrypted        = "true"
    }
    
    resource "aws_efs_file_system_policy" "file-system-policy" {
    	file_system_id = aws_efs_file_system.efs-file-system.id
    	policy = <<POLICY
    {
    	"Version": "2012-10-17",
    		"Statement": [
    			{
    				"Effect": "Allow",
    				"Action": [
    					"elasticfilesystem:ClientMount"
    				],
    				"Principal": {"AWS": "arn:aws:iam::123456789012:role/EFSReadOnlyRole"}
    			}
    		]
    }
    POLICY
    }
    
    resource "aws_efs_mount_target" "efs-mount-target" {
    	file_system_id  = aws_efs_file_system.efs-file-system.id
    	subnet_id       = "subnet-0abcd1234abcd1234"
    	security_groups = ["sg-01234abcd1234abcd"]
    }
    
    resource "aws_efs_access_point" "efs-access-point" {
    	file_system_id = aws_efs_file_system.efs-file-system.id
    }
    
    resource "aws_efs_backup_policy" "efs-backup-policy" {
    	file_system_id = aws_efs_file_system.efs-file-system.id
    	backup_policy {
    	status = "ENABLED"
    	}
    }
    

Using AWS Console

  1. Sign in to the AWS Management Console.

  2. Navigate to Amazon Elastic File System (EFS) console at https://console.aws.amazon.com/efs/.

  3. In the main navigation panel, under Elastic File System, choose File systems.

  4. Click on the name/ID (link) of the Amazon EFS file system that you want to reconfigure.

  5. Choose Edit from the General section to modify the file system general settings.

  6. Select the Enable automatic backups checkbox available under Automatic backups to enable the Automatic Backups feature for the selected Amazon EFS file system.

  7. Choose Save changes to apply the configuration changes.

  8. Repeat steps no. 4 – 7 for each Amazon EFS file system available in the selected AWS region.

  9. Change the AWS cloud region from the navigation bar and repeat the Remediation process for other AWS regions.

Using AWS CLI

  1. Run put-backup-policy command (OSX/Linux/UNIX) using the ID of the Amazon EFS file system that you want to reconfigure as the identifier parameter to enable automatic backups by updating the backup policy configured for the selected file system:

    aws efs put-backup-policy
      --region us-east-1
      --file-system-id fs-0abcd1234abcd1234
      --backup-policy Status="ENABLED"
    
  2. The command output should return the status of the updated EFS backup policy:

    {
    	"BackupPolicy": {
    		"Status": "ENABLING"
    	}
    }
    
  3. Run describe-backup-policy command (OSX/Linux/UNIX) to describe the current status of the EFS backup policy in order to ensure that automatic backups have been enabled for the selected file system:

    aws efs describe-backup-policy
      --region us-east-1
      --file-system-id fs-0abcd1234abcd1234
      --query 'BackupPolicy.Status'
    
  4. The command output should return the requested status. If the status is set to "ENABLED", automatic backups have been enabled for the selected file system:

    "ENABLED"
    
  5. Repeat steps no. 1 – 4 for each Amazon EFS file system available in the selected AWS region.

  6. Change the AWS cloud region by updating the --region command parameter value and repeat the Remediation process for other regions.

References

Publication date Jan 17, 2024