Quantcast
Channel: Veeam Support Knowledge Base
Viewing all articles
Browse latest Browse all 4362

How to Create Custom Backup Policy IAM Role

$
0
0

Challenge

The Backup Policy IAM role is used to run the following backup operations:
  • Enumerating of the resources.
  • Taking EBS snapshots of selected EC2 instances volumes.
  • Creating volumes from snapshots.
  • Attaching volumes to the worker instance.

Solution

The following types of deployment scenarios require the Backup Policy IAM role:
  • backup inside production
  • isolated from production backup
The isolated from production deployment type provides exceptional level of protection in cases when the whole production environment is lost. This type of deployment is recommended as the most secure one.
 

Isolated from production backup deployment


For this type of the deployment a second "Backup account" is required. Make sure to create one using the AWS web site. Veeam Backup for AWS Management appliance must be deployed in the Backup Account.
To allow the Veeam Backup appliance to perform required operations inside of the Production Account, a Backup Policy Role must be created in the Production Account.

This role must be made available for usage from the Backup Account.

Proceed through the following steps to create such a role:

1. Use the following JSON to create an IAM Policy by following the instructions from the How to create IAM Policy article  
    These permissions will allow the backup service to perform operations required for backup.
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "ec2:CopySnapshot",
                "ec2:CreateSnapshot",
                "ec2:CreateSnapshots",
                "ec2:CreateTags",
                "ec2:DeleteSnapshot",
                "ec2:DeleteTags",
                "ec2:DescribeAccountAttributes",
                "ec2:DescribeAvailabilityZones",
                "ec2:DescribeImages",
                "ec2:DescribeInstanceAttribute",
                "ec2:DescribeInstances",
                "ec2:DescribeInstanceStatus",
                "ec2:DescribeKeyPairs",
                "ec2:DescribeRegions",
                "ec2:DescribeSecurityGroups",
                "ec2:DescribeSnapshots",
                "ec2:DescribeSubnets",
                "ec2:DescribeRouteTables",
                "ec2:DescribeVolumes",
                "ec2:DescribeVpcEndpoints",
                "ec2:DescribeVpcs",
                "ec2:DescribeTags",
                "ec2:ModifySnapshotAttribute",
		"ec2:DescribeVolumeAttribute",
		"ec2:GetEbsDefaultKmsKeyId",
                "events:DeleteRule",
                "events:DescribeRule",
                "events:ListTargetsByRule",
                "events:PutRule",
                "events:PutTargets",
                "events:RemoveTargets",
                "iam:GetRole",
                "iam:ListAttachedRolePolicies",
                "iam:ListInstanceProfilesForRole",
                "iam:ListRolePolicies",
                "kms:DescribeKey",
                "kms:ListAliases",
                "kms:ListKeys",
		"kms:CreateGrant",
		"kms:GetKeyPolicy",
		"kms:ReEncryptFrom",
		"kms:ReEncryptTo",
                "s3:GetBucketLocation",
                "servicequotas:ListServiceQuotas",
                "sns:CreateTopic",
                "sns:DeleteTopic",
                "sns:ListSubscriptionsByTopic",
                "sns:ListTopics",
                "sns:SetTopicAttributes",
                "sns:Subscribe",
                "sns:Unsubscribe",
                "ssm:GetCommandInvocation",
                "ssm:SendCommand",
                "sts:AssumeRole",
                "sts:GetCallerIdentity",
                "sts:GetSessionToken",
                "sqs:DeleteMessage",
                "sqs:ListQueues",
                "sqs:ReceiveMessage",
                "sqs:DeleteQueue",
                "sqs:SendMessage",
                "sqs:CreateQueue",
                "sqs:SetQueueAttributes"
            ],
                      "Resource": "*",
                      "Effect": "Allow"
          }
    ]
}
2. Navigate to Roles.
3. Choose Create role.
4. Select the type of the trusted entity Another AWS Account.
5. In the Account ID field, enter the ID of your Backup Account (you can get this number in the AWS console of the Backup Account, in My Account located in the top-right menu).
6. Select the Require external ID checkbox and enter a pass phrase to raise the level of security for the role.
7. Click Next: Permissions.
8. In the filter policies search box, enter the name of the policy created in the Step 1.
9. In the first column, select the policy.
10. Click Next: Tags.
11. Enter tagging info if needed and click Next: Review.
12. Assign a name to the IAM Role. This name will be used in Veeam Backup for AWS (e.g. vb4aws_restore_role).
13. Click Create role.
14. Once the role is created, you will be able to see it in the list of available roles.
 

