I tried to implement a toy OpenID Connect relying party
using Lua scripting, and ran into a few problems:

1. I could not figure out a safe way to use the aes_gcm_enc
   and aes_gcm_dec converters.  There’s no way to generate a
   strong random number, and the 96-bit AES-GCM nonce size
   means one would need to use a per-HAProxy-instance key.
   This is not compatible with active-active clustering.
   One could implement something SIV-like by using HMAC of
   the data to generate the key, but the use of base64 encoding
   for the key suggests that there might be a timing leak unless
   the base64 code is constant time.

2. The jwt_verify converter requires a literal certificate name,
   which won’t work if the certificate is fetched at runtime by
   Lua (perhaps from a Valkey (Redis clone) database).

Is there a good way to implement OpenID Connect via Lua scripting,
or is this something that would be better supported natively in
HAProxy’s C code or handled via SPOE?
-- 
Sincerely,
Demi Marie Obenour (she/her/hers)

Attachment: OpenPGP_0xB288B55FFF9C22C1.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to