Follow-up: agent-tunnel cert renewal review comments from #1775
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Refactorización
- Claridad
- Bien especificado
- Estado de actividad
- Tranquilo
- Stack tecnológico
- rust
- Área
- networking, security, testing
Línea de trabajo
Comienza con try_renew_certificate en devolutions-agent/src/tunnel.rs alrededor de las líneas 498-521 y compara persist_enrollment_response con el patrón existente de permisos de archivo. Lee los helpers de renovación en devolutions-agent/src/enrollment.rs alrededor de las líneas 248-318 y añade la cobertura de pruebas unitarias solicitada. Se considera terminado cuando las escrituras de renovación sean atómicas, los fallos locales irrecuperables durante la preparación de la CSR puedan recuperarse, las pruebas de los helpers pasen y el comentario de la línea 282 sea preciso.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Follow-up to the Copilot review on #1775 (feat(agent): implement certificate renewal). The PR is merged as-is because none of the items below affect the happy path, but they should be cleaned up.
Items
[P0] Atomic write for renewed cert + CA — devolutions-agent/src/tunnel.rs:521
- Replace the two
std::fs::write(cert_path, ...)/std::fs::write(ca_path, ...)calls with a write-temp-then-rename sequence (same directory, thenstd::fs::rename). - On Unix, set
0o600on the temp file before rename — match whatpersist_enrollment_responsealready does for the initial enrollment.
Why this matters: the current std::fs::write truncates in place. A crash, power loss, or full disk between the two writes leaves the client cert / CA file half-written; future mTLS handshakes then fail and the agent cannot recover remotely — admin has to re-enroll the machine on-site. Happy path is fine; only the failure mode is bad, and the failure mode is expensive.
[P1] Don't fail the connection on local CSR-prep errors — devolutions-agent/src/tunnel.rs:498
- In
try_renew_certificate, replace the?onread_agent_name_from_certandgenerate_csr_from_existing_keywithmatcharms that log a warning and returnOk(None).
Why this matters: the doc comment on try_renew_certificate says only control-stream IO / protocol errors should be Err, but right now a transient local file read failure (e.g. permission blip) bubbles up to run_single_connection's Err branch and forces a backoff/reconnect on an otherwise healthy QUIC connection. Should be a recoverable "skip renewal, keep using existing cert" path.
[P2] Unit tests for new renewal helpers — devolutions-agent/src/enrollment.rs:248-318
-
is_cert_expiring: generate a short-lived rcgen cert, assert true above threshold and false below. -
read_agent_name_from_cert: round-trip a known CN. -
generate_csr_from_existing_key: assert the produced PEM parses back viarcgen::CertificateSigningRequestParams::from_pemand that the public key matches the input key.
[P3] Fix misleading comment — devolutions-agent/src/enrollment.rs:282
- Rewrite the comment on
read_agent_name_from_cert. The current text implies the gateway looks the agent up in its registry byCommonName, butAgentRegistryis keyed byagent_id(UUID, extracted from SANurn:uuid:). The real reason to reuse the CN in the renewal CSR is just to keep the issued cert's CN stable across renewals — the gateway ignores the CSR subject anyway.
Original review
https://github.com/Devolutions/devolutions-gateway/pull/1775#pullrequestreview-4200093301
- Lenguaje dominante
- Rust
- Estrellas
- 163
- Forks
- 30
- Merge medio
- 1 d 10 h
- PR fusionados (30 d)
- 66
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Devolutions/devolutions-gateway
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Devolutions/devolutions-gateway#2111 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
Devolutions/devolutions-gateway#2109 ·
Los mantenedores suelen responder en 1 día
-
test(testsuite): drop the devolutions-gateway dev-dependencyPosiblemente ocupada @CBenoit la tomó hace 8 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 18/100
Devolutions/devolutions-gateway#2090 ·
Los mantenedores suelen responder en 1 día
-
allow us to disable tls 1.1, 1.2Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Devolutions/devolutions-gateway#2047 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Devolutions/devolutions-gateway#1973 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de Devolutions/devolutions-gateway
Issues similares
-
checkpoint/verify/rebuild_indexes on a thread holding a WriteTransaction deadlock instead of INT-001Abiertobug known-issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
project-minigraf/minigraf#734 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 4 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
bug CLI documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
openai/codex#56630 · 3 comentarios · 3 reacciones ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
DayuanJiang/PecoFence#139 ·
Los mantenedores suelen responder en 1 día