Hi everyone,
I am onboarding quite a few database instances to Boundary, and it’s using a Credential store from Vault.
All is good apart from when it’s not
I don’t know what I could be missing, but now that I have onboarded a few, I am seeing this weird behaviour that sometimes the proxying works and sometimes it does not, even with the same database target instance, and the same worker.
It seems to me completely random and I don’t understand why.
For instance, this is for the same worker, and the same database target, just a few minutes apart.
When credentials work (using the proxy) I can connect normally to localhost and get to the target and I get this in the worker logs:
Aug 17 14:30:23 ip-10-237-94-12.eu-central-1.compute.internal boundary[15126]: {“id”:“HMRhFndKcK”,“source”:“https://hashicorp.com/boundary/ip-10-237-94-12.eu-central-1.compute.internal/worker",“specversion”:“1.0”,“type”:“system”,“data”:{“version”:“v0.1”,“op”:“worker.(Worker).handleProxy”,“data”:{“msg”:"session successfully activated”,“session_id”:“s_FdVxLITvXH”}},“datacontentype”:“application/cloudevents”,“time”:“2022-08-17T14:30:23.570402091Z”}
Aug 17 14:30:23 ip-10-237-94-12.eu-central-1.compute.internal boundary[15126]: {“id”:“NonPiBuRSk”,“source”:“https://hashicorp.com/boundary/ip-10-237-94-12.eu-central-1.compute.internal/worker",“specversion”:“1.0”,“type”:“system”,“data”:{“version”:“v0.1”,“op”:“worker.(Worker).handleProxy”,“data”:{“connection_id”:“sc_QUtIu7KJiQ”,“msg”:"connection successfully authorized”,“session_id”:“s_FdVxLITvXH”}},“datacontentype”:“application/cloudevents”,“time”:“2022-08-17T14:30:23.583013302Z”}
When not, when doing the same on the mysql cli client:
ERROR 1045 (28000): Access denied for user ‘v-token-toke-ase-Ixr24szF8LFeYVy’@‘10.237.94.12’ (using password: YES)
And the worker logs:
Aug 17 14:31:53 ip-10-237-94-12.eu-central-1.compute.internal boundary[15126]: {“id”:“OdFGfgi1bm”,“source”:“https://hashicorp.com/boundary/ip-10-237-94-12.eu-central-1.compute.internal/worker",“specversion”:“1.0”,“type”:“system”,“data”:{“version”:“v0.1”,“op”:“worker.(Worker).handleProxy”,“data”:{“msg”:"session successfully activated”,“session_id”:“s_jbhBV2zAkm”}},“datacontentype”:“application/cloudevents”,“time”:“2022-08-17T14:31:53.938718247Z”}
Aug 17 14:31:53 ip-10-237-94-12.eu-central-1.compute.internal boundary[15126]: {“id”:“icPAzPi11y”,“source”:“https://hashicorp.com/boundary/ip-10-237-94-12.eu-central-1.compute.internal/worker",“specversion”:“1.0”,“type”:“system”,“data”:{“version”:“v0.1”,“op”:“worker.(Worker).handleProxy”,“data”:{“connection_id”:“sc_usjcqRpItA”,“msg”:"connection successfully authorized”,“session_id”:“s_jbhBV2zAkm”}},“datacontentype”:“application/cloudevents”,“time”:“2022-08-17T14:31:53.980205045Z”}
Aug 17 14:31:54 ip-10-237-94-12.eu-central-1.compute.internal boundary[15126]: {“id”:“1aL7cpgisd”,“source”:“https://hashicorp.com/boundary/ip-10-237-94-12.eu-central-1.compute.internal/worker",“specversion”:“1.0”,“type”:“system”,“data”:{“version”:“v0.1”,“op”:“worker.(Worker).handleProxy”,“data”:{“connection_id”:“sc_usjcqRpItA”,“msg”:"connection closed”,“session_id”:“s_jbhBV2zAkm”}},“datacontentype”:“application/cloudevents”,“time”:“2022-08-17T14:31:54.295401486Z”}
The funny part is that if I go to the worker and from there connect directly to the instance using the credentials generated by Vault, I can connect normally. The generated user is there (with @‘%’). I just can’t when connecting from the proxy, and that happens completely randomly. Sometimes the credentials work when proxying through Boundary, sometimes they don’t, using the exact same target. Not using Boundary, the credentials work. The user is created in the database by Vault and I can connect using it, just not using the created Boundary session.
I’m quite puzzled. Does anyone know what could happening?
Thanks