인스턴스 작성

IBM® Key Protect for IBM Cloud® 콘솔 또는 IBM Cloud CLI를 사용하여 IBM Cloud의 인스턴스를 작성할 수 있습니다.

개요

Key Protect에서 instance(때때로 service instance라고도 함)는 네임스페이스입니다.

네임스페이스는 키를 논리 그룹으로 구성하며 네임스페이스 간에 격리 및 보호를 제공합니다.

  • 예를 들어, 두 개의 Key Protect 인스턴스를 포함하도록 선택할 수 있습니다(하나는 재무 부서용이고 다른 하나는 제조용). 두 개의 인스턴스는 격리를 제공하므로 한 비즈니스 단위에서 다른 비즈니스 단위의 키에 액세스할 수 없습니다.

instance 이라는 용어는 가상 서버또는 VPC용 가상 서버 인스턴스와 같은 컴퓨팅 리소스를 설명하는 데 사용되기도 합니다 Key Protect의 인스턴스를 컴퓨팅 리소스와 동일하게 생각해서는 안됩니다. A Key Protect 인스턴스는 네임스페이스입니다.

IBM Cloud 콘솔에서 Key Protect 표준 또는 전용 인스턴스 프로비저닝하기

Key Protect 콘솔에서 IBM Cloud의 인스턴스를 프로비저닝하려면 다음 단계를 완료하십시오.

  1. IBM Cloud 계정에 로그인하십시오.

  2. 카탈로그를 클릭하여 다음에서 사용 가능한 서비스 목록을 확인하십시오. IBM Cloud.

  3. 카탈로그 검색... 필드에서 " Key Protect "를 검색하고 Key Protect 을 클릭합니다.

  4. 표준 또는 전용 요금제를 선택하고 만들기를 클릭하여 로그인한 계정, 지역 및 리소스 그룹에서 Key Protect 인스턴스를 프로비저닝합니다. 가격에 대한 자세한 정보는 IBM Cloud 의 Key Protect 가격 페이지를 참조하세요.

여러 계정이나 환경에서 동일한 설정을 반복해야 하는 경우, 선별된 Terraform IBM 모듈을 사용하여 자동화할 수 있습니다. Key Protect 올인클루시브 모듈은 키 및 키 링과 함께 인스턴스를 프로비저닝할 수 있는 옵션 중 하나입니다. 개요는 Terraform IBM 모듈을 참조하세요.

Key Protect CLI에서 IBM Cloud 프로비저닝

Key Protect CLI를 사용하여 IBM Cloud의 인스턴스를 프로비저닝할 수도 있습니다.

다음 예제에서는 tiered-pricing 계획을 사용하지만, 추가적인 페일오버 지원을 제공하는 cross-region-resiliency 계획을 사용하여 선택한 지역에 리소스를 배치할 수도 있습니다. 이 플랜을 이용할 수 있는 지역은 미국 달라스에 위치한 us-south, 일본 도쿄에 위치한 jp-tok, 독일 프랑크푸르트에 위치한 eu-de 입니다. 이 플랜을 다른 지역에 배포하는 데 사용할 수 없습니다.

CLI를 사용하여 로그인

IBM Cloud에 IBM Cloud CLI. 이는 다음의 인스턴스에 사용되는 계정입니다. Key Protect.

로그인

login 명령을 사용하여 로그인하십시오. 실패하는 경우 --sso 옵션을 시도하여 연합 ID로 로그인해야 합니다(다음 절 참조).

이메일 주소가 연합 ID에 속하기 때문에 이 예제는 실패합니다.

ibmcloud login

$ ibmcloud login
API endpoint: https://cloud.ibm.com
Region: us-south

Email> <email address>

Password>
Authenticating...
You are using a federated user ID, please use one time passcode ( ibmcloud login --sso ), or use API key ( ibmcloud --apikey key or @key_file ) to authenticate.

API endpoint:   https://cloud.ibm.com
Region:         us-south
Not logged in.
FAILED

연합 ID를 사용하여 로그인

--sso 옵션을 사용하여 로그인하면 브라우저 창(로그인이 필요함)이 열리고 일회성 패스코드가 작성됩니다. 패스코드는 로그인 프로세스를 완료하는 데 사용됩니다.

ibmcloud login --sso

$ ibmcloud login --sso
API endpoint: https://cloud.ibm.com
Region: us-south

