{"id":397,"date":"2019-02-02T21:47:18","date_gmt":"2019-02-02T13:47:18","guid":{"rendered":"https:\/\/www.intelliwolf.com\/?p=397"},"modified":"2019-02-02T21:52:57","modified_gmt":"2019-02-02T13:52:57","slug":"setup-amazon-s3-permissions-wordpress-backups","status":"publish","type":"post","link":"https:\/\/www.intelliwolf.com\/setup-amazon-s3-permissions-wordpress-backups\/","title":{"rendered":"How To Setup Amazon S3 Permissions For WordPress Backups"},"content":{"rendered":"\n

Many people use Amazon S3 to store the backups from their WordPress websites.<\/p>\n\n\n\n

Most of the good backup plugins integrate with Amazon S3. All you have to do is input your Amazon Access Key ID and Secret Access Key.<\/p>\n\n\n\n

The way their accounts are setup leave many people's Amazon accounts wide open if someone were to hack their WordPress site.<\/p>\n\n\n\n

You also don't want to use your master credentials on a client's site. You might trust them, but do you trust them with all the backups from all your clients, along with anything else you store in your Amazon S3 account?<\/p>\n\n\n\n

As you'd expect from a behemoth like Amazon, there is a way to create logins that can only be used to upload to a specific folder on a specific bucket. Someone with those credentials will never be able to delete the files in that folder either.<\/p>\n\n\n\n

How to setup Amazon S3 permissions for WordPress backups:<\/strong><\/p>\n\n\n\n

  1. Create an S3 Bucket<\/a> for backups<\/li>
  2. Create a Folder<\/a> for the website<\/li>
  3. Create an Access Policy<\/a> for the site<\/li>
  4. Create a Group<\/a> and attach the Policy<\/li>
  5. Create a User<\/a> and add it to the Group<\/li>
  6. Save the new credentials for use in your WordPress backup plugin<\/li><\/ol>\n\n\n\n

    Create an S3 Bucket for your backups<\/h2>\n\n\n\n

    The first step is to create a Bucket in S3 to store your backups. You can do a general backups bucket if you have a few websites.<\/p>\n\n\n\n

    The backups will then sit inside a folder in that bucket.<\/p>\n\n\n\n

    Login to Amazon AWS Management Console<\/a> and navigate to S3.<\/p>\n\n\n\n

    \"\"<\/figure><\/div>\n\n\n\n

    Click \"Create bucket\"<\/p>\n\n\n\n

    \"\"<\/figure><\/div>\n\n\n\n

    Add a Bucket name. This must be unique across all of Amazon S3. It's best to use something you'll remember belongs to your backups.<\/p>\n\n\n\n

    Choose a Region where your Bucket will live. This is the geographic location of the S3 server. From experience, it can be quite tedious if you start putting your Buckets in different regions.<\/p>\n\n\n\n

    For what we need, it doesn't really make a difference which region you choose. That matters more if you're hosting publicly accessible files, for example.<\/p>\n\n\n\n

    \"\"<\/figure><\/div>\n\n\n\n

    Check the options on the next few screens, but I usually just use the default options.<\/p>\n\n\n\n

    \"\"<\/figure><\/div>\n\n\n\n
    \"\"<\/figure><\/div>\n\n\n\n
    \"\"<\/figure><\/div>\n\n\n\n

    Once you're done, you'll be taken back to your list of Buckets. All your Buckets will be available here.<\/p>\n\n\n\n

    Create a Folder for the website<\/h2>\n\n\n\n

    Now it's time to create a Folder inside the Bucket. This Folder will be specific for this website. If you have multiple WordPress websites that you're backing up, just create a Folder here for each of them.<\/p>\n\n\n\n

    Click on the Bucket you just created.<\/p>\n\n\n\n

    \"\"<\/figure><\/div>\n\n\n\n

    Click \"Create folder\"<\/p>\n\n\n\n

    \"\"<\/figure><\/div>\n\n\n\n

    You can call your folder whatever you want. This doesn't need to be unique across all of Amazon S3 like Buckets do.<\/p>\n\n\n\n

    I like to use the domain name or the name of the site for the folder name.<\/p>\n\n\n\n

    Click \"Save\" when you're done.<\/p>\n\n\n\n

    \"\"<\/figure><\/div>\n\n\n\n

    You'll be returned to the list of the buckets in the folder.<\/p>\n\n\n\n

    The links above the tabs (in this screen \"Amazon S3\" and \"mikedemobackups\") are how you navigate through the Bucket and Folder structure in S3.<\/p>\n\n\n\n

    \"\"<\/figure><\/div>\n\n\n\n

    Create an Access Policy<\/h2>\n\n\n\n

    Now that we have the location for the backup setup, it's time to setup how the website is going to access it.<\/p>\n\n\n\n

    In your Amazon Management Console, navigate to IAM<\/em>.<\/p>\n\n\n\n

    IAM stands for Identity and Access Management<\/em>. It's the process Amazon uses to handle who can login to what and what they can do while in there.<\/p>\n\n\n\n

    \"\"<\/figure><\/div>\n\n\n\n

    Select Policies<\/em> and then \"Create policy\".<\/p>\n\n\n\n

    \"\"<\/figure><\/div>\n\n\n\n

    Under Service<\/em>, type \"s3\" to filter for S3. Then click S3<\/em>.<\/p>\n\n\n\n

    We're going to use the Visual Editor<\/em> to create this Policy. Scroll down if you prefer to do it by JSON.<\/p>\n\n\n\n

    \"\"<\/figure><\/div>\n\n\n\n

    Under Actions<\/em>, we set what this account can do.<\/p>\n\n\n\n

    The next few steps will apply to most WordPress Backup plugins.<\/p>\n\n\n\n

    If you get \"Insufficient Access\" errors, or something similar, this is where you'll make changes. You can come back and edit this policy later if it doesn't allow what you need.<\/p>\n\n\n\n

    Under List, select ListBucket<\/em>.<\/p>\n\n\n\n

    \"\"<\/figure><\/div>\n\n\n\n

    Under Read, select:<\/p>\n\n\n\n