Backup inside production deployment


NOTE: This type of deployment (since it is not very secure) is recommended for test, demo and small environments only!

1. Please use the following JSON text to create IAM Policy by following instructions from How to create IAM Policy article 
    These permissions will allow backup service to perform required for backup operations:
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "ec2:AttachVolume",
                "ec2:CopySnapshot",
                "ec2:CreateKeyPair",
                "ec2:CreateSnapshot",
                "ec2:CreateSnapshots",
                "ec2:CreateTags",
                "ec2:CreateVolume",
                "ec2:DeleteKeyPair",
                "ec2:DeleteSnapshot",
                "ec2:DeleteTags",
                "ec2:DeleteVolume",
                "ec2:DeregisterImage",
                "ec2:DescribeAccountAttributes",
                "ec2:DescribeAvailabilityZones",
                "ec2:DescribeImages",
                "ec2:DescribeInstanceAttribute",
                "ec2:DescribeInstances",
                "ec2:DescribeInstanceStatus",
                "ec2:DescribeKeyPairs",
                "ec2:DescribeRegions",
                "ec2:DescribeSecurityGroups",
                "ec2:DescribeSnapshots",
                "ec2:DescribeSubnets",
                "ec2:DescribeRouteTables",
                "ec2:DescribeVolumes",
                "ec2:DescribeVpcEndpoints",
                "ec2:DescribeVpcs",
                "ec2:DescribeTags",
                "ec2:DetachVolume",
                "ec2:ImportImage",
                "ec2:ModifyInstanceAttribute",
                "ec2:ModifySnapshotAttribute",
		"ec2:DescribeVolumeAttribute",
		"ec2:GetEbsDefaultKmsKeyId",
                "ec2:RunInstances",
                "ec2:StartInstances",
                "ec2:StopInstances",
                "ec2:TerminateInstances",
                "events:DeleteRule",
                "events:DescribeRule",
                "events:ListTargetsByRule",
                "events:PutRule",
                "events:PutTargets",
                "events:RemoveTargets",
                "iam:GetRole",
                "iam:ListAttachedRolePolicies",
                "iam:ListInstanceProfilesForRole",
                "iam:ListRolePolicies",
                "kms:DescribeKey",
                "kms:ListAliases",
		"kms:CreateGrant",
		"kms:GetKeyPolicy",
		"kms:ReEncryptFrom",
		"kms:ReEncryptTo",
                "kms:ListKeys",
                "s3:GetBucketLocation",
                "servicequotas:ListServiceQuotas",
                "sns:CreateTopic",
                "sns:DeleteTopic",
                "sns:ListSubscriptionsByTopic",
                "sns:ListTopics",
                "sns:SetTopicAttributes",
                "sns:Subscribe",
                "sns:Unsubscribe",
                "ssm:GetCommandInvocation",
                "ssm:SendCommand",
                "sts:AssumeRole",
                "sts:GetCallerIdentity",
                "sts:GetSessionToken",
                "sqs:DeleteMessage",
                "sqs:ListQueues",
                "sqs:ReceiveMessage",
                "sqs:DeleteQueue",
                "sqs:SendMessage",
                "sqs:CreateQueue",
                "sqs:SetQueueAttributes"
                ],
                      "Resource": "*",
                      "Effect": "Allow"
          }
    ]
}
2. Navigate to Roles.
3. Choose Create role.
4. Select type of trusted entity AWS Service.
5. Select your use case EC2. Choose EC2 in Select your use case
6. Press Next: Permissions button.
7. Enter the name of the policy created on step 1 in filter policies search box.
8. Select the policy with ticking on the checkbox in the first column.
9. Press Next: Tags button.
10. Enter tagging info if desired and press Next: Review button.
11. Give a name to the IAM Role - you will be using this name in the Veeam Backup for AWS UI (e.g. vb4aws_pol2role).
12. Press Create role button.
13. After successful creation of the role you will be able to see it in the list of all available roles.
14. To add this role to the Veeam Backup for AWS service, you should update Trust relationships for the created role as described in this article.

Viewing all articles
Browse latest Browse all 4362

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>