Get One Time Code from https://identity-2.us-south.iam.cloud.ibm.com/identity/passcode to proceed.
Open the URL in the default browser? [Y/n] > Y
One Time Code > <paste the one-time passcode from your browser>
Authenticating...
OK

Select an account:
1. Account name (ea988d3289c24739a0977651b46fb145)
Enter a number> 1
Targeted account Account name (ea988d3289c24739a0977651b46fb145)

API endpoint:      https://cloud.ibm.com
Region:            us-south
User:              <email address>
Account:           Account name (ea988d3289c24739a0977651b46fb145)
Resource group:    No resource group targeted, use 'ibmcloud target -g RESOURCE_GROUP'
CF API endpoint:
Org:
Space:

지역 및 리소스 그룹 선택

다음 인스턴스를 작성하려는 지역 및 리소스 그룹을 선택하십시오. Key Protect 인스턴스에 저장되는 루트 키를 사용하십시오.

<resource_group_name>은(는) Default(대소문자 구분)일 수 있습니다.

ibmcloud target -r <region_name> -g <resource_group_name>

$ ibmcloud target -r us-south -g Default
Targeted resource group Default

Switched to region us-south

API endpoint:      https://cloud.ibm.com
Region:            us-south
User:              <email address>
Account:           Account name (ea988d3289c24739a0977651b46fb145)
Resource group:    Default
CF API endpoint:
Org:
Space:

공용 인스턴스 프로비저닝

공용 Key Protect 인스턴스를 프로비저닝하십시오. 다음 절에 private 인스턴스를 프로비저닝하는 예가 있습니다.

  • 공용 엔드포인트는 IBM Cloud의 외부에 있습니다.

  • 개인용 엔드포인트는 IBM Cloud의 내부에 있습니다.

공용 인스턴스는 public and private 엔드포인트 모두의 API 요청을 수락합니다. 공용 네트워크 액세스가 기본 설정이며 정책이 설정되지 않은 경우에 사용됩니다.

사설 인스턴스는 private 엔드포인트의 API 요청만 수락합니다.

공용 및 사설 액세스에 대해 자세히 알아보려면 네트워크 액세스 정책 관리를 참조하십시오.

참고: GUID는 인스턴스 ID입니다. 이 예제에서 인스턴스 ID는 ea557753-a15b-4570-a9a3-1efefbd2d382.

ibmcloud resource service-instance-create <instance_name> kms tiered-pricing <region>

# create a public service instance
$ ibmcloud resource service-instance-create <instance_name> kms tiered-pricing us-south
Creating service instance <instance_name> in resource group Default of account <account name> as <email address>...
OK
Service instance <instance_name> was created.

Name:             <instance_name>
ID:               crn:v1:bluemix:public:kms:us-south:a/ea988d3289c24739a0977651b46fb145:ea557753-a15b-4570-a9a3-1efefbd2d382::
GUID:             ea557753-a15b-4570-a9a3-1efefbd2d382
Location:         us-south
State:            active
Type:             service_instance
Sub Type:         kms
Allow Cleanup:    false
Locked:           false
Created at:       2020-05-31T15:04:50Z
Updated at:       2020-05-31T15:04:50Z
Last Operation:
                  Status    create succeeded
                  Message   Completed create instance operation

# list the service instances
$ ibmcloud resource service-instances
Retrieving instances with type service_instance in resource group Default in all locations under account <account name> as <email address>...
OK
Name                 Location   State    Type
<instance_name>      us-south   active   service_instance

# delete the public service instance
$ ibmcloud resource service-instance-delete <instance_name>
Deleting service instance <instance_name> in resource group Default under account <account name> as <email address>...
Really delete the service instance <instance_name> with ID crn:v1:bluemix:public:kms:us-south:a/ea988d3289c24739a0977651b46fb145:ea557753-a15b-4570-a9a3-1efefbd2d382::? [y/N] > y
OK
Service instance <instance_name> with ID crn:v1:bluemix:public:kms:us-south:a/ea988d3289c24739a0977651b46fb145:ea557753-a15b-4570-a9a3-1efefbd2d382:: is deleted successfully

사설 인스턴스 프로비저닝

사설 Key Protect 인스턴스를 프로비저닝하십시오.

사설 인스턴스는 IBM Cloud 내부에 있는 개인용 엔드포인트의 API 요청만 수락합니다. 다음의 외부에 있는 경우 개인용 인스턴스와 함께 CLI를 사용할 수 없습니다. IBM Cloud.

