db.rotateCertificates()
정의
버전 5.0에 추가.
db.rotateCertificates(message)
또는 에
mongod
대해 현재 사용되는 TLSmongos
인증서 를 순환하여 구성 파일에정의된 이러한 인증서에 대해 업데이트된 값을 사용합니다.db.rotateCertificates(message) The
db.rotateCertificates()
method takes the following optional argument:Parameter유형설명message
문자열
선택적 서버가 로그 파일과 감사 파일에 기록하는 메시지입니다.
db.rotateCertificates()
메서드는rotateCertificates
명령을 래핑합니다.
호환성
이 메서드는 다음 환경에서 호스팅되는 배포에서 사용할 수 있습니다.
중요
이 명령은 MongoDB Atlas 클러스터에서 지원되지 않습니다. 모든 명령에 대한 Atlas 지원 에 대한 자세한 내용은 지원되지 않는 명령을 참조하세요.
MongoDB Enterprise: MongoDB의 구독 기반 자체 관리 버전
MongoDB Community: MongoDB의 소스 사용 가능 무료 자체 관리 버전
출력
The db.rotateCertificates()
method returns a document with
the following field:
필드 | 유형 | 설명 |
---|---|---|
| 부울 | 명령의 실행 상태를 포함합니다. 성공하면 |
행동
순환에는 다음 인증서가 포함됩니다.
CRL (Certificate Revocation List) files
(Linux 및 Windows 플랫폼에서)
이러한 인증서 중 하나 이상을 회전하려면 다음을 수행하세요.
다음 제약 조건에 유의하여 파일 시스템에서 회전하려는 인증서를 교체하세요.
새로운 각 인증서는 교체하는 인증서와 동일한 파일 이름 및 파일 경로를 가지고 있어야 합니다.
암호화된
TLS Certificate
를 회전하는 경우, 새 인증서의 암호는 이전 인증서의 암호(certificateKeyFilePassword
구성 파일 설정에 지정된 대로)와 같아야 합니다. 인증서 회전은 대화형 비밀번호 프롬프트를 지원하지 않습니다.
Run
db.rotateCertificates()
to rotate the certificates used by themongod
ormongos
instance.
인증서 회전이 발생하는 경우:
If you have configured OCSP
for your
deployment, the db.rotateCertificates()
method will also fetch
stapled OCSP responses during rotation.
The db.rotateCertificates()
method may be run on a running
mongod
or mongos
regardless of replication
status.
Only one instance of db.rotateCertificates()
or
rotateCertificates
may run on each mongod
or
mongos
process at a time. Attempting to initiate a second
instance while one is already running will result in an error.
인증서 파일이 잘못되었거나, 만료되었거나, 해지되었거나, 누락된 경우 인증서 회전이 실패하지만 기존 TLS 구성이 무효화되거나 실행 중인 mongod
또는 mongos
프로세스가 종료되지는 않습니다.
가 로 설정된 mongos
상태에서 또는 가 mongod
--tlsCertificateSelector
실행 중인 경우 thumbprint
db.rotateCertificates()
는 실패하고 로그 파일에 경고 메시지를 기록합니다.
로깅
순환에 성공하면 주체 이름, 지문, 서버 및 cluster 인증서 지문의 유효 기간이 구성된 로그 대상 에 기록됩니다. 감사 가 활성화된 경우 이 정보는 감사 로그에도 기록됩니다.
Linux 및 Windows 플랫폼에서 CRL file
가 있으면 지문 및 유효 기간도 이 위치에 기록됩니다.
필요한 액세스 권한
You must have the rotateCertificates
조치 in order to use the db.rotateCertificates()
method. The
rotateCertificates
action is part of the
hostManager
role.
예시
다음 작업은 업데이트된 인증서 정보를 지정하기 위해 구성 파일을 적절하게 업데이트한 후 실행 중인 mongod
인스턴스에서 인증서를 순환합니다.
db.rotateCertificates()
다음은 위와 동일한 작업을 수행하지만 순환 시 로그 파일 과 감사 파일에 사용자 지정 로그 메시지를 씁니다.
db.rotateCertificates("message": "Rotating certificates")