1.2. 관리 수신 인증서 교체
OpenShift 기본 수신 인증서를 사용하지 않으려면 Kubernetes 경로를 업데이트하여 관리 수신 인증서를 교체할 수 있습니다.
1.2.1. 관리 수신 인증서를 교체하기 위한 사전 요구 사항 링크 복사링크가 클립보드에 복사되었습니다!
management-ingress 인증서 및 개인 키를 준비하고 준비합니다. 필요한 경우 OpenSSL을 사용하여 TLS 인증서를 생성할 수 있습니다. 인증서의CN(Common Name parameter)을 manangement-ingress 로 설정합니다. 인증서를 생성하는 경우 다음 설정을 포함합니다.
인증서 SAN(Subject Alternative Name) 목록에 Kubernetes용 Red Hat Advanced Cluster Management의 경로 이름을 도메인 이름으로 포함합니다.
다음 명령을 실행하여 경로 이름을 수신합니다.
oc get route -n open-cluster-management다음과 같은 응답을 받을 수 있습니다.
multicloud-console.apps.grchub2.dev08.red-chesterfield.com
1.2.1.1. 인증서를 생성하기 위한 설정 파일 예 링크 복사링크가 클립보드에 복사되었습니다!
다음 예제 설정 파일 및 OpenSSL 명령은 OpenSSL을 사용하여 TLS 인증서를 생성하는 방법에 대한 예제를 제공합니다. OpenSSL로 인증서를 생성하기 위한 구성 설정을 정의하는 다음 csr.cnf 구성 파일을 봅니다.
[ req ] # Main settings
default_bits = 2048 # Default key size in bits.
prompt = no # Disables prompting for certificate values so the configuration file values are used.
default_md = sha256 # Specifies the digest algorithm.
req_extensions = req_ext # Specifies the configuration file section that includes any extensions.
distinguished_name = dn # Specifies the section that includes the distinguished name information.
[ dn ] # Distinguished name settings
C = US # Country
ST = North Carolina # State or province
L = Raleigh # Locality
O = Red Hat Open Shift # Organization
OU = Red Hat Advanced Container Management # Organizational unit
CN = management-ingress # Common name.
[ req_ext ] # Extensions
subjectAltName = @alt_names # Subject alternative names
[ alt_names ] # Subject alternative names
DNS.1 = multicloud-console.apps.grchub2.dev08.red-chesterfield.com
[ v3_ext ] # x509v3 extensions
authorityKeyIdentifier=keyid,issuer:always # Specifies the public key that corresponds to the private key that is used to sign a certificate.
basicConstraints=CA:FALSE # Indicates whether the certificate is a CA certificate during the certificate chain verification process.
#keyUsage=keyEncipherment,dataEncipherment # Defines the purpose of the key that is contained in the certificate.
extendedKeyUsage=serverAuth # Defines the purposes for which the public key can be used.
subjectAltName=@alt_names # Identifies the subject alternative names for the identify that is bound to the public key by the CA.
참고: DNS.1 이라는 레이블이 지정된 SAN을 관리 인그레스에 올바른 호스트 이름으로 업데이트하십시오.
1.2.1.2. 인증서를 생성하기 위한 OpenSSL 명령 링크 복사링크가 클립보드에 복사되었습니다!
다음 OpenSSL 명령을 이전 구성 파일과 함께 사용하여 필요한 TLS 인증서를 생성합니다.
CA(인증 기관) RSA 개인 키를 생성합니다.
openssl genrsa -out ca.key 4096CA 키를 사용하여 자체 서명된 CA 인증서를 생성합니다.
openssl req -x509 -new -nodes -key ca.key -subj "/C=US/ST=North Carolina/L=Raleigh/O=Red Hat OpenShift" -days 400 -out ca.crt인증서에 사용할 RSA 개인 키를 생성합니다.
openssl genrsa -out ingress.key 4096개인 키를 사용하여 인증서 서명 요청(CSR)을 생성합니다.
openssl req -new -key ingress.key -out ingress.csr -config csr.cnfCA 인증서 및 키와 CSR을 사용하여 서명된 인증서를 생성합니다.
openssl x509 -req -in ingress.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out ingress.crt -sha256 -days 300 -extensions v3_ext -extfile csr.cnf인증서 내용을 검사합니다.
openssl x509 -noout -text -in ./ingress.crt
1.2.2. BYO(Bring Your Own) 수신 인증서 교체 링크 복사링크가 클립보드에 복사되었습니다!
BYO 수신 인증서를 교체하려면 다음 단계를 완료합니다.
인증서 및 개인 키를 사용하여
byo-ingress-tls시크릿을 생성합니다. 다음 명령을 실행합니다.oc -n open-cluster-management create secret tls byo-ingress-tls-secret --cert ./ingress.crt --key ./ingress.key다음 명령을 사용하여 보안이 올바른 네임스페이스에 생성되었는지 확인합니다.
oc get secret -n open-cluster-management | grep -e byo-ingress-tls-secret -e byo-ca-cert선택 사항: 다음 명령을 실행하여 CA 인증서가 포함된 보안을 생성합니다.
oc -n open-cluster-management create secret tls byo-ca-cert --cert ./ca.crt --key ./ca.key서브스크립션을 재배포하려면
management-ingress서브스크립션을 삭제합니다. 이전 단계에서 생성된 보안은 자동으로 사용됩니다. 다음 명령을 실행합니다.oc delete subscription management-ingress-sub -n open-cluster-management- 현재 인증서가 인증서이고 모든 콘솔 액세스 및 로그인 기능이 동일하게 유지되는지 확인합니다.
1.2.3. 관리 수신을 위한 기본 자체 서명 인증서 복원 링크 복사링크가 클립보드에 복사되었습니다!
다음 명령을 사용하여 자체 인증서 보안 가져오기를 삭제합니다.
oc delete secret byo-ca-cert byo-ingress-tls-secret -n open-cluster-management서브스크립션을 재배포하려면
management-ingress서브스크립션을 삭제합니다. 이전 단계에서 생성된 보안은 자동으로 사용됩니다. 다음 명령을 실행합니다.oc delete subscription management-ingress-sub -n open-cluster-management- 현재 인증서가 인증서이고 모든 콘솔 액세스 및 로그인 기능이 동일하게 유지되는지 확인합니다.
Red Hat Advanced Cluster Management에서 생성 및 관리하는 인증서에 대한 자세한 내용은 ScanSetting을 참조하십시오. ??? 클러스터 보안에 대한 자세한 내용은 위험 및 규정 준수 페이지로 돌아갑니다.