How to Create Secure IAM Policy for Connection to S3 Object Storage
Challenge
Solution
There are two policies to choose from. The first policy is for use when immutability is not used for the cloud tier. The second policy is for use when immutability is used for the cloud tier.
Non-Immutable Buckets
Use the following JSON for non-immutable buckets to create an IAM Policy. These permissions will allow the Veeam Backup Service to access the S3 repository to save/load data to/from an object repository.
Starting with Veeam Backup & Replication 11a, the ListAllMyBuckets permission is not required if you manually enter the bucket name on the Bucket step of the New Object Repository wizard.
Note: Replace yourbucketname (lines 16 and 17) with the actual bucket name.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "SecureBucketPolicy0",
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject",
"s3:GetBucketLocation",
"s3:GetBucketVersioning",
"s3:GetBucketObjectLockConfiguration"
],
"Resource": [
"arn:aws:s3:::yourbucketname/*",
"arn:aws:s3:::yourbucketname"
]
},
{
"Sid": "SecureBucketPolicy1",
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets",
"s3:ListBucket"
],
"Resource": "*"
}
]
}
Immutable Buckets
Use the following JSON for immutable buckets to create an IAM Policy. These permissions will allow Veeam Backup Service to access the S3 repository to save/load data to/from an object repository.
Starting with Veeam Backup & Replication 11a, the ListAllMyBuckets permission is not required if you manually enter the bucket name on the Bucket step of the New Object Repository wizard.
Note: Replace yourbucketname (lines 23 and 24) with the actual bucket name.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"s3:GetBucketLocation",
"s3:GetObject",
"s3:PutObject",
"s3:DeleteObject",
"s3:GetBucketVersioning",
"s3:GetBucketObjectLockConfiguration",
"s3:ListBucketVersions",
"s3:GetObjectVersion",
"s3:GetObjectRetention",
"s3:GetObjectLegalHold",
"s3:PutObjectRetention",
"s3:PutObjectLegalHold",
"s3:DeleteObjectVersion"
],
"Resource": [
"arn:aws:s3:::yourbucketname/*",
"arn:aws:s3:::yourbucketname"
]
},
{
"Sid": "VisualEditor1",
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets",
"s3:ListBucket"
],
"Resource": "*"
}
]
}
Veeam Agent targeting Object Storage Repository Operating in Direct Connection Mode
When a Veeam Agent backup policy is operating in Managed by agent mode and targets a Veeam Backup Repository that is backed by AWS S3 Object Storage using 'Connection mode: Direct,' the Veeam Backup Server and the configured AWS account must be able to create new users on AWS and assign S3 policies to this user.
This IAM policy may also be used for a standalone Veeam Agent deployment targeting a Veeam Backup & Replication/Veeam Cloud Connect managed object storage repository with the Connection mode set to Direct.
Note: The term "Veeam Agent" in this explanation is used as a general term to refer to all Veeam Agent applications (e.g., Veeam Agent for Microsoft Windows, Veeam Agent for Linux, etc.). The links used to provide further context link to the Veeam Agent for Microsoft Windows User Guide, but apply to all Veeam Agent products.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"iam:GetPolicyVersion",
"iam:DeleteAccessKey",
"iam:GetPolicy",
"iam:AttachUserPolicy",
"iam:DeleteUserPolicy",
"iam:DeletePolicy",
"iam:DeleteUser",
"iam:ListUserPolicies",
"iam:CreateUser",
"iam:TagUser",
"iam:CreateAccessKey",
"iam:CreatePolicy",
"iam:ListPolicyVersions",
"iam:GetUserPolicy",
"iam:PutUserPolicy",
"iam:ListAttachedUserPolicies",
"iam:GetUser",
"iam:CreatePolicyVersion",
"iam:DetachUserPolicy",
"iam:DeletePolicyVersion",
"iam:ListAccessKeys",
"iam:SetDefaultPolicyVersion"
],
"Resource": "*"
}
]
}
To report a typo on this page, highlight the typo with your mouse and press CTRL + Enter.