이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 5. Securing 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.
5.1.1. Resetting the noobaa account password 링크 복사링크가 클립보드에 복사되었습니다!
Prerequisites
- A running OpenShift Data Foundation cluster.
- Download the Multicloud Object Gateway (MCG) command-line interface for easier management. For instructions, see Accessing the Multicloud Object Gateway with your applications.
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.ioCopy 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 statuscommand from the terminal:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
5.1.2. Regenerating the S3 credentials for the accounts 링크 복사링크가 클립보드에 복사되었습니다!
Prerequisites
- A running OpenShift Data Foundation cluster.
- Download the Multicloud Object Gateway (MCG) command-line interface for easier management. For instructions, see Accessing the Multicloud Object Gateway with your applications.
Procedure
Get the account name.
For listing the accounts, run the following command:
noobaa account list
$ noobaa account listCopy 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 3m12sCopy to Clipboard Copied! Toggle word wrap Toggle overflow Alternatively, run the
oc get noobaaaccountcommand from the terminal:oc get noobaaaccount
$ oc get noobaaaccountCopy 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 3m59sCopy 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 regeneratecommand 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-testCopy 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/nCopy 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.1.3. Regenerating the S3 credentials for the OBC 링크 복사링크가 클립보드에 복사되었습니다!
Prerequisites
- A running OpenShift Data Foundation cluster.
- Download the Multicloud Object Gateway (MCG) command-line interface for easier management. For instructions, see Accessing the Multicloud Object Gateway with your applications.
Procedure
To get the OBC name, run the following command:
noobaa obc list
$ noobaa obc listCopy 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 BoundCopy to Clipboard Copied! Toggle word wrap Toggle overflow Alternatively, run the
oc get obccommand from the terminal:oc get obc
$ oc get obcCopy 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 38sCopy 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 regeneratecommand 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-testCopy 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/nCopy 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
5.2. Enabling secured mode deployment for Multicloud Object Gateway 링크 복사링크가 클립보드에 복사되었습니다!
You can specify a range of IP addresses that should be allowed to reach the Multicloud Object Gateway (MCG) load balancer services to enable secure mode deployment. This helps to control the IP addresses that can access the MCG services.
You can disable the MCG load balancer usage by setting the disableLoadBalancerService variable in the storagecluster custom resource definition (CRD) while deploying OpenShift Data Foundation using the command line interface. This helps to restrict MCG from creating any public resources for private clusters and to disable the MCG service EXTERNAL-IP. For more information, see the Red Hat Knowledgebase article Install Red Hat OpenShift Data Foundation 4.X in internal mode using command line interface. For information about disabling MCG load balancer service after deploying OpenShift Data Foundation, see Disabling Multicloud Object Gateway external service after deploying OpenShift Data Foundation.
Prerequisites
- A running OpenShift Data Foundation cluster.
-
In case of a bare metal deployment, ensure that the load balancer controller supports setting the
loadBalancerSourceRangesattribute in the Kubernetes services.
Procedure
Edit the NooBaa custom resource (CR) to specify the range of IP addresses that can access the MCG services after deploying OpenShift Data Foundation.
oc edit noobaa -n openshift-storage noobaa
$ oc edit noobaa -n openshift-storage noobaaCopy to Clipboard Copied! Toggle word wrap Toggle overflow noobaa- The NooBaa CR type that controls the NooBaa system deployment.
noobaaThe name of the NooBaa CR.
For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow loadBalancerSourceSubnetsA new field that can be added under
specin the NooBaa CR to specify the IP addresses that should have access to the NooBaa services.In this example, all the IP addresses that are in the subnet 10.0.0.0/16 or 192.168.10.0/32 will be able to access MCG S3 and security token service (STS) while the other IP addresses are not allowed to access.
Verification steps
To verify if the specified IP addresses are set, in the OpenShift Web Console, run the following command and check if the output matches with the IP addresses provided to MCG:
oc get svc -n openshift-storage <s3 | sts> -o=go-template='{{ .spec.loadBalancerSourceRanges }}'$ oc get svc -n openshift-storage <s3 | sts> -o=go-template='{{ .spec.loadBalancerSourceRanges }}'Copy to Clipboard Copied! Toggle word wrap Toggle overflow