- Información general
- Requisitos
- Instalación
- Después de la instalación
- Migración y actualización
- Actualizar Automation Suite en EKS / AKS
- Paso 1: Mover los datos de la organización de identidad de independiente a Automation Suite
- Paso 2: restaurar la base de datos del producto independiente
- Paso 3: Realizar una copia de seguridad de la base de datos de la plataforma en Automation Suite
- Paso 4: Fusionar organizaciones en Automation Suite
- Paso 5: actualizar las cadenas de conexión de los productos migrados
- Paso 6: migrar el Orchestrator independiente
- Paso 7: migrar Insights independiente
- Paso 8: Migrar Test Manager independiente
- Paso 9: eliminar el tenant predeterminado
- Realizar una migración de un solo tenant
- Migrar de Automation Suite en Linux a Automation Suite en EKS / AKS
- Supervisión y alertas
- Administración de clústeres
- Configuración específica del producto
- Configurar parámetros de Orchestrator
- Configuración de Orchestrator
- Configurar AppSettings
- Configurar el tamaño máximo de la solicitud
- Anular la configuración de almacenamiento a nivel de clúster
- Configurar almacenes de credenciales
- Configurar clave de cifrado por tenant
- Limpiar la base de datos de Orchestrator
- Solución de problemas
- La configuración de la copia de seguridad no funciona debido a un fallo en la conexión a Azure Government
- Los pods en el espacio de nombres de UiPath se atascaban al habilitar los taints de nodo personalizados
- No se puede iniciar Automation Hub y Apps con la configuración de proxy
- Los pods no pueden comunicarse con FQDN en un entorno de proxy
- Se ignora la cadena de conexión SQL de la automatización de pruebas
- Error de copia de seguridad de EKS debido a la versión de Velero
- La copia de seguridad de Velero falla con el error de validación fallida
- El acceso a FQDN devuelve un error de acceso RBAC denegado
- Mitigación manual de Política de red de ArgoCD (GHSA-47m3-95c7-g2g8)
Mitigación manual de Política de red de ArgoCD (GHSA-47m3-95c7-g2g8)
Soluciones para el acceso a la red no autenticado al servidor de repositorio de ArgoCD y Redis en Automation Suite, con un procedimiento manual de mitigación de PolíticaDeRed.
Descripción
Recientemente se publicó una vulnerabilidad que afecta al componente ArgoCD repo-server y ArgoCD no la ha corregido en este momento.
Se puede acceder a ArgoCD repo-server (puerto 8081) y ArgoCD Redis desde cualquier pod de la red del clúster, porque ninguna PolíticaDeRed restringe la entrada a estos componentes de forma predeterminada. Como resultado, cualquier pod dentro de la red del clúster puede conectarse a ellos directamente, ya que ArgoCD no requiere autenticación para estos componentes internos. Para obtener más información, consulta GHSA-47m3-95c7-g2g8.
Para mitigar el problema, debes aplicar manualmente la PolíticaDeRed descrita en la sección Solución de esta página.
Requisitos previos
- Ejecuta este procedimiento desde un host con acceso
kubectlal clúster. - El procedimiento asume el espacio de nombres predeterminado de Automation Suite
argocd. Si ArgoCD utiliza un espacio de nombres diferente, estableceARGOCD_NSantes de ejecutar el script. - Esta mitigación se basa en la aplicación de Kubernetes NetworkPolicy, que proporciona el complemento CNI (Container Network Interface). Algunas CNI, como la CNI de Amazon VPC, no aplican políticas de red de forma predeterminada; en ese caso, las políticas aplicadas no tienen efecto. Asegúrate de que la aplicación de políticas de red esté habilitada en tu clúster. Para obtener instrucciones, consulta la documentación oficial de tu CNI.
Solución
-
Ejecuta el siguiente script. Detecta tu versión de ArgoCD y el modo Redis (independiente o de alta disponibilidad, HA) y aplica la PolíticaDeRed correspondiente automáticamente:
export ARGOCD_NS="${ARGOCD_NS:-argocd}" export ARGOCD_RELEASE="$(kubectl -n "$ARGOCD_NS" get pod -l app.kubernetes.io/name=argocd-server -o jsonpath='{.items[0].metadata.labels.app\.kubernetes\.io/instance}')" test -n "$ARGOCD_RELEASE" || { echo "Cannot detect Argo CD Helm release"; exit 1; } if kubectl -n "$ARGOCD_NS" get pod -l "release=${ARGOCD_RELEASE},app=redis-ha-haproxy" --no-headers 2>/dev/null | grep -q .; then REDIS_MODE=ha else REDIS_MODE=standalone fi echo "Argo CD namespace: $ARGOCD_NS" echo "Argo CD release: $ARGOCD_RELEASE" echo "Redis mode: $REDIS_MODE" cat <<EOF | kubectl apply -f - apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: argocd-repo-server-manual-mitigation namespace: ${ARGOCD_NS} spec: podSelector: matchLabels: app.kubernetes.io/name: argocd-repo-server app.kubernetes.io/instance: ${ARGOCD_RELEASE} policyTypes: - Ingress ingress: - from: - podSelector: matchLabels: app.kubernetes.io/name: argocd-server app.kubernetes.io/instance: ${ARGOCD_RELEASE} - podSelector: matchLabels: app.kubernetes.io/name: argocd-application-controller app.kubernetes.io/instance: ${ARGOCD_RELEASE} - podSelector: matchLabels: app.kubernetes.io/name: argocd-applicationset-controller app.kubernetes.io/instance: ${ARGOCD_RELEASE} - podSelector: matchLabels: app.kubernetes.io/name: argocd-notifications-controller app.kubernetes.io/instance: ${ARGOCD_RELEASE} ports: - protocol: TCP port: 8081 - from: - namespaceSelector: {} ports: - protocol: TCP port: 8084 EOF if [ "$REDIS_MODE" = "ha" ]; then cat <<EOF | kubectl apply -f - apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: argocd-redis-ha-server-manual-mitigation namespace: ${ARGOCD_NS} spec: podSelector: matchLabels: release: ${ARGOCD_RELEASE} app: redis-ha policyTypes: - Ingress ingress: - from: - podSelector: matchLabels: release: ${ARGOCD_RELEASE} app: redis-ha - podSelector: matchLabels: release: ${ARGOCD_RELEASE} app: redis-ha-haproxy ports: - protocol: TCP port: 6379 - protocol: TCP port: 26379 --- apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: argocd-redis-ha-haproxy-manual-mitigation namespace: ${ARGOCD_NS} spec: podSelector: matchLabels: release: ${ARGOCD_RELEASE} app: redis-ha-haproxy app.kubernetes.io/name: argocd-redis-ha-haproxy policyTypes: - Ingress ingress: - from: - podSelector: matchLabels: app.kubernetes.io/name: argocd-server app.kubernetes.io/instance: ${ARGOCD_RELEASE} - podSelector: matchLabels: app.kubernetes.io/name: argocd-repo-server app.kubernetes.io/instance: ${ARGOCD_RELEASE} - podSelector: matchLabels: app.kubernetes.io/name: argocd-application-controller app.kubernetes.io/instance: ${ARGOCD_RELEASE} ports: - protocol: TCP port: 6379 EOF else cat <<EOF | kubectl apply -f - apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: argocd-redis-manual-mitigation namespace: ${ARGOCD_NS} spec: podSelector: matchLabels: app.kubernetes.io/name: argocd-redis app.kubernetes.io/instance: ${ARGOCD_RELEASE} policyTypes: - Ingress ingress: - from: - podSelector: matchLabels: app.kubernetes.io/name: argocd-server app.kubernetes.io/instance: ${ARGOCD_RELEASE} - podSelector: matchLabels: app.kubernetes.io/name: argocd-repo-server app.kubernetes.io/instance: ${ARGOCD_RELEASE} - podSelector: matchLabels: app.kubernetes.io/name: argocd-application-controller app.kubernetes.io/instance: ${ARGOCD_RELEASE} ports: - protocol: TCP port: 6379 - from: - namespaceSelector: {} ports: - protocol: TCP port: 9121 EOF fiexport ARGOCD_NS="${ARGOCD_NS:-argocd}" export ARGOCD_RELEASE="$(kubectl -n "$ARGOCD_NS" get pod -l app.kubernetes.io/name=argocd-server -o jsonpath='{.items[0].metadata.labels.app\.kubernetes\.io/instance}')" test -n "$ARGOCD_RELEASE" || { echo "Cannot detect Argo CD Helm release"; exit 1; } if kubectl -n "$ARGOCD_NS" get pod -l "release=${ARGOCD_RELEASE},app=redis-ha-haproxy" --no-headers 2>/dev/null | grep -q .; then REDIS_MODE=ha else REDIS_MODE=standalone fi echo "Argo CD namespace: $ARGOCD_NS" echo "Argo CD release: $ARGOCD_RELEASE" echo "Redis mode: $REDIS_MODE" cat <<EOF | kubectl apply -f - apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: argocd-repo-server-manual-mitigation namespace: ${ARGOCD_NS} spec: podSelector: matchLabels: app.kubernetes.io/name: argocd-repo-server app.kubernetes.io/instance: ${ARGOCD_RELEASE} policyTypes: - Ingress ingress: - from: - podSelector: matchLabels: app.kubernetes.io/name: argocd-server app.kubernetes.io/instance: ${ARGOCD_RELEASE} - podSelector: matchLabels: app.kubernetes.io/name: argocd-application-controller app.kubernetes.io/instance: ${ARGOCD_RELEASE} - podSelector: matchLabels: app.kubernetes.io/name: argocd-applicationset-controller app.kubernetes.io/instance: ${ARGOCD_RELEASE} - podSelector: matchLabels: app.kubernetes.io/name: argocd-notifications-controller app.kubernetes.io/instance: ${ARGOCD_RELEASE} ports: - protocol: TCP port: 8081 - from: - namespaceSelector: {} ports: - protocol: TCP port: 8084 EOF if [ "$REDIS_MODE" = "ha" ]; then cat <<EOF | kubectl apply -f - apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: argocd-redis-ha-server-manual-mitigation namespace: ${ARGOCD_NS} spec: podSelector: matchLabels: release: ${ARGOCD_RELEASE} app: redis-ha policyTypes: - Ingress ingress: - from: - podSelector: matchLabels: release: ${ARGOCD_RELEASE} app: redis-ha - podSelector: matchLabels: release: ${ARGOCD_RELEASE} app: redis-ha-haproxy ports: - protocol: TCP port: 6379 - protocol: TCP port: 26379 --- apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: argocd-redis-ha-haproxy-manual-mitigation namespace: ${ARGOCD_NS} spec: podSelector: matchLabels: release: ${ARGOCD_RELEASE} app: redis-ha-haproxy app.kubernetes.io/name: argocd-redis-ha-haproxy policyTypes: - Ingress ingress: - from: - podSelector: matchLabels: app.kubernetes.io/name: argocd-server app.kubernetes.io/instance: ${ARGOCD_RELEASE} - podSelector: matchLabels: app.kubernetes.io/name: argocd-repo-server app.kubernetes.io/instance: ${ARGOCD_RELEASE} - podSelector: matchLabels: app.kubernetes.io/name: argocd-application-controller app.kubernetes.io/instance: ${ARGOCD_RELEASE} ports: - protocol: TCP port: 6379 EOF else cat <<EOF | kubectl apply -f - apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: argocd-redis-manual-mitigation namespace: ${ARGOCD_NS} spec: podSelector: matchLabels: app.kubernetes.io/name: argocd-redis app.kubernetes.io/instance: ${ARGOCD_RELEASE} policyTypes: - Ingress ingress: - from: - podSelector: matchLabels: app.kubernetes.io/name: argocd-server app.kubernetes.io/instance: ${ARGOCD_RELEASE} - podSelector: matchLabels: app.kubernetes.io/name: argocd-repo-server app.kubernetes.io/instance: ${ARGOCD_RELEASE} - podSelector: matchLabels: app.kubernetes.io/name: argocd-application-controller app.kubernetes.io/instance: ${ARGOCD_RELEASE} ports: - protocol: TCP port: 6379 - from: - namespaceSelector: {} ports: - protocol: TCP port: 9121 EOF fi
Verificar
Ejecuta los siguientes comandos para confirmar que la mitigación se ha aplicado correctamente:
kubectl -n "$ARGOCD_NS" get networkpolicy
kubectl -n "$ARGOCD_NS" get pods
kubectl get applications.argoproj.io -A
kubectl -n "$ARGOCD_NS" get networkpolicy
kubectl -n "$ARGOCD_NS" get pods
kubectl get applications.argoproj.io -A
Confirma lo siguiente:
argocd-repo-server-manual-mitigationexiste.- Para Redis HA,
argocd-redis-ha-server-manual-mitigationyargocd-redis-ha-haproxy-manual-mitigationexisten. - Para Redis independiente,
argocd-redis-manual-mitigationexiste. - Los pods de ArgoCD son
RunningoCompleted. - Las aplicaciones de ArgoCD siguen siendo
SyncedyHealthy.
Confirmar mitigación
Ejecuta estas comprobaciones después de aplicar las políticas. Verifican que el tráfico de ArgoCD requerido sigue funcionando y que el tráfico no permitido está bloqueado.
-
Ejecuta el siguiente script:
export ARGOCD_NS="${ARGOCD_NS:-argocd}" export ARGOCD_RELEASE="${ARGOCD_RELEASE:-$(kubectl -n "$ARGOCD_NS" get pod -l app.kubernetes.io/name=argocd-server -o jsonpath='{.items[0].metadata.labels.app\.kubernetes\.io/instance}')}" if kubectl -n "$ARGOCD_NS" get pod -l "release=${ARGOCD_RELEASE},app=redis-ha-haproxy" --no-headers 2>/dev/null | grep -q .; then REDIS_MODE=ha else REDIS_MODE=standalone fi SERVER_POD="$(kubectl -n "$ARGOCD_NS" get pod -l app.kubernetes.io/name=argocd-server -o jsonpath='{.items[0].metadata.name}')" APPSET_POD="$(kubectl -n "$ARGOCD_NS" get pod -l app.kubernetes.io/name=argocd-applicationset-controller -o jsonpath='{.items[0].metadata.name}' 2>/dev/null || true)" FAILED_CHECKS="" tcp_check() { pod="$1" host="$2" port="$3" expected="$4" name="$5" code="$(kubectl -n "$ARGOCD_NS" exec "$pod" -- sh -c ' host="$1" port="$2" if command -v nc >/dev/null 2>&1; then timeout 5 nc -z -w 3 "$host" "$port" >/dev/null 2>&1 printf "%s\n" "$?" elif command -v bash >/dev/null 2>&1; then timeout 5 bash -c "</dev/tcp/${host}/${port}" >/dev/null 2>&1 printf "%s\n" "$?" else printf "%s\n" "NO_TCP_TOOL" fi ' sh "$host" "$port" 2>/dev/null | tail -n 1)" if [ "$expected" = "allow" ] && [ "$code" = "0" ]; then return elif [ "$expected" = "deny" ] && [ "$code" != "0" ] && [ "$code" != "NO_TCP_TOOL" ] && [ -n "$code" ]; then return else FAILED_CHECKS="${FAILED_CHECKS} - ${name}: expected ${expected}, got exit code ${code}" fi } tcp_check "$SERVER_POD" argocd-repo-server 8081 allow "argocd-server to repo-server:8081" if [ "$REDIS_MODE" = "ha" ]; then HAPROXY_POD="$(kubectl -n "$ARGOCD_NS" get pod -l "release=${ARGOCD_RELEASE},app=redis-ha-haproxy" -o jsonpath='{.items[0].metadata.name}')" tcp_check "$SERVER_POD" argocd-redis-ha-haproxy 6379 allow "argocd-server to redis-ha-haproxy:6379" tcp_check "$HAPROXY_POD" argocd-redis-ha 6379 allow "redis-ha-haproxy to redis-ha:6379" tcp_check "$HAPROXY_POD" argocd-repo-server 8081 deny "redis-ha-haproxy to repo-server:8081" if [ -n "$APPSET_POD" ]; then tcp_check "$APPSET_POD" argocd-redis-ha-haproxy 6379 deny "applicationset-controller to redis-ha-haproxy:6379" fi else REDIS_POD="$(kubectl -n "$ARGOCD_NS" get pod -l app.kubernetes.io/name=argocd-redis -o jsonpath='{.items[0].metadata.name}')" tcp_check "$SERVER_POD" argocd-redis 6379 allow "argocd-server to redis:6379" tcp_check "$REDIS_POD" argocd-repo-server 8081 deny "redis to repo-server:8081" if [ -n "$APPSET_POD" ]; then tcp_check "$APPSET_POD" argocd-redis 6379 deny "applicationset-controller to redis:6379" fi fi if [ -z "$FAILED_CHECKS" ]; then echo "MITIGATION CHECK: PASS" else echo "MITIGATION CHECK: FAIL" echo "$FAILED_CHECKS" exit 1 fiexport ARGOCD_NS="${ARGOCD_NS:-argocd}" export ARGOCD_RELEASE="${ARGOCD_RELEASE:-$(kubectl -n "$ARGOCD_NS" get pod -l app.kubernetes.io/name=argocd-server -o jsonpath='{.items[0].metadata.labels.app\.kubernetes\.io/instance}')}" if kubectl -n "$ARGOCD_NS" get pod -l "release=${ARGOCD_RELEASE},app=redis-ha-haproxy" --no-headers 2>/dev/null | grep -q .; then REDIS_MODE=ha else REDIS_MODE=standalone fi SERVER_POD="$(kubectl -n "$ARGOCD_NS" get pod -l app.kubernetes.io/name=argocd-server -o jsonpath='{.items[0].metadata.name}')" APPSET_POD="$(kubectl -n "$ARGOCD_NS" get pod -l app.kubernetes.io/name=argocd-applicationset-controller -o jsonpath='{.items[0].metadata.name}' 2>/dev/null || true)" FAILED_CHECKS="" tcp_check() { pod="$1" host="$2" port="$3" expected="$4" name="$5" code="$(kubectl -n "$ARGOCD_NS" exec "$pod" -- sh -c ' host="$1" port="$2" if command -v nc >/dev/null 2>&1; then timeout 5 nc -z -w 3 "$host" "$port" >/dev/null 2>&1 printf "%s\n" "$?" elif command -v bash >/dev/null 2>&1; then timeout 5 bash -c "</dev/tcp/${host}/${port}" >/dev/null 2>&1 printf "%s\n" "$?" else printf "%s\n" "NO_TCP_TOOL" fi ' sh "$host" "$port" 2>/dev/null | tail -n 1)" if [ "$expected" = "allow" ] && [ "$code" = "0" ]; then return elif [ "$expected" = "deny" ] && [ "$code" != "0" ] && [ "$code" != "NO_TCP_TOOL" ] && [ -n "$code" ]; then return else FAILED_CHECKS="${FAILED_CHECKS} - ${name}: expected ${expected}, got exit code ${code}" fi } tcp_check "$SERVER_POD" argocd-repo-server 8081 allow "argocd-server to repo-server:8081" if [ "$REDIS_MODE" = "ha" ]; then HAPROXY_POD="$(kubectl -n "$ARGOCD_NS" get pod -l "release=${ARGOCD_RELEASE},app=redis-ha-haproxy" -o jsonpath='{.items[0].metadata.name}')" tcp_check "$SERVER_POD" argocd-redis-ha-haproxy 6379 allow "argocd-server to redis-ha-haproxy:6379" tcp_check "$HAPROXY_POD" argocd-redis-ha 6379 allow "redis-ha-haproxy to redis-ha:6379" tcp_check "$HAPROXY_POD" argocd-repo-server 8081 deny "redis-ha-haproxy to repo-server:8081" if [ -n "$APPSET_POD" ]; then tcp_check "$APPSET_POD" argocd-redis-ha-haproxy 6379 deny "applicationset-controller to redis-ha-haproxy:6379" fi else REDIS_POD="$(kubectl -n "$ARGOCD_NS" get pod -l app.kubernetes.io/name=argocd-redis -o jsonpath='{.items[0].metadata.name}')" tcp_check "$SERVER_POD" argocd-redis 6379 allow "argocd-server to redis:6379" tcp_check "$REDIS_POD" argocd-repo-server 8081 deny "redis to repo-server:8081" if [ -n "$APPSET_POD" ]; then tcp_check "$APPSET_POD" argocd-redis 6379 deny "applicationset-controller to redis:6379" fi fi if [ -z "$FAILED_CHECKS" ]; then echo "MITIGATION CHECK: PASS" else echo "MITIGATION CHECK: FAIL" echo "$FAILED_CHECKS" exit 1 fiResultado esperado:
MITIGATION CHECK: PASS
Reversión
Si es necesario, sigue los siguientes pasos para eliminar la mitigación:
-
Elimina las políticas de mitigación manuales:
kubectl -n "$ARGOCD_NS" delete networkpolicy \ argocd-repo-server-manual-mitigation \ argocd-redis-manual-mitigation \ argocd-redis-ha-server-manual-mitigation \ argocd-redis-ha-haproxy-manual-mitigation \ --ignore-not-foundkubectl -n "$ARGOCD_NS" delete networkpolicy \ argocd-repo-server-manual-mitigation \ argocd-redis-manual-mitigation \ argocd-redis-ha-server-manual-mitigation \ argocd-redis-ha-haproxy-manual-mitigation \ --ignore-not-found -
Confirma que la reversión se ha completado correctamente:
kubectl -n "$ARGOCD_NS" get networkpolicy kubectl -n "$ARGOCD_NS" get pods kubectl get applications.argoproj.io -Akubectl -n "$ARGOCD_NS" get networkpolicy kubectl -n "$ARGOCD_NS" get pods kubectl get applications.argoproj.io -AConfirma lo siguiente:
- Se eliminan las políticas de mitigación manuales.
- Los pods de ArgoCD permanecen
RunningoCompleted. - Las aplicaciones de ArgoCD siguen siendo
SyncedyHealthy.