def SetBucketCorsPolicy(bucket, allowed_origins=('*',)):
  """Setup CORS rules for the bucket.

  :param bucket: The bucket on which we need to setup ACL
  :type bucket: boto3.S3Bucket
  :param allowed_origins: The allowed origins for the bucket CORS configurations
  :type allowed_origins: list | tuple
  :return: None
  :rtype: None
  """
  bucket.put_cors(cors_configuration={
    'CORSRules': [{
      'AllowedOrigins': allowed_origins,
      'AllowedMethods': ['GET', 'POST', 'HEAD', 'PUT'],
      'AllowedHeaders': ['*'],
    }]
  })
  # Returns the configured bucket
  return bucket