Hi team, I'm stuck authenticating to my self-hosted infisical instance. I have it sitting in azure behind a load balancer. I can log through the browser just fine, the problem occurs when I set up a machine identity. I set the identity up using Universal auth and I assigned a client secret to it. I also assigned that identity to my project. I'm now trying to use this identity in terraform like this:
provider "infisical" {
host = "https://
my-hostname"
auth = {
universal = {
client_id = var.INFISICAL_CLIENT_ID
client_secret = var.INFISICAL_CLIENT_SECRET
}
}
}
passing the client id and secret in through environment variables. However, when I run terraform plan, I get this error:
│ Error: Unable to Create Infisical API Client
│
│ with provider["
registry.terraform.io/infisical/infisical"],
│ on main.tf line 47, in provider "infisical":
│ 47: provider "infisical" {
│
│ An unexpected error occurred when creating the Infisical API client. If the error is not
│ clear, please get in touch at
infisical.com/slack.
│
│ Infisical Client Error: unable to authenticate with machine identity
│ [err=CallUniversalMachineIdentityAuth Unsuccessful response [POST
│ https://
my-infisicial-instance's-hostname/api/v1/auth/universal-auth/login] [status-code=500]
│ [request-id=req-RtO8SWLTnLN4lv] [message="Something went wrong"]]
╵
Looking into the log, the error produced in the backend reads:
{"level":50,"time":1756731380573,"pid":22,"hostname":"SandboxHost-638919883906790972","reqId":"req-jRXl2U9TQxzyfW","severity":"ERROR","err":{"type":"Error","message":"Failed to extract IP details","stack":"Error: Failed to extract IP details\n at extractIPDetails (/backend/src/lib/ip/index.ts
3913)\n at checkIPAgainstBlocklist (/backend/src/lib/ip/index.ts
12920)\n at Object.login (/backend/src/services/identity-ua/identity-ua-service.ts
685)\n at process.processTicksAndRejections (node
internal/process/task queues95:5)\n at async Object.handler (/backend/src/server/routes/v1/identity-universal-auth-router.ts
5811)"},"msg":"Failed to extract IP details"}
It seems that infisical wants to make sure that I'm logging in over a trusted IP address. But this shouldn't be happening: it was my understanding that the free plan of infisical (which I am using) per default allows any IP addressin the range 0.0.0.0/0.
What am I missing here? I'm running the infisical image v0.147.0 and the terraform provider version 0.15.32
EDIT:
Apparently this is a known problem?
https://github.com/Infisical/infisical/issues/3517