automation-suite
2021.10
false
Importante :
A tradução automática foi aplicada parcialmente neste conteúdo.
UiPath logo, featuring letters U and I in white
Fora do período de suporte
Guia de instalação do Automation Suite
Last updated 21 de nov de 2024

Renovação de certificado MongoDB para usuários de aplicativos

Visão geral

MongoDB usa dois tipos de certificados para uma conexão segura dentro do cluster Automation Suite :

  • certificado raiz CA
  • certificado TLS

O certificado de CA do MongoDB para versões do Automation Suite anteriores a 2021.10.3 é válido apenas por 60 dias. Como não há processo de renovação automática, é necessário um procedimento manual para atualizar o certificado. Siga as etapas da seção Atualização manual de certificado para renovar os certificados.

Observação: os certificados atualizados manualmente são válidos apenas por mais 90 dias. Depois disso, os certificados devem ser atualizados manualmente novamente.

Para as versões 2021.10.4 e posteriores do Automation Suite, a validade foi atualizada para três anos. Para novas instalações de 2021.10.4 e posteriores, a renovação do certificado é automática.

Para ambientes atualizados da versão 2021.10.3 e anteriores, algumas etapas manuais são necessárias. Siga as etapas da seção Rotação de certificado para atualizar os certificados.

Atualização Manual do Certificado

Observação: siga este procedimento para atualizar os certificados do MongoDB manualmente apenas se estiver usando o Automation Suite até 2021.10.3 inclusive.

Ambiente online

Esse procedimento é aplicável para ambientes online.

Pré-requisitos

Antes de iniciar o procedimento, crie um arquivo de script chamado mongo-cert-rotation-script.sh contendo as informações abaixo.

mongo-cert-rotation-script.sh

export KUBECONFIG=/etc/rancher/rke2/rke2.yaml PATH=$PATH:/var/lib/rancher/rke2/bin:/usr/local/bin
curl -sSL -o kubectl-cert-manager.tar.gz https://github.com/cert-manager/cert-manager/releases/download/v1.6.0/kubectl-cert_manager-linux-amd64.tar.gz
tar xzf kubectl-cert-manager.tar.gz
sudo mv kubectl-cert_manager /usr/local/bin
function update_additional_secrets() {
  #extract updated pem file name
  newPemFileName=$(kubectl -n mongodb get secret mongodb-replica-set-server-certificate-key -o json | jq -r '.data'| jq -r keys[0])
  echo "New pem file name ${newPemFileName}"
  #extract stale pem file name
  oldPemFile=$(kubectl -n mongodb get secret mongodb-replica-set-config -o json | jq -r '.data."cluster-config.json"' | base64 -d | jq -r '.processes[0].args2_6.net.tls.certificateKeyFile')
  oldPemFileName=$(basename "$oldPemFile")
  echo "Stale pem file name ${oldPemFileName}"
  if [[ "$oldPemFileName" != "$newPemFileName" ]]; then
    echo "Pem file entries do not match. replacing"
    #extract replica set secret  cluser config json to file
    kubectl -n mongodb get secret mongodb-replica-set-config -o json | jq -r '.data."cluster-config.json"' | base64 -d > /tmp/clusterConfig.json
    #replace old pem file name with new in the json file
    sed -i -e "s@$oldPemFileName@$newPemFileName@g" /tmp/clusterConfig.json
    #encode the json
    encodedUpdatedClusterConfig=$(jq -r '. | @base64 | "\)\)(.)"' /tmp/clusterConfig.json)
    #patch replica set secret with updated cluster config
    kubectl -n mongodb patch secret mongodb-replica-set-config --type='json' -p='[{"op" : "replace" ,"path" : "/data/cluster-config.json" ,"value" : "'"$encodedUpdatedClusterConfig"'"}]'
  else
    echo "Pem file entries match; not updating"
  fi
}
function rotate_secrets(){
    NAMESPACE="mongodb"
    
    #shellcheck disable=SC2154
    HOME_DIR=$(eval echo "~$whoami")
    echo "extracting certs and secrets from relevant files"
    #cleanup if the dir already exists
    rm -rf "$HOME_DIR"/tmp/.certs || true
    mkdir -p "$HOME_DIR"/tmp/.certs/
    kubectl -n "$NAMESPACE" get secret/tls-ca-key-pair -o jsonpath='{.data.ca\)\).crt}' | base64 -d > "$HOME_DIR"/tmp/.certs/ca.crt
    kubectl -n "$NAMESPACE" create configmap mongo-ca --from-file="$HOME_DIR/tmp/.certs/ca.crt" --dry-run=client -o yaml | kubectl apply -f -
    
    kubectl -n mongodb label  configmap mongo-ca config-discovery=yes 2>/dev/null || true
    
}
PREVIOUS_REVISION=$(kubectl -n mongodb get cert cert-manager-tls-certificate -o json | jq -r '.status.revision')
echo "Previous Version"
echo $PREVIOUS_REVISION
kubectl cert-manager renew --namespace=mongodb --all
sleep 60
CURRENT_REVISION=$(kubectl -n mongodb get cert cert-manager-tls-certificate -o json | jq -r '.status.revision')
echo "Current Version"
echo $CURRENT_REVISION
#Validate if Cert gets renewed
if [[ "${PREVIOUS_REVISION}" != "${CURRENT_REVISION}" ]]; then
  echo "Cert Renewal Successful. Previous Revision: $PREVIOUS_REVISION Current Revision: $CURRENT_REVISION"
  echo "Rotating secrets"
  rotate_secrets
  echo "Secrets rotated"
  echo "Updating additional secrets"
  update_additional_secrets
  echo "Additional secrets updated"
  echo "Rolling restart mongodb replica set"
  kubectl rollout restart sts mongodb-replica-set -n mongodb
  echo "Mongodb replica successfully Restarted"
  echo "Rolling restart apps server"
  kubectl rollout restart  -n uipath deployment apps-server
  echo "Apps server successfully restarted"
  echo "Rolling restart apps-wsserver"
  kubectl rollout restart  -n uipath deployment apps-wsserver
  echo "Apps wsserver successfully restarted"
else
  echo "Cert Renewal UnSuccessful. Previous Revision: $PREVIOUS_REVISION Current Revision: $CURRENT_REVISION"
fi
rm -rf /usr/local/bin/kubectl-cert_managerexport KUBECONFIG=/etc/rancher/rke2/rke2.yaml PATH=$PATH:/var/lib/rancher/rke2/bin:/usr/local/bin
curl -sSL -o kubectl-cert-manager.tar.gz https://github.com/cert-manager/cert-manager/releases/download/v1.6.0/kubectl-cert_manager-linux-amd64.tar.gz
tar xzf kubectl-cert-manager.tar.gz
sudo mv kubectl-cert_manager /usr/local/bin
function update_additional_secrets() {
  #extract updated pem file name
  newPemFileName=$(kubectl -n mongodb get secret mongodb-replica-set-server-certificate-key -o json | jq -r '.data'| jq -r keys[0])
  echo "New pem file name ${newPemFileName}"
  #extract stale pem file name
  oldPemFile=$(kubectl -n mongodb get secret mongodb-replica-set-config -o json | jq -r '.data."cluster-config.json"' | base64 -d | jq -r '.processes[0].args2_6.net.tls.certificateKeyFile')
  oldPemFileName=$(basename "$oldPemFile")
  echo "Stale pem file name ${oldPemFileName}"
  if [[ "$oldPemFileName" != "$newPemFileName" ]]; then
    echo "Pem file entries do not match. replacing"
    #extract replica set secret  cluser config json to file
    kubectl -n mongodb get secret mongodb-replica-set-config -o json | jq -r '.data."cluster-config.json"' | base64 -d > /tmp/clusterConfig.json
    #replace old pem file name with new in the json file
    sed -i -e "s@$oldPemFileName@$newPemFileName@g" /tmp/clusterConfig.json
    #encode the json
    encodedUpdatedClusterConfig=$(jq -r '. | @base64 | "\)\)(.)"' /tmp/clusterConfig.json)
    #patch replica set secret with updated cluster config
    kubectl -n mongodb patch secret mongodb-replica-set-config --type='json' -p='[{"op" : "replace" ,"path" : "/data/cluster-config.json" ,"value" : "'"$encodedUpdatedClusterConfig"'"}]'
  else
    echo "Pem file entries match; not updating"
  fi
}
function rotate_secrets(){
    NAMESPACE="mongodb"
    
    #shellcheck disable=SC2154
    HOME_DIR=$(eval echo "~$whoami")
    echo "extracting certs and secrets from relevant files"
    #cleanup if the dir already exists
    rm -rf "$HOME_DIR"/tmp/.certs || true
    mkdir -p "$HOME_DIR"/tmp/.certs/
    kubectl -n "$NAMESPACE" get secret/tls-ca-key-pair -o jsonpath='{.data.ca\)\).crt}' | base64 -d > "$HOME_DIR"/tmp/.certs/ca.crt
    kubectl -n "$NAMESPACE" create configmap mongo-ca --from-file="$HOME_DIR/tmp/.certs/ca.crt" --dry-run=client -o yaml | kubectl apply -f -
    
    kubectl -n mongodb label  configmap mongo-ca config-discovery=yes 2>/dev/null || true
    
}
PREVIOUS_REVISION=$(kubectl -n mongodb get cert cert-manager-tls-certificate -o json | jq -r '.status.revision')
echo "Previous Version"
echo $PREVIOUS_REVISION
kubectl cert-manager renew --namespace=mongodb --all
sleep 60
CURRENT_REVISION=$(kubectl -n mongodb get cert cert-manager-tls-certificate -o json | jq -r '.status.revision')
echo "Current Version"
echo $CURRENT_REVISION
#Validate if Cert gets renewed
if [[ "${PREVIOUS_REVISION}" != "${CURRENT_REVISION}" ]]; then
  echo "Cert Renewal Successful. Previous Revision: $PREVIOUS_REVISION Current Revision: $CURRENT_REVISION"
  echo "Rotating secrets"
  rotate_secrets
  echo "Secrets rotated"
  echo "Updating additional secrets"
  update_additional_secrets
  echo "Additional secrets updated"
  echo "Rolling restart mongodb replica set"
  kubectl rollout restart sts mongodb-replica-set -n mongodb
  echo "Mongodb replica successfully Restarted"
  echo "Rolling restart apps server"
  kubectl rollout restart  -n uipath deployment apps-server
  echo "Apps server successfully restarted"
  echo "Rolling restart apps-wsserver"
  kubectl rollout restart  -n uipath deployment apps-wsserver
  echo "Apps wsserver successfully restarted"
