Showing posts with label S3. Show all posts
Showing posts with label S3. Show all posts

Friday, November 22, 2013

Install S3fs on Amazon Linux/Centos


S3f3 is FUSE-based file system backed by Amazon S3 which you can mount your S3 bucket to Linux machine.

Use cases:-
- Turn your backup folder to unlimited storage pool
- Serve as centralized media storage location for multiple servers.

Limitation:-
  • Objects size can only up to of 5GB.
  • You can't update part of an object. If you want to update 1 byte in a 1GB object you'll have to reupload the entire file.
Here's the installation steps:-
sudo yum groupinstall "Development Tools";
sudo yum install curl-devel libxml2-devel openssl-devel mailcap

cd ~;
wget http://downloads.sourceforge.net/project/fuse/fuse-2.X/2.9.3/fuse-2.9.3.tar.gz;
tar -xzvf fuse-2.9.3.tar.gz;
cd fuse-2.9.3;

./configure --prefix=/usr;
make;
sudo make install;
sudo ldconfig;
export PKG_CONFIG_PATH=/usr/lib/pkgconfig;
#Verify version
#pkg-config --modversion fuse

cd~;
wget http://s3fs.googlecode.com/files/s3fs-1.73.tar.gz;
tar -xzvf s3fs-1.73.tar.gz;
cd s3fs-1.73;
./configure --prefix=/usr;
make;
sudo make install;


vi /etc/passwd-s3fs
chmod 600 /etc/passwd-s3fs


mount s3fs [bucketname] ~/s3bucket
umount: fusermount -u ~/s3bucket

mount on boot
s3fs#s3bucket /mnt/s3bucket fuse allow_other,use_cache=/tmp 0 0


Sources: http://kisdigital.wordpress.com/2011/08/04/installing-s3fs-on-rhelcentos/
http://www.idevelopment.info/data/AWS/AWS_Tips/AWS_Management/AWS_20.shtml
http://www.turnkeylinux.org/blog/exploring-s3-based-filesystems-s3fs-and-s3backer

S3fs Home
Fuse Home

Tuesday, April 9, 2013

AWS - S3 - Apply bucket policy for public read and office IP read and write


Here's the sample S3 Bucket policy when you have a pulic read bucket but only restrict write/update access to office network

If you enable everyone list your bucket from permission menu, everyone could grep the whole list of our bucket object by browsing your root domain url 



 {
  "Id": "Policy1346919974114",
  "Statement": [
    {
      "Sid": "Stmt1346917860156",
      "Action": "s3:*",
      "Effect": "Allow",
      "Resource": "arn:aws:s3:::origin-pdf.domain.com/*",
      "Condition": {
        "IpAddress": {
          "aws:SourceIp": [
            "110.174.240.29/26",
            "175.143.152.282/32"
          ]
        }
      },
      "Principal": {
        "AWS": [
          "*"
        ]
      }
    },
    {
      "Sid": "Stmt1346919900506",
      "Action": [
        "s3:GetObject"
      ],
      "Effect": "Allow",
      "Resource": "arn:aws:s3:::origin-pdf.domain.com/*",
      "Principal": {
        "AWS": [
          "*"
        ]
      }
    }
  ]
}