What happened?
We used the hosted authenticate service with success but later decided to host our own to have uptime guarantee.
We currently use version v0.22.1.
We now get a 401 locally by our pomerium proxy after a few minutes and I can see the following in the logs:
{"level":"info","config_file_source":"/etc/pomerium/config/config.yaml","bootstrap":true,"service":"identity_manager","user_id":"107203644295945440985","session_id":"94ecd878-53ad-49c8-b0bc-b54500772a97","time":"2024-04-03T12:27:32Z","message":"refreshing session"}
{"level":"info","config_file_source":"/etc/pomerium/config/config.yaml","bootstrap":true,"service":"identity_manager","user_id":"107203644295945440985","session_id":"94ecd878-53ad-49c8-b0bc-b54500772a97","time":"2024-04-03T12:27:32Z","message":"no authenticator defined, deleting session"}
After that our session is cleared and we get redirected automatically to our authentication service (our frontend logic does that for us), which still has the cookie so get redirected back to our local pomerium proxy and the session is recreated without having to actually log in again, but this is still a problem because of the redirects.
I’ve realized we might have to set a shared_secret between our proxy and the authenticate service, so I did although there were nothing related in the logs.
Now it “seems” to work better, at least I don’t get the session delete and 401 for a while initially, but then it starts to do that again after like an hour or so. It’s not entirely deterministic for me how and when that happens.
What did you expect to happen?
I expected the authenticate service and our proxy behave the same way as previously.
How’d it happen?
I tried to describe above
What’s your environment like?
- Pomerium version (retrieve with
pomerium --version
): v0.22.1 - Server Operating System/Architecture/Cloud: kubernetes (minikube/gke)
What’s your config.yaml?
This is our local pomerium deployment config without the routes
address: :8000
metrics_address: :8010
autocert: false
log_level: "info"
shared_secret: X
authenticate_service_url: "https://authenticate.our.domain"
certificates:
- cert: /etc/pomerium/certificates/combined/tls.crt
key: /etc/pomerium/certificates/combined/tls.key
routes:
...
Our full authenticate service config:
address: :8000
metrics_address: :8010
autocert: false
log_level: "info"
authenticate_service_url: "https://authenticate.our.domain"
idp_provider: google
shared_secret: X
certificates:
- cert: /etc/pomerium/certificates/combined/tls.crt
key: /etc/pomerium/certificates/combined/tls.key
What did you see in the logs?
{"level":"info","type":"type.googleapis.com/session.Session","id":"94ecd878-53ad-49c8-b0bc-b54500772a97","time":"2024-04-03T12:28:12Z","message":"get"}
{"level":"info","type":"type.googleapis.com/session.Session","query":"","offset":0,"limit":1,"filter":{"$or":[{"id":"94ecd878-53ad-49c8-b0bc-b54500772a97"},{"$index":"94ecd878-53ad-49c8-b0bc-b54500772a97"}]},"time":"2024-04-03T12:28:17Z","message":"query"}
{"level":"warn","error":"record not found","time":"2024-04-03T12:28:17Z","message":"clearing session due to missing session or service account"}
{"level":"warn","error":"record not found","time":"2024-04-03T12:28:17Z","message":"clearing session due to missing session or service account"}
{"level":"error","error":"Unauthorized","status":401,"status-text":"Unauthorized","request-id":"9f52cfab-bb0c-4ce5-ba27-9634d7e2c68d","time":"2024-04-03T12:28:17Z","message":"httputil: error"}
{"level":"error","error":"Unauthorized","status":401,"status-text":"Unauthorized","request-id":"9db7abcf-fb53-4dc9-a024-700bdd9bce84","time":"2024-04-03T12:28:17Z","message":"httputil: error"}
{"level":"warn","error":"record not found","time":"2024-04-03T12:28:17Z","message":"clearing session due to missing session or service account"}
{"level":"error","error":"hpke: error requesting hpke-public-key endpoint: Get \"https://authenticate.our.domain/.well-known/pomerium/hpke-public-key\": context canceled","request-id":"c804a771-e9b8-401d-aede-ca94959d1779","time":"2024-04-03T12:28:17Z","message":"grpc check ext_authz_error"}
{"level":"warn","error":"record not found","time":"2024-04-03T12:28:17Z","message":"clearing session due to missing session or service account"}
{"level":"warn","error":"record not found","time":"2024-04-03T12:28:17Z","message":"clearing session due to missing session or service account"}
{"level":"info","type":"type.googleapis.com/session.Session","id":"f5d86e4d-747e-4d14-8211-a7acae3d3bcb","time":"2024-04-03T12:28:17Z","message":"get"}
{"level":"info","type":"type.googleapis.com/user.User","id":"107203644295945440985","time":"2024-04-03T12:28:17Z","message":"get"}
{"level":"info","record-count":2,"record-type":"type.googleapis.com/user.User","time":"2024-04-03T12:28:17Z","message":"put"}
{"level":"info","type":"type.googleapis.com/session.Session","query":"","offset":0,"limit":1,"filter":{"$or":[{"id":"f5d86e4d-747e-4d14-8211-a7acae3d3bcb"},{"$index":"f5d86e4d-747e-4d14-8211-a7acae3d3bcb"}]},"time":"2024-04-03T12:28:17Z","message":"query"}
{"level":"info","type":"type.googleapis.com/session.Session","query":"","offset":0,"limit":1,"filter":{"$or":[{"id":"f5d86e4d-747e-4d14-8211-a7acae3d3bcb"},{"$index":"f5d86e4d-747e-4d14-8211-a7acae3d3bcb"}]},"time":"2024-04-03T12:28:17Z","message":"query"}
{"level":"info","type":"type.googleapis.com/user.ServiceAccount","query":"","offset":0,"limit":1,"filter":{"$or":[{"id":"f5d86e4d-747e-4d14-8211-a7acae3d3bcb"},{"$index":"f5d86e4d-747e-4d14-8211-a7acae3d3bcb"}]},"time":"2024-04-03T12:28:17Z","message":"query"}
{"level":"info","type":"type.googleapis.com/session.Session","query":"","offset":0,"limit":1,"filter":{"$or":[{"id":"f5d86e4d-747e-4d14-8211-a7acae3d3bcb"},{"$index":"f5d86e4d-747e-4d14-8211-a7acae3d3bcb"}]},"time":"2024-04-03T12:28:17Z","message":"query"}
{"level":"info","type":"type.googleapis.com/session.Session","query":"","offset":0,"limit":1,"filter":{"$or":[{"id":"f5d86e4d-747e-4d14-8211-a7acae3d3bcb"},{"$index":"f5d86e4d-747e-4d14-8211-a7acae3d3bcb"}]},"time":"2024-04-03T12:28:17Z","message":"query"}
{"level":"info","type":"type.googleapis.com/session.Session","query":"","offset":0,"limit":1,"filter":{"$or":[{"id":"f5d86e4d-747e-4d14-8211-a7acae3d3bcb"},{"$index":"f5d86e4d-747e-4d14-8211-a7acae3d3bcb"}]},"time":"2024-04-03T12:28:17Z","message":"query"}
{"level":"info","type":"type.googleapis.com/session.Session","query":"","offset":0,"limit":1,"filter":{"$or":[{"id":"f5d86e4d-747e-4d14-8211-a7acae3d3bcb"},{"$index":"f5d86e4d-747e-4d14-8211-a7acae3d3bcb"}]},"time":"2024-04-03T12:28:17Z","message":"query"}
{"level":"info","type":"type.googleapis.com/session.Session","query":"","offset":0,"limit":1,"filter":{"$or":[{"id":"f5d86e4d-747e-4d14-8211-a7acae3d3bcb"},{"$index":"f5d86e4d-747e-4d14-8211-a7acae3d3bcb"}]},"time":"2024-04-03T12:28:17Z","message":"query"}
{"level":"info","type":"type.googleapis.com/session.Session","query":"","offset":0,"limit":1,"filter":{"$or":[{"id":"f5d86e4d-747e-4d14-8211-a7acae3d3bcb"},{"$index":"f5d86e4d-747e-4d14-8211-a7acae3d3bcb"}]},"time":"2024-04-03T12:28:17Z","message":"query"}
{"level":"info","type":"type.googleapis.com/session.Session","query":"","offset":0,"limit":1,"filter":{"$or":[{"id":"f5d86e4d-747e-4d14-8211-a7acae3d3bcb"},{"$index":"f5d86e4d-747e-4d14-8211-a7acae3d3bcb"}]},"time":"2024-04-03T12:28:17Z","message":"query"}
{"level":"info","type":"type.googleapis.com/session.Session","query":"","offset":0,"limit":1,"filter":{"$or":[{"id":"f5d86e4d-747e-4d14-8211-a7acae3d3bcb"},{"$index":"f5d86e4d-747e-4d14-8211-a7acae3d3bcb"}]},"time":"2024-04-03T12:28:17Z","message":"query"}
{"level":"info","type":"type.googleapis.com/session.Session","query":"","offset":0,"limit":1,"filter":{"$or":[{"id":"f5d86e4d-747e-4d14-8211-a7acae3d3bcb"},{"$index":"f5d86e4d-747e-4d14-8211-a7acae3d3bcb"}]},"time":"2024-04-03T12:28:17Z","message":"query"}
{"level":"info","service":"envoy","upstream-cluster":"","method":"GET","authority":"ui.axoflow.garden","path":"/api/v1/host-metrics","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36","referer":"https://ui.axoflow.garden/","forwarded-for":"10.244.0.4","request-id":"9f52cfab-bb0c-4ce5-ba27-9634d7e2c68d","duration":20.198708,"size":465,"response-code":401,"response-code-details":"ext_authz_denied","time":"2024-04-03T12:28:17Z","message":"http-request"}
{"level":"info","service":"envoy","upstream-cluster":"","method":"GET","authority":"ui.axoflow.garden","path":"/api/v1/hosts","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36","referer":"https://ui.axoflow.garden/","forwarded-for":"10.244.0.4","request-id":"9db7abcf-fb53-4dc9-a024-700bdd9bce84","duration":22.092334,"size":465,"response-code":401,"response-code-details":"ext_authz_denied","time":"2024-04-03T12:28:17Z","message":"http-request"}
{"level":"info","service":"envoy","upstream-cluster":"","method":"GET","authority":"ui.axoflow.garden","path":"/signin","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36","referer":"https://ui.axoflow.garden/","forwarded-for":"10.244.0.4","request-id":"c804a771-e9b8-401d-aede-ca94959d1779","duration":0,"size":0,"response-code":0,"response-code-details":"http2.remote_reset","time":"2024-04-03T12:28:17Z","message":"http-request"}
Additional context
Add any other context about the problem here.