else
  echo "Cert Renewal UnSuccessful. Previous Revision: $PREVIOUS_REVISION Current Revision: $CURRENT_REVISION"
fi
rm -rf /usr/local/bin/kubectl-cert_manager

Procedimento

  1. Copie o script de Pré-requisitos (mongo-cert-rotation-script.sh) para o nó da máquina virtual (VM) executando os seguintes comandos:
    scp <path-to-cert-script> <username>@<node-fqdn>:~scp <path-to-cert-script> <username>@<node-fqdn>:~
  2. Conecte-se à máquina usando SSH.
    ssh <username>@<node-fqdn>ssh <username>@<node-fqdn>
  3. Verifique as datas de expiração e renovação atuais executando o comando abaixo. Procure os campos notAfter e notBefore.
    export KUBECONFIG=/etc/rancher/rke2/rke2.yaml PATH=$PATH:/var/lib/rancher/rke2/bin:/usr/local/bin
    kubectl -n mongodb describe certsexport KUBECONFIG=/etc/rancher/rke2/rke2.yaml PATH=$PATH:/var/lib/rancher/rke2/bin:/usr/local/bin
    kubectl -n mongodb describe certs
  4. Copie o script do diretório inicial para o diretório do instalador executando os seguintes comandos:
    mv /home/<username>/mongo-cert-rotation-script.sh <installer-dir>
    cd <installer-dir>mv /home/<username>/mongo-cert-rotation-script.sh <installer-dir>
    cd <installer-dir>
  5. Execute o script usando os seguintes comandos:
    chmod u+x mongo-cert-rotation-script.sh
    ./mongo-cert-rotation-script.shchmod u+x mongo-cert-rotation-script.sh
    ./mongo-cert-rotation-script.sh
  6. Verifique as novas datas de expiração e renovação executando o comando abaixo. Procure os campos notAfter e notBefore.
    kubectl -n mongodb describe certskubectl -n mongodb describe certs

