gateway icon indicating copy to clipboard operation
gateway copied to clipboard

Ext Auth grpc example fails with 403 Forbidden

Open zargor opened this issue 1 year ago • 7 comments

Description: This example does not work.

Repro steps: From the tutorial try grpc auth part. The service request will always end up with 403 Forbidden

Notes: It never logs grpc auth, like it never reaches out to grpc auth service. Seems it forbids before even getting to ext auth service.

zargor avatar Mar 14 '25 09:03 zargor

cc @melsal13, are you facing the same issue ?

arkodg avatar Mar 15 '25 02:03 arkodg

@arkodg yes, I landed on the same issue.

melsal13 avatar Mar 16 '25 06:03 melsal13

Looks like that same issue I may have had on my Mac too @arkodg

missBerg avatar Mar 17 '25 01:03 missBerg

Hi @zargor try using this configuration for the BackendTLSPolicy instead of the one on the docs. Let me know if it works!

cat <<EOF | kubectl apply -f -
apiVersion: gateway.networking.k8s.io/v1alpha3
kind: BackendTLSPolicy
metadata:
  name: grpc-ext-auth-btls
spec:
  targetRefs:
  - group: ''
    kind: Service
    name: grpc-ext-auth
  validation:
    caCertificateRefs:
    - name: grpc-ext-auth-ca
      group: ''
      kind: ConfigMap
    hostname: grpc-ext-auth
EOF

melsal13 avatar Mar 17 '25 23:03 melsal13

@zargor looks like you are referring to an older version / v1.0 which has EOLd, the newer version v1.3 doesnt set the sectionName in the example https://gateway.envoyproxy.io/v1.3/tasks/security/ext-auth/

arkodg avatar Mar 17 '25 23:03 arkodg

@zargor looks like you are referring to an older version / v1.0 which has EOLd, the newer version v1.3 doesnt set the sectionName in the example https://gateway.envoyproxy.io/v1.3/tasks/security/ext-auth/

You were totally right, cause BackendTLSPolicy sectionName and I have overseen that.

zargor avatar Mar 18 '25 11:03 zargor

Hi @zargor try using this configuration for the BackendTLSPolicy instead of the one on the docs. Let me know if it works!

cat <<EOF | kubectl apply -f -
apiVersion: gateway.networking.k8s.io/v1alpha3
kind: BackendTLSPolicy
metadata:
  name: grpc-ext-auth-btls
spec:
  targetRefs:
  - group: ''
    kind: Service
    name: grpc-ext-auth
  validation:
    caCertificateRefs:
    - name: grpc-ext-auth-ca
      group: ''
      kind: ConfigMap
    hostname: grpc-ext-auth
EOF

Now it is working! Finally the traffic goes to auth service. Actually, this is from latest docs and somehow I haven't noticed sectionName: "9002" is kicked out. Thanks for helping.

zargor avatar Mar 18 '25 11:03 zargor