mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-04 02:57:27 +09:00
The caCertSecret helper emits ca.crt verbatim but only checked that a certificate block appeared SOMEWHERE in the value. Bytes before the first block or after the last one — a human-readable preamble, or a raw DER/JWK key that carries no PEM private-key header and so slips the key guard — therefore passed the check and were published to the tenant inside the trust anchor. Anchor the certificate regex to the entire value, so it matches only one or more complete blocks surrounded by whitespace and refuses anything else. This mirrors the CA-extraction controller, which reaches the same result by rebuilding the projection from the parsed blocks. Signed-off-by: Aleksei Sviridkin <f@lex.la>