Ambiente offline

Este procedimento é aplicável para ambientes offline (isolados).

Pré-requisitos

Antes de iniciar o procedimento, crie um arquivo de script chamado mongo-cert-rotation-script.sh contendo as informações abaixo.

mongo-airgap-cert-rotation-script.sh

export KUBECONFIG=/etc/rancher/rke2/rke2.yaml PATH=$PATH:/var/lib/rancher/rke2/bin:/usr/local/bin
tar xzf kubectl-cert-manager.tar.gz
sudo mv kubectl-cert_manager /usr/local/bin
function update_additional_secrets() {
  #extract updated pem file name
  newPemFileName=$(kubectl -n mongodb get secret mongodb-replica-set-server-certificate-key -o json | jq -r '.data'| jq -r keys[0])
  echo "New pem file name ${newPemFileName}"
  #extract stale pem file name
  oldPemFile=$(kubectl -n mongodb get secret mongodb-replica-set-config -o json | jq -r '.data."cluster-config.json"' | base64 -d | jq -r '.processes[0].args2_6.net.tls.certificateKeyFile')
  oldPemFileName=$(basename "$oldPemFile")
  echo "Stale pem file name ${oldPemFileName}"
  if [[ "$oldPemFileName" != "$newPemFileName" ]]; then
    echo "Pem file entries do not match. replacing"
    #extract replica set secret  cluser config json to file
    kubectl -n mongodb get secret mongodb-replica-set-config -o json | jq -r '.data."cluster-config.json"' | base64 -d > /tmp/clusterConfig.json
    #replace old pem file name with new in the json file
    sed -i -e "s@$oldPemFileName@$newPemFileName@g" /tmp/clusterConfig.json
    #encode the json
    encodedUpdatedClusterConfig=$(jq -r '. | @base64 | "\)\)(.)"' /tmp/clusterConfig.json)
    #patch replica set secret with updated cluster config
    kubectl -n mongodb patch secret mongodb-replica-set-config --type='json' -p='[{"op" : "replace" ,"path" : "/data/cluster-config.json" ,"value" : "'"$encodedUpdatedClusterConfig"'"}]'
  else
    echo "Pem file entries match; not updating"
  fi
}
function rotate_secrets(){
    NAMESPACE="mongodb"
    
    #shellcheck disable=SC2154
    HOME_DIR=$(eval echo "~$whoami")
    echo "extracting certs and secrets from relevant files"
    #cleanup if the dir already exists
    rm -rf "$HOME_DIR"/tmp/.certs || true
    mkdir -p "$HOME_DIR"/tmp/.certs/
    kubectl -n "$NAMESPACE" get secret/tls-ca-key-pair -o jsonpath='{.data.ca\)\).crt}' | base64 -d > "$HOME_DIR"/tmp/.certs/ca.crt
    kubectl -n "$NAMESPACE" create configmap mongo-ca --from-file="$HOME_DIR/tmp/.certs/ca.crt" --dry-run=client -o yaml | kubectl apply -f -
    
    kubectl -n mongodb label  configmap mongo-ca config-discovery=yes 2>/dev/null || true
    
}
PREVIOUS_REVISION=$(kubectl -n mongodb get cert cert-manager-tls-certificate -o json | jq -r '.status.revision')
echo "Previous Version"
echo $PREVIOUS_REVISION
kubectl cert-manager renew --namespace=mongodb --all
sleep 60
CURRENT_REVISION=$(kubectl -n mongodb get cert cert-manager-tls-certificate -o json | jq -r '.status.revision')
echo "Current Version"
echo $CURRENT_REVISION
#Validate if Cert gets renewed
if [[ "${PREVIOUS_REVISION}" != "${CURRENT_REVISION}" ]]; then
  echo "Cert Renewal Successful. Previous Revision: $PREVIOUS_REVISION Current Revision: $CURRENT_REVISION"
  echo "Rotating secrets"
  rotate_secrets
  echo "Secrets rotated"
  echo "Updating additional secrets"
  update_additional_secrets
  echo "Additional secrets updated"
  echo "Rolling restart mongodb replica set"
  kubectl rollout restart sts mongodb-replica-set -n mongodb
  echo "Mongodb replica successfully Restarted"
  echo "Rolling restart apps server"
  kubectl rollout restart  -n uipath deployment apps-server
  echo "Apps server successfully restarted"
  echo "Rolling restart apps-wsserver"
  kubectl rollout restart  -n uipath deployment apps-wsserver
  echo "Apps wsserver successfully restarted"
