•  Home
  •  Dashboard
  •  Company
    • About Us
    • Blog
    • Careers
    • Contact Us
    • Data Centers
    • Looking Glass
    • Network
    • Reseller
  •  Hosting Services
    • Infrastructure
      • iColocation
    • Compute
      • cMetal
      • cVirtual
    • Storage
      • sObject
      • sBlock
    • Networking
      • nIP Transit
      • nWavelength
    • Protection
      • pBackup
      • pDDoS
  •  Solutions
    • Ecommerce
    • Finance
    • Gaming
    • Hosting
    • Management
    • Security
    • System Integrator
  •  Support
    • Community
    • Knowledge Base
    • Open A Ticket
    • Status
  •  USA & Canada: 800-933-1517
  •  International: 626-549-2801
  •  Email: sales@psychz.net
  • Services
    • new-colocation-header-img
      Infrastructure
      • iColocation
    • new-compute-header-img
      Compute
      • cMetal
      • cVirtual
    • new-storage-header-img
      Storage
      • sObject
      • sBlock
    • new-networking-header-img
      Networking
      • nIP Transit
      • nWavelength
    • new-protection-header-img
      Protection
      • pBackup
      • pDDoS
  • Solutions
    • Ecommerce
    • Security
    • Gaming
    • Hosting
    • Management
    • Finance
    • System Integrator
  • Dashboard

sObject – Bucket Policy Examples

  • Home
  • Client
  • Knowledgebase
  • Storage
  • sObject
  • sObject – Bucket Policy Examples

