1.3. 기존 HTTPS 인증서를 위해 RHOSP 엔드포인트 스캔


OpenShift Container Platform 4.10부터 HTTPS 인증서에는 SAN(주체 대체 이름) 필드가 포함되어야 합니다. 다음 스크립트를 실행하여 RHOSP(Red Hat OpenStack Platform) 카탈로그에서 CommonName 필드만 포함된 레거시 인증서의 각 HTTPS 엔드포인트를 스캔합니다.

중요

OpenShift Container Platform은 설치 또는 업데이트 전에 기존 인증서의 기본 RHOSP 인프라를 확인하지 않습니다. 제공된 스크립트를 사용하여 이러한 인증서를 직접 확인합니다. 클러스터를 설치하거나 업데이트하기 전에 기존 인증서를 업데이트하지 않으면 클러스터 기능이 저하됩니다.

사전 요구 사항

프로세스

  1. 다음 스크립트를 머신에 저장합니다.

    #!/usr/bin/env bash
    
    set -Eeuo pipefail
    
    declare catalog san
    catalog="$(mktemp)"
    san="$(mktemp)"
    readonly catalog san
    
    declare invalid=0
    
    openstack catalog list --format json --column Name --column Endpoints \
    	| jq -r '.[] | .Name as $name | .Endpoints[] | select(.interface=="public") | [$name, .interface, .url] | join(" ")' \
    	| sort \
    	> "$catalog"
    
    while read -r name interface url; do
    	# Ignore HTTP
    	if [[ ${url#"http://"} != "$url" ]]; then
    		continue
    	fi
    
    	# Remove the schema from the URL
    	noschema=${url#"https://"}
    
    	# If the schema was not HTTPS, error
    	if [[ "$noschema" == "$url" ]]; then
    		echo "ERROR (unknown schema): $name $interface $url"
    		exit 2
    	fi
    
    	# Remove the path and only keep host and port
    	noschema="${noschema%%/*}"
    	host="${noschema%%:*}"
    	port="${noschema##*:}"
    
    	# Add the port if was implicit
    	if [[ "$port" == "$host" ]]; then
    		port='443'
    	fi
    
    	# Get the SAN fields
    	openssl s_client -showcerts -servername "$host" -connect "$host:$port" </dev/null 2>/dev/null \
    		| openssl x509 -noout -ext subjectAltName \
    		> "$san"
    
    	# openssl returns the empty string if no SAN is found.
    	# If a SAN is found, openssl is expected to return something like:
    	#
    	#    X509v3 Subject Alternative Name:
    	#        DNS:standalone, DNS:osp1, IP Address:192.168.2.1, IP Address:10.254.1.2
    	if [[ "$(grep -c "Subject Alternative Name" "$san" || true)" -gt 0 ]]; then
    		echo "PASS: $name $interface $url"
    	else
    		invalid=$((invalid+1))
    		echo "INVALID: $name $interface $url"
    	fi
    done < "$catalog"
    
    # clean up temporary files
    rm "$catalog" "$san"
    
    if [[ $invalid -gt 0 ]]; then
    	echo "${invalid} legacy certificates were detected. Update your certificates to include a SAN field."
    	exit 1
    else
    	echo "All HTTPS certificates for this cloud are valid."
    fi
  2. 스크립트를 실행합니다.
  3. 스크립트가 INVALID 로 보고하는 인증서를 SAN 필드가 포함된 인증서로 바꿉니다.
중요

OpenShift Container Platform 4.10을 설치하기 전에 기존 HTTPS 인증서를 모두 교체하거나 클러스터를 해당 버전으로 업데이트해야 합니다. 다음 메시지와 함께 기존 인증서가 거부됩니다.

x509: certificate relies on legacy Common Name field, use SANs instead

1.3.1. 기존 HTTPS 인증서를 수동으로 위해 RHOSP 끝점 스캔

OpenShift Container Platform 4.10부터 HTTPS 인증서에는 SAN(주체 대체 이름) 필드가 포함되어야 합니다. "기존 HTTPS 인증서로 RHOSP 끝점 스캔"에 나열된 사전 요구 사항 툴에 액세스할 수 없는 경우 다음 단계를 수행하여 공통Name 필드만 포함하는 레거시 인증서의 RHOSP(Red Hat OpenStack Platform) 카탈로그의 각 HTTPS 끝점을 스캔합니다.

중요

OpenShift Container Platform은 설치 또는 업데이트 전에 기존 인증서의 기본 RHOSP 인프라를 확인하지 않습니다. 이러한 인증서를 직접 확인하려면 다음 단계를 수행합니다. 클러스터를 설치하거나 업데이트하기 전에 기존 인증서를 업데이트하지 않으면 클러스터 기능이 저하됩니다.

프로세스

  1. 명령줄에서 다음 명령을 실행하여 RHOSP 공용 끝점의 URL을 확인합니다.

    $ openstack catalog list

    명령에서 반환하는 각 HTTPS 끝점의 URL을 기록합니다.

  2. 각 공용 엔드포인트에 대해 호스트와 포트를 기록해 둡니다.

    작은 정보

    스키마, 포트 및 경로를 제거하여 끝점의 호스트를 결정합니다.

  3. 각 끝점에 다음 명령을 실행하여 인증서의 SAN 필드를 추출합니다.

    1. 호스트 변수를 설정합니다.

      $ host=<host_name>
    2. 포트 변수를 설정합니다.

      $ port=<port_number>

    3. $ openssl s_client -showcerts -servername "$host" -connect "$host:$port" </dev/null 2>/dev/null \
          | openssl x509 -noout -ext subjectAltName

      X509v3 Subject Alternative Name:
          DNS:your.host.example.net

중요

x509: certificate relies on legacy Common Name field, use SANs instead
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.