else
  echo "Cert Renewal UnSuccessful. Previous Revision: $PREVIOUS_REVISION Current Revision: $CURRENT_REVISION"
fi
rm -rf /usr/local/bin/kubectl-cert_managerexport KUBECONFIG=/etc/rancher/rke2/rke2.yaml PATH=$PATH:/var/lib/rancher/rke2/bin:/usr/local/bin
tar xzf kubectl-cert-manager.tar.gz
sudo mv kubectl-cert_manager /usr/local/bin
function update_additional_secrets() {
  #extract updated pem file name
  newPemFileName=$(kubectl -n mongodb get secret mongodb-replica-set-server-certificate-key -o json | jq -r '.data'| jq -r keys[0])
  echo "New pem file name ${newPemFileName}"
  #extract stale pem file name
  oldPemFile=$(kubectl -n mongodb get secret mongodb-replica-set-config -o json | jq -r '.data."cluster-config.json"' | base64 -d | jq -r '.processes[0].args2_6.net.tls.certificateKeyFile')
  oldPemFileName=$(basename "$oldPemFile")
  echo "Stale pem file name ${oldPemFileName}"
  if [[ "$oldPemFileName" != "$newPemFileName" ]]; then
    echo "Pem file entries do not match. replacing"
    #extract replica set secret  cluser config json to file
    kubectl -n mongodb get secret mongodb-replica-set-config -o json | jq -r '.data."cluster-config.json"' | base64 -d > /tmp/clusterConfig.json
    #replace old pem file name with new in the json file
    sed -i -e "s@$oldPemFileName@$newPemFileName@g" /tmp/clusterConfig.json
    #encode the json
    encodedUpdatedClusterConfig=$(jq -r '. | @base64 | "\)\)(.)"' /tmp/clusterConfig.json)
    #patch replica set secret with updated cluster config
    kubectl -n mongodb patch secret mongodb-replica-set-config --type='json' -p='[{"op" : "replace" ,"path" : "/data/cluster-config.json" ,"value" : "'"$encodedUpdatedClusterConfig"'"}]'
  else
    echo "Pem file entries match; not updating"
  fi
}
function rotate_secrets(){
    NAMESPACE="mongodb"
    
    #shellcheck disable=SC2154
    HOME_DIR=$(eval echo "~$whoami")
    echo "extracting certs and secrets from relevant files"
    #cleanup if the dir already exists
    rm -rf "$HOME_DIR"/tmp/.certs || true
    mkdir -p "$HOME_DIR"/tmp/.certs/
    kubectl -n "$NAMESPACE" get secret/tls-ca-key-pair -o jsonpath='{.data.ca\)\).crt}' | base64 -d > "$HOME_DIR"/tmp/.certs/ca.crt
    kubectl -n "$NAMESPACE" create configmap mongo-ca --from-file="$HOME_DIR/tmp/.certs/ca.crt" --dry-run=client -o yaml | kubectl apply -f -
    
    kubectl -n mongodb label  configmap mongo-ca config-discovery=yes 2>/dev/null || true
    
}
PREVIOUS_REVISION=$(kubectl -n mongodb get cert cert-manager-tls-certificate -o json | jq -r '.status.revision')
echo "Previous Version"
echo $PREVIOUS_REVISION
kubectl cert-manager renew --namespace=mongodb --all
sleep 60
CURRENT_REVISION=$(kubectl -n mongodb get cert cert-manager-tls-certificate -o json | jq -r '.status.revision')
echo "Current Version"
echo $CURRENT_REVISION
#Validate if Cert gets renewed
if [[ "${PREVIOUS_REVISION}" != "${CURRENT_REVISION}" ]]; then
  echo "Cert Renewal Successful. Previous Revision: $PREVIOUS_REVISION Current Revision: $CURRENT_REVISION"
  echo "Rotating secrets"
  rotate_secrets
  echo "Secrets rotated"
  echo "Updating additional secrets"
  update_additional_secrets
  echo "Additional secrets updated"
  echo "Rolling restart mongodb replica set"
  kubectl rollout restart sts mongodb-replica-set -n mongodb
  echo "Mongodb replica successfully Restarted"
  echo "Rolling restart apps server"
  kubectl rollout restart  -n uipath deployment apps-server
  echo "Apps server successfully restarted"
  echo "Rolling restart apps-wsserver"
  kubectl rollout restart  -n uipath deployment apps-wsserver
  echo "Apps wsserver successfully restarted"
