Skip to content

User Authentication

Introduction

Users in Switch Cloud S3 (SCS3) need to authenticate their requests to perform S3 queries. We Support AWS SigV4 and allow SigV2 with exceptions for legacy software.

Project/S3 Instance creation

When the Switch Cloud Portal (SCP) creates an SCS3 instance, it automatically creates a corresponding S3 account in the backend.

  • An S3 project is tied to an AWS-style account
  • A main user with admin priviledges is created along with the account
  • Operations from the UI affect only the main user of the account
    • You must use the API to interact with the other users of the account
    • We are planning a management UI in the future
  • The only thing access keys can do is identify a user
    • Different keys on the same user only provide different ways to authenticate to the S3 API
    • Permissions are granted on users via IAM or bucket Policies
  • Any new user created manually (excluding STS) will not have any permissions to interact with S3
  • If read-only access is required, you can create a group, attach a readonly policy to it and add users to that group.

Prerequisites

  • Obtain S3 access keys through SCP. Remember that each project has it's own unique keys.
  • One of the S3 compatible CLI clients.

Tool Configuration

There are two options to configure your AWS CLI client with credentials obtained from SCP to your SCS3 project:

  1. AWS Configuration File

    By default, AWS CLI uses a the $HOME/.aws/credentials configuration file. In this file you can create a profile with credentials. See the content of the example configuration file below.

    [my_project_main_user]
    endpoint_url = https://<e.g. zhw-b.s3.cloud.switch.ch>
    region = ch
    aws_access_key_id = <your user's access key>
    aws_secret_access_key = <your user's secret key>
    

    After creating a profile you will be able to perform actions on your SCS3 bucket using the --profile flag in your CLI commands.

    For example you may use the created profile my_project_main_user in order to create a new bucket:

    aws --profile my_project_main_user s3 mb s3://<your_bucket_name>
    

    You may also set an environment variable to skip the --profile flag:

    export AWS_PROFILE=my_project_main_user
    

    Then you may directly do:

    aws s3 mb s3://<your_bucket_name>
    

  2. Environment Variables

    Set the environment variables with credentials to your SCS3 project.

    export AWS_ENDPOINT_URL=https://<e.g. zhw-b.s3.cloud.switch.ch>
    export AWS_REGION=ch
    export AWS_ACCESS_KEY_ID=<your user access key>
    export AWS_SECRET_ACCESS_KEY=<your user secret key>
    

    When configuration is set via environment variables, you can drop --profile flag in your CLI commands.

    Example:

    aws s3 mb s3://<your_bucket_name>
    

By default Rclone uses the $HOME/.config/rclone/rclone.conf configuration file. In this file you can create a profile with credentials which is similar to the AWS configuration. See the content of the example configuration file below.

[<s3_profile>]
type = s3
provider = Ceph
endpoint = https://<e.g. zhw-b.s3.cloud.switch.ch>
access_key_id = <your user access key>
secret_access_key = <your user secret key>

Example CLI command:

rclone mkdir <s3_profile>:<your_bucket_name>