• Is there any way to remove the Everyone Read policy when a new file gets uploaded?
    I have my CloudFront set to only allow access from the CloudFront distribution, but the files are also accessible via S3 because when they get uploaded Offload Media is adding a Everyone Read policy which I don’t want.

    Is there any way to remove that?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter GeddeDev

    (@ggedde)

    OK, the best way I found was to add this filter in my functions.php

    add_filter('as3cf_upload_acl', function($acl){
    	return '';
    });

    You will also need to do for resized images:

    add_filter('as3cf_upload_acl_sizes', function($acl){
    	return '';
    });

    Please let me know if that is the best method or if there is another preferred way.

    It seems that the default is ‘public-read’. ‘private’ is AWS default, but setting it to private causes Offline Media to add Authentication to the urls instead of following the domain I set in the config. Setting it to blank seems to do the trick.

    PS, I could not find any documentation on this method. I had to scan through the plugin code. Would be nice to have some documentation on that and other Hooks and Filters.

    Would be nice if this was just a setting in the Admin Panel.

    Thanks

    • This reply was modified 6 years, 5 months ago by GeddeDev.
    • This reply was modified 6 years, 5 months ago by GeddeDev.
    Plugin Contributor ianmjones

    (@ianmjones)

    Tweaks plugin has info on the as3cf_upload_acl filter.

    I’ll pass on your request for better documentation and possible surfacing of the ACL into the plugin’s settings.

    Can you give a little more info on your config and how things work in your case when you use ” as the ACL, what kind of URL do you get?

    Thread Starter GeddeDev

    (@ggedde)

    The url is as expected with ” as the ACL.
    Having it as ‘public_read’ has the url as expected as well, but it just adds the Everyone read access on the S3 object, which I don’t want.

    Have it as ‘private’ does not add any permissions to the S3 Object which is good, but it changes the url in WP to include access keys.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Remove Everyone Read Policy’ is closed to new replies.