As of Linkerd 2.14, when I specify AuthorizationPolicy on a HTTPRoute it automatically makes all unspecified routes deny? I remember this from one of the workshops https://www.youtube.com/watch?v=hzj65jVtEwc
Thus if I just want to deny access only to /internal/ , I have to allow access and enumerate all other routes in my service?
Asking because we have a legacy monolith of ~300+ endpoints and I dont think we can enumerate them all just so we can deny 1 route
Interesting question. I believe we support regex matching for paths in HTTPRoutes using the Rust regex library. Unfortunately this library does not support lookahead, so something like ^(?!internal) won’t work.
There are ways to create negative regular expressions but it won’t be pretty. You could try something like ^([^i].*)|(i[^n].*)|(in[^t].)| ..... |(interna[^l].*)$.
Hopefully there’s a better solution out there than this…
Try making one HTTPRoute (and ServerAuthorization, etc) for /internal/ that denies traffic accordingly, and a second HTTPRoute (and SA, etc) for * that allows traffic. Precedence rules for HTTPRoute should apply.