Cloud:Storage:CreateS3Credentials

From ZeroOne Tech Public Wiki
Revision as of 02:02, 9 April 2025 by Thefathacker (talk | contribs) (Updated Setup Guide)

OpenStack S3 - Generate S3 Credentials

This guide is to provide instructions to allow you to generate S3 Credentials for Later use

Requirements:

  • Python3
  • Python3-pip or apt with python package Management
  • Python3 Openstack Client
  • bash (Windows Users: Git Bash)

Environment Preparation

To prepare your environment you will need to setup the required software packages for your given operating system

Install Required Packages

Linux

Ubuntu/Debian (and forks)

apt install python3 python3-openstackclient

Alternatively if you are using pip for python package management apt install python3 python3-pip pip install python-openstackclient

Fedora (or EL Based Distributions)

for dnf users: dnf install python3 python3-pip

for yum users: yum install python3 python3-pip

pip install python-openstackclient

MacOS

TODO CONFIRM HOW TO SETUP Python on Windows

Windows

Install Required Packages

If you use Chocolatey: choco install python3 git.install

With python & python-pip installed, in a new PowerShell or CMD Terminal pip install python-openstackclient

Importing Openstack Environmental Varibles

  1. Download your OpenStack Environmental Variables file (OpenStack RC File), do this by logging into your Openstack Dashboard, navigating to the top right corner user icon/label and download your OpenStack RC File
  2. Open your preferred bash shell (or Git Bash on Windows) and nativate to where ever the download OpenStack RC File. Example:
    cd ~/Downloads
    to navigate to your Downloads File
  3. Use the downloaded Openstack RC file for Source Data by using the source command, example:
    source 3a5c8-default-openrc.sh
    you will then be asked for your openstack password
  4. Test your credentials now work run
    openstack image list
    which will query the available server images in ZWS

Credential Management

Generate New Credential

Use the following command to generate a new credential

openstack ec2 credentials create

Which will give you output similar too:

+------------+-------------------------------------------------------------------------------------------------------------------------------------------+
| Field      | Value                                                                                                                                     |
+------------+-------------------------------------------------------------------------------------------------------------------------------------------+
| access     | abababababababababababababababab                                                                                                          |
| links      | {'self': 'https://cloud.zeroone.tech:5000/v3/users/dededededededededededededededede/credentials/OS-EC2/abababababababababababababababab'} |
| project_id | bcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbc                                                                                                          |
| secret     | cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd                                                                                                          |
| trust_id   | None                                                                                                                                      |
| user_id    | dededededededededededededededede                                                                                                          |
+------------+-------------------------------------------------------------------------------------------------------------------------------------------+

The important value which will be unrecoverable after this point will be the secret. Also take note of the access as this will also be required for provisioning services with the S3 compatible API.

Get Existing Credentials

Use the following command to get your existing Credentails

openstack ec2 credentials list

IMPORTANT NOTE: Please note there is only one EC2 credential per user tenant, re-creating this credential will replace the credential and any services using this credential being lost.