ibmcloud resource service-instance-create <instance_name> kms tiered-pricing <region> -p '{"allowed_network": "private-only"}'

사설 인스턴스가 작성된 후 키를 작성하기 위한 요청이 수행됩니다. 사용자에게 IBM Cloud 외부의 private 인스턴스에 대한 액세스 권한이 없으므로 요청이 실패합니다.

-p 옵션은 서비스 인스턴스를 작성하는 데 사용되는 매개변수의 JSON 파일 또는 JSON 문자열을 지정합니다.

# create a private service instance
$ ibmcloud resource service-instance-create <service-name> kms tiered-pricing us-south -p '{"allowed_network": "private-only"}'
Creating service instance <service-name> in resource group Default of account <account name> as <email address>...
OK
Service instance <service-name> was created.

Name:             <service-name>
ID:               crn:v1:bluemix:public:kms:us-south:a/ea988d3289c24739a0977651b46fb145:a152eee4-262e-4a39-ae13-a71b9882dcb6::
GUID:             a152eee4-262e-4a39-ae13-a71b9882dcb6
Location:         us-south
State:            active
Type:             service_instance
Sub Type:         kms
Allow Cleanup:    false
Locked:           false
Created at:       2020-05-31T15:10:23Z
Updated at:       2020-05-31T15:10:23Z
Last Operation:
                  Status    create succeeded
                  Message   Completed create instance operation

# list the service instances
$ ibmcloud resource service-instances
Retrieving instances with type service_instance in resource group Default in all locations under account <account name> as <email address>...
OK
Name                  Location   State    Type
<service-name>        us-south   active   service_instance

# list the private service instance
$ ibmcloud resource service-instance <service-name>
Retrieving service instance <service-name> in resource group Default under account <account name> as <email address>...
OK

Name:                  <service-name>
ID:                    crn:v1:bluemix:public:kms:us-south:a/ea988d3289c24739a0977651b46fb145:a152eee4-262e-4a39-ae13-a71b9882dcb6::
GUID:                  a152eee4-262e-4a39-ae13-a71b9882dcb6
Location:              us-south
Service Name:          kms
Service Plan Name:     tiered-pricing
Resource Group Name:   Default
State:                 active
Type:                  service_instance
Sub Type:              kms
Created at:            2020-05-31T15:10:23Z
Created by:            <email address>
Updated at:            2020-05-31T15:10:23Z
Last Operation:
                  Status    create succeeded
                  Message   Completed create instance operation

# list keys in the private service instance
$ ibmcloud kp keys -i a152eee4-262e-4a39-ae13-a71b9882dcb6
Retrieving keys...

FAILED

kp.Error: correlation_id='59578794-2b5b-48ca-9074-bbe23760d94a', msg='Unauthorized: The user does not have access to the specified resource'

# delete the private service instance
$ ibmcloud resource service-instance-delete <service-name>
Deleting service instance <service-name> in resource group Default under account <account name> as <email address>...
Really delete the service instance <service-name> with ID crn:v1:bluemix:public:kms:us-south:a/ea988d3289c24739a0977651b46fb145:a152eee4-262e-4a39-ae13-a71b9882dcb6::? [y/N] > y
OK
Service instance <service-name> with ID crn:v1:bluemix:public:kms:us-south:a/ea988d3289c24739a0977651b46fb145:a152eee4-262e-4a39-ae13-a71b9882dcb6:: is deleted successfully

기존 키를 포함하는 인스턴스 삭제

키를 포함하는 서비스 인스턴스는 삭제할 수 없습니다.

$ ibmcloud resource service-instance-delete <instance_name>
Deleting service instance <instance_name> in resource group Default under account <account name> as <email address>...
Really delete the service instance <instance_name> with ID crn:v1:bluemix:public:kms:us-south:a/ea988d3289c24739a0977651b46fb145:a152eee4-262e-4a39-ae13-a71b9882dcb6::? [y/N] > y
FAILED
Error Code: RC-ServiceBrokerErrorResponse
Message: [409, Conflict] Conflict: Instance contains 2 active keys. Remove all keys before de-provisioning

다음에 수행할 작업

프로그래밍 방식으로 키를 관리하는 방법에 대해 자세히 알아보려면 Key Protect API 참조 문서를 확인하세요