Table Of Content

    Related Articles

    • sObject – Sub-User Permissions
    • s3Express Guide
    • sObject - Javascript Examples
    • sObject - PHP Examples
    • sObject - Python Examples
    • sObject - Configuring CORS and Bucket Policies Using S3 Browser
    • sObject - SSE (Server Side Encryption) Guide
    • sObject - CNAME Guide
    • sObject - CrossFTP Guide
    • sObject - WinSCP Guide
    • sObject - S3 Browser Guide
    • sObject - Keys
    • sObject - Buckets
    • sObject - Access Using S3tools
    • sObject - Limits and Best Practices
    • sObject - Delete
    • sObject - Intro
    • sObject - Create

    sObject – Bucket Policy Examples

    Publisher: Psychz Networks August 08,2025

    A bucket policy is a JSON document that tells sObject who can perform what action where and, optionally, under which conditions. Bucket policy can be applied with the open-source CLI tool shown below. The syntax follows the Amazon S3 format, so you can copy any example and just swap in your own names.

    Policy Structure Recap

    • Version – keep it "2012-10-17" for maximum compatibility.
    • Statement – an array of one or more permission blocks.
    • Each block contains Effect (Allow or Deny), Principal (who), Action (what), Resource (where) and optional Condition.

    Ready-Made Policies

    Public Read-Only
    Perfect for static-website or CDN buckets.

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "PublicReadGetObject",
          "Effect": "Allow",
          "Principal": "*",
          "Action": "s3:GetObject",
          "Resource": "arn:aws:s3:::BUCKET-NAME/*"
        }
      ]
    }

    Private Bucket for Selected Sub-Users

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "AllowTeamRW",
          "Effect": "Allow",
          "Principal": {
            "AWS": [
              "urn:scoped-user:USER-ID:SUBUSER-A",
              "urn:scoped-user:USER-ID:SUBUSER-B"
            ]
          },
          "Action": [
            "s3:GetObject",
            "s3:PutObject",
            "s3:DeleteObject",
            "s3:ListBucket"
          ],
          "Resource": [
            "arn:aws:s3:::BUCKET-NAME",
            "arn:aws:s3:::BUCKET-NAME/*"
          ]
        }
      ]
    }

    IP-Restricted Access

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "AllowFromOffice",
          "Effect": "Allow",
          "Principal": "*",
          "Action": "s3:*",
          "Resource": [
            "arn:aws:s3:::BUCKET-NAME",
            "arn:aws:s3:::BUCKET-NAME/*"
          ],
          "Condition": {
            "IpAddress": {
              "aws:SourceIp": [
                "203.0.113.0/24",
                "198.51.100.25/32"
              ]
            }
          }
        }
      ]
    }

    Write-Only “Drop Box”

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "WriteOnly",
          "Effect": "Allow",
          "Principal": "*",
          "Action": [
            "s3:PutObject",
            "s3:AbortMultipartUpload"
          ],
          "Resource": "arn:aws:s3:::BUCKET-NAME/*"
        },
        {
          "Sid": "DenyReads",
          "Effect": "Deny",
          "Principal": "*",
          "Action": [
            "s3:GetObject",
            "s3:ListBucket"
          ],
          "Resource": [
            "arn:aws:s3:::BUCKET-NAME",
            "arn:aws:s3:::BUCKET-NAME/*"
          ]
        }
      ]
    }

    Enforce HTTPS Only

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "DenyInsecure",
          "Effect": "Deny",
          "Principal": "*",
          "Action": "s3:*",
          "Resource": [
            "arn:aws:s3:::BUCKET-NAME",
            "arn:aws:s3:::BUCKET-NAME/*"
          ],
          "Condition": {
            "Bool": { "aws:SecureTransport": "false" }
          }
        }
      ]
    }

    Tips & Troubleshooting

    • Replace every placeholder such as <em>BUCKET-NAME</em> and user IDs with real values.
    • After saving, test the new rules with curl or your SDK to confirm the behaviour.
    • Policies are evaluated in this order: all Deny statements first, then Allow; a single explicit Deny overrides conflicting Allow.

    Setting a Policy with s3cmd

    Prefer working from your terminal? The open-source s3cmd utility can upload or retrieve bucket policies in seconds.

    1. Install s3cmd (pip install s3cmd or use your package manager).
    2. Run s3cmd --configure and enter your access key, secret key, and the sObject endpoint URL.
    3. Save your JSON policy as policy.json.
    4. Upload the policy:
      s3cmd setpolicy policy.json s3://BUCKET-NAME
    5. Verify the current policy:
      s3cmd info s3://BUCKET-NAME  (look for the “Policy:” section).

    Note: The access key you use must belong to a sub-user (or main account) with Full permissions on the target bucket; otherwise, the upload will be denied.

    Frequently Asked Questions

    1. Will a bucket policy override sub-user permissions?
      Yes. The policy is evaluated in addition to the sub-user’s flag; the most restrictive rule wins.
    2. Can I attach multiple policies?
      A bucket holds one JSON document. Combine multiple statements in the same file.
    Views: (1286) Votes: (0)

    Related Articles

    • sObject – Sub-User Permissions
    • s3Express Guide
    • sObject - Javascript Examples
    • sObject - PHP Examples
    • sObject - Python Examples
    • sObject - Configuring CORS and Bucket Policies Using S3 Browser
    • sObject - SSE (Server Side Encryption) Guide
    • sObject - CNAME Guide
    • sObject - CrossFTP Guide
    • sObject - WinSCP Guide
    • sObject - S3 Browser Guide
    • sObject - Keys
    • sObject - Buckets
    • sObject - Access Using S3tools
    • sObject - Limits and Best Practices
    • sObject - Delete
    • sObject - Intro
    • sObject - Create
    Copyright © 2026 Psychz Networks,
    A Profuse Solutions Inc Company
    Hosting Services
    • Catalog
    Infrastructure
    • iColocation
    Compute
    • cMetal
    • cVirtual
    Storage
    • sObject
    • sBlock
    Networking
    • nIP Transit
    • nWavelength
    Protection
    • pBackup
    • pDDoS
    Company
    • About Us
    • Blog
    • Careers
    • Contact Us
    • Data Centers
    • Looking Glass
    • Network
    • Reseller
    Policies
    • Acceptable Usage Policy
    • Privacy Policy
    • Service Level Agreement
    • Terms and Conditions
    Support
    • Community
    • Knowledge Base
    • Open A Ticket
    • Status
    Get In Touch
    • Psychz Networks,
      A Profuse Solutions Company
      611 Wilshire Blvd #300
      Los Angeles,California 90017
      USA
    • US/Canada: 800-933-1517
    • International: 626-549-2801