else
  echo "Cert Renewal UnSuccessful. Previous Revision: $PREVIOUS_REVISION Current Revision: $CURRENT_REVISION"
fi
rm -rf /usr/local/bin/kubectl-cert_manager

Procedimento

  1. Baixe o arquivo kubectl-cert-manager.tar em seu sistema executando o seguinte comando:
    curl -sSL -o kubectl-cert-manager.tar.gz https://github.com/cert-manager/cert-manager/releases/download/v1.6.0/kubectl-cert_manager-linux-amd64.tar.gzcurl -sSL -o kubectl-cert-manager.tar.gz https://github.com/cert-manager/cert-manager/releases/download/v1.6.0/kubectl-cert_manager-linux-amd64.tar.gz
  2. Copie o binário do gerenciador de certificados para o nó da VM executando o seguinte comando:

    scp <path-to-kubectl-cert-manager> <username>@<node-fqdn>:~scp <path-to-kubectl-cert-manager> <username>@<node-fqdn>:~
  3. Copie o script de Pré-requisitos (mongo-airgap-cert-rotation-script.sh) para o nó da VM executando os seguintes comandos:
    scp <path-to-mongo-airgap-cert-rotation> <username>@<node-fqdn>:~scp <path-to-mongo-airgap-cert-rotation> <username>@<node-fqdn>:~
  4. Conecte-se à máquina usando SSH.

    ssh <username>@<node-fqdn>ssh <username>@<node-fqdn>
  5. Copie o arquivo kubectl-cert-manager.tar para o diretório do instalador executando o seguinte comando:
    mv /home/<username>/kubectl-cert_manager.tar.gz <installer-dir>mv /home/<username>/kubectl-cert_manager.tar.gz <installer-dir>
  6. Copie o script mongo-airgap-cert-rotation-script.sh para o diretório do instalador executando o seguinte comando:
Observação: certifique-se de que os arquivos mongo-airgap-cert-rotation-script.sh e kubectl-cert-manager.tar estejam no mesmo caminho.
mv /home/<username>/mongo-airgap-cert-rotation-script.sh <installer-dir>
cd <installer-dir>mv /home/<username>/mongo-airgap-cert-rotation-script.sh <installer-dir>
cd <installer-dir>
7. Verifique as datas de expiração e renovação atuais executando o comando abaixo. Procure os campos notAfter e notBefore.
export KUBECONFIG=/etc/rancher/rke2/rke2.yaml PATH=$PATH:/var/lib/rancher/rke2/bin:/usr/local/bin
kubectl -n mongodb describe certsexport KUBECONFIG=/etc/rancher/rke2/rke2.yaml PATH=$PATH:/var/lib/rancher/rke2/bin:/usr/local/bin
kubectl -n mongodb describe certs

