OpenShift Container Storage is now OpenShift Data Foundation starting with version 4.9.
Chapter 5. Changing the default account credentials to ensure better security in the Multicloud Object Gateway
Change and rotate your Multicloud Object Gateway (MCG) account credentials using the command-line interface to prevent issues with applications, and to ensure better account security.
Prerequisites
- A running OpenShift Data Foundation Platform.
Download the Multicloud Object Gateway (MCG) command-line interface for easier management:
subscription-manager repos --enable=rh-odf-4-for-rhel-8-x86_64-rpms
# subscription-manager repos --enable=rh-odf-4-for-rhel-8-x86_64-rpms
Copy to Clipboard Copied! Toggle word wrap Toggle overflow yum install mcg
# yum install mcg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantSpecify the appropriate architecture for enabling the repositories using the subscription manager.
For IBM Power, use the following command:
subscription-manager repos --enable=rh-odf-4-for-rhel-8-ppc64le-rpms
# subscription-manager repos --enable=rh-odf-4-for-rhel-8-ppc64le-rpms
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For IBM Z infrastructure, use the following command:
subscription-manager repos --enable=rh-odf-4-for-rhel-8-s390x-rpms
# subscription-manager repos --enable=rh-odf-4-for-rhel-8-s390x-rpms
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Alternatively, you can install the MCG package from the OpenShift Data Foundation RPMs found at Download RedHat OpenShift Data Foundation page.
ImportantChoose the correct Product Variant according to your architecture.
5.1. Resetting the noobaa account password Copy linkLink copied to clipboard!
Procedure
To reset the noobaa account password, run the following command:
noobaa account passwd <noobaa_account_name> [options]
$ noobaa account passwd <noobaa_account_name> [options]
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example:
noobaa account passwd admin@noobaa.io
$ noobaa account passwd admin@noobaa.io
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantTo access the admin account credentials run the
noobaa status
command from the terminal:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
5.2. Regenerating the S3 credentials for the accounts Copy linkLink copied to clipboard!
Procedure
Get the account name.
For listing the accounts, run the following command:
noobaa account list
$ noobaa account list
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output:
NAME ALLOWED_BUCKETS DEFAULT_RESOURCE PHASE AGE account-test [*] noobaa-default-backing-store Ready 14m17s test2 [first.bucket] noobaa-default-backing-store Ready 3m12s
NAME ALLOWED_BUCKETS DEFAULT_RESOURCE PHASE AGE account-test [*] noobaa-default-backing-store Ready 14m17s test2 [first.bucket] noobaa-default-backing-store Ready 3m12s
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Alternatively, run the
oc get noobaaaccount
command from the terminal:oc get noobaaaccount
$ oc get noobaaaccount
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output:
NAME PHASE AGE account-test Ready 15m test2 Ready 3m59s
NAME PHASE AGE account-test Ready 15m test2 Ready 3m59s
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To regenerate the noobaa account S3 credentials, run the following command:
noobaa account regenerate <noobaa_account_name> [options]
$ noobaa account regenerate <noobaa_account_name> [options]
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Once you run the
noobaa account regenerate
command it will prompt a warning that says "This will invalidate all connections between S3 clients and NooBaa which are connected using the current credentials.", and ask for confirmation:Example:
noobaa account regenerate account-test
$ noobaa account regenerate account-test
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output:
INFO[0000] You are about to regenerate an account's security credentials. INFO[0000] This will invalidate all connections between S3 clients and NooBaa which are connected using the current credentials. INFO[0000] are you sure? y/n
INFO[0000] You are about to regenerate an account's security credentials. INFO[0000] This will invalidate all connections between S3 clients and NooBaa which are connected using the current credentials. INFO[0000] are you sure? y/n
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On approving, it will regenerate the credentials and eventually print them:
INFO[0015] ✅ Exists: Secret "noobaa-account-account-test" Connection info: AWS_ACCESS_KEY_ID : *** AWS_SECRET_ACCESS_KEY : ***
INFO[0015] ✅ Exists: Secret "noobaa-account-account-test" Connection info: AWS_ACCESS_KEY_ID : *** AWS_SECRET_ACCESS_KEY : ***
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
5.3. Regenerating the S3 credentials for the OBC Copy linkLink copied to clipboard!
Procedure
To get the OBC name, run the following command:
noobaa obc list
$ noobaa obc list
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output:
NAMESPACE NAME BUCKET-NAME STORAGE-CLASS BUCKET-CLASS PHASE default obc-test obc-test-35800e50-8978-461f-b7e0-7793080e26ba default.noobaa.io noobaa-default-bucket-class Bound
NAMESPACE NAME BUCKET-NAME STORAGE-CLASS BUCKET-CLASS PHASE default obc-test obc-test-35800e50-8978-461f-b7e0-7793080e26ba default.noobaa.io noobaa-default-bucket-class Bound
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Alternatively, run the
oc get obc
command from the terminal:oc get obc
$ oc get obc
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output:
NAME STORAGE-CLASS PHASE AGE obc-test default.noobaa.io Bound 38s
NAME STORAGE-CLASS PHASE AGE obc-test default.noobaa.io Bound 38s
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To regenerate the noobaa OBC S3 credentials, run the following command:
noobaa obc regenerate <bucket_claim_name> [options]
$ noobaa obc regenerate <bucket_claim_name> [options]
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Once you run the
noobaa obc regenerate
command it will prompt a warning that says "This will invalidate all connections between the S3 clients and noobaa which are connected using the current credentials.", and ask for confirmation:Example:
noobaa obc regenerate obc-test
$ noobaa obc regenerate obc-test
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output:
INFO[0000] You are about to regenerate an OBC's security credentials. INFO[0000] This will invalidate all connections between S3 clients and NooBaa which are connected using the current credentials. INFO[0000] are you sure? y/n
INFO[0000] You are about to regenerate an OBC's security credentials. INFO[0000] This will invalidate all connections between S3 clients and NooBaa which are connected using the current credentials. INFO[0000] are you sure? y/n
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On approving, it will regenerate the credentials and eventually print them:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow