Is the same API user doing the POST to /1.0/instances/NAME/console and then connecting to the websocket? We did add tighter security around that a little while back to prevent someone from monitoring the background operations and then connecting to it before the requestor gets to it.
Not same.
All done from within a container, aiming at Incus host internal IP (10.0.4.1:8443, 192.168.1.1:8443, even tried server public IP or server https://serverdoamin:8443 with SSL).
Post done by nginx, php as webuser (www-data, user 1000100 on host), websocket connection runs from same container as root (user 1000000 on host).
Websocket was node wss://
I also tried using an nginx proxy httpupgrade (websocket) as alternative, that has failed too. I guess the nginx wss:// would have been the same user (www-data) as POST requester.
The check makes sure that the requestor credential matches for those API routes.
It checks that the username and protocol is the same.
Basically run incus info | grep ^auth_user in both environments, if the result is the same, then you won’t have a problem with the check, if you’re getting different values, then you are trying to access another user’s operations and the security check will block you.
For example, if you create the operation using the unix socket as the root user, you’ll have protocol=unix user=root, if you then access it over the network using an HTTPS client certificate, you’ll get protocol=tls user=FINGERPRINT, that won’t work.
If you connect using OIDC authentication, you’ll get protocol=oidc user=USERNAME.
And if you’re using two different system users with the same unix socket, then you’ll both get protoocl=unix but username= will be different.
It is a little bit difficult to achieve, I probabely don’t get the concept fully.
Incus is running on host, web application in a container, a incus info | grep ^auth_user not possible inside container.
Operation created by webuser (nginx) as PHP Curl, user nginx (1000100 on host), streams transported by node server, can be nginx (1000100), still possible to run as root (1000000).
From Container to host, there is no way of Unix socket, all over TCP, Operation https://hostip:8443, Terminal proxied wss://hostip:8443.
So, either way result might be protocol=tls user=FINGERPRINT, but I guess with different fingerprints. Can’t trace on Incus host who (unix user or Fingerprint) exactly triggers the operation and/or the subsequent websocket.
Could try OIDC, but it will add one more complexity, dealing with Incus OIDC, PHP/WSS OIDC authentication and the OIDC (Server) Client profile definition.