8. Execute o script usando os seguintes comandos:

chmod u+x mongo-airgap-cert-rotation-script.sh
./mongo-airgap-cert-rotation-script.shchmod u+x mongo-airgap-cert-rotation-script.sh
./mongo-airgap-cert-rotation-script.sh
9. Verifique as novas datas de expiração e renovação executando o comando abaixo. Procure os campos notAfter e notBefore.
kubectl -n mongodb describe certskubectl -n mongodb describe certs

Datas de validade do certificado

Ao verificar a validade do certificado, as seguintes datas são exibidas:

Not After – essa é a data e hora de expiração do período de validade do seu certificado.
Not Before – essa é a data e hora de início do período de validade do seu certificado.
Renewal Time – essa é a data e hora recomendadas para renovar manualmente seu certificado.

Por exemplo:

Certificate 1 in the file

Name:        cert-manager-tls-certificate

Namespace:   mongodb

Not After:              2023-03-08T23:19:49Z

Not Before:             2022-03-08T23:19:49Z

Renewal Time:           2023-02-06T23:19:49ZCertificate 1 in the file

Name:        cert-manager-tls-certificate

Namespace:   mongodb

Not After:              2023-03-08T23:19:49Z

Not Before:             2022-03-08T23:19:49Z

Renewal Time:           2023-02-06T23:19:49Z

Rotação de Certificado

Observação: siga este procedimento para atualizar os certificados do MongoDB manualmente somente se você atualizou do Automation Suite até e incluindo 2021.10.3 para uma versão posterior (pelo menos 2021.10.4).
  1. SSH para o nó da VM.

    ssh <username>@<node-fqdn>ssh <username>@<node-fqdn>
  2. Assuma a função de superusuário executando o comando abaixo.

    sudo susudo su
  3. Vá para o diretório de instalação (para novas instalações) ou atualização (para ambientes atualizados) executando o comando abaixo.

    cd <Installation/Upgrade Directory>cd <Installation/Upgrade Directory>
  4. Copie o script rotate-cert.sh abaixo para o diretório de instalação.
    ./configureUiPathAS.sh mongodb rotate-certificate
    kubectl -n mongodb get secret/tls-ca-key-pair -o jsonpath='{.data.ca\)\).crt}' | base64 -d > /tmp/.certs/ca.crt
    kubectl -n mongodb create configmap mongo-ca --from-file="/tmp/.certs/ca.crt" --dry-run=client -o yaml | kubectl replace -f -
    kubectl rollout restart sts mongodb-replica-set -n mongodb./configureUiPathAS.sh mongodb rotate-certificate
    kubectl -n mongodb get secret/tls-ca-key-pair -o jsonpath='{.data.ca\)\).crt}' | base64 -d > /tmp/.certs/ca.crt
    kubectl -n mongodb create configmap mongo-ca --from-file="/tmp/.certs/ca.crt" --dry-run=client -o yaml | kubectl replace -f -
    kubectl rollout restart sts mongodb-replica-set -n mongodb
  5. Execute o script de rotação de certificado usando o comando abaixo.

    chmod u+x rotate-cert.sh
    ./rotate-cert.shchmod u+x rotate-cert.sh
    ./rotate-cert.sh

O script de rotação do certificado leva cerca de 5 a 10 minutos para ser concluído. Os novos certificados gerados pelo script são válidos por três anos a partir da data de criação e são renovados automaticamente de acordo com o cronograma mencionado acima.

  • Visão geral
  • Atualização Manual do Certificado
  • Ambiente online
  • Ambiente offline
  • Datas de validade do certificado
  • Rotação de Certificado

Esta página foi útil?

Obtenha a ajuda que você precisa
Aprendendo RPA - Cursos de automação
Fórum da comunidade da Uipath
Uipath Logo White
Confiança e segurança
© 2005-2024 UiPath. Todos os direitos reservados.