Last active
November 19, 2021 16:05
-
-
Save ashutosh-narkar/2a12f5d9778c3921f7238ab6a7fad9c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package envoy.authz | |
import input.attributes.request.http as http_request | |
default allow = false | |
# allow Frontend service to access Database service | |
allow { | |
http_request.method == "GET" | |
svc_spiffe_id == "spiffe://acme.com/frontend" | |
} | |
svc_spiffe_id = client_id { | |
[_, _, uri_type_san] := split(http_request.headers["x-forwarded-client-cert"], ";") | |
[_, client_id] := split(uri_type_san, "=") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment