Hello!
I develop an internal web service for my team, where each user can create a VM from templates.
The panel is hosted on a domain
Also we have 3+ proxmox servers, each of them has a domain name like
Well. I created a user
My script get a ticket for this user and save it as cookie =>
Then the script sends =>
And as a result the script create an iframe
Well, everything is ok. It works.
But. I can't understand some things.
1) We can't use only vncticket, we have to create and set a cookie. Is it right?
2) If we set a cookie, an user can open proxmox domain and he/she will be logined there (because his browser stil has a cookie)
3) Why do we need use vncticket? I checked some links and each of them give me access to the VM via noVNC
4) Proxmox can't generate a secret for vmid, can it? I changed vmid in url and get access to other VM
I'd like to have a unique url for VM
I suspect the last two things are because I'm set cookies on the first step
I develop an internal web service for my team, where each user can create a VM from templates.
The panel is hosted on a domain
panel.example.com
Also we have 3+ proxmox servers, each of them has a domain name like
pr-N.panel.example.com
Well. I created a user
vnc
with permissions VM.Audit VM.Console VM.PowerMgmt
My script get a ticket for this user and save it as cookie =>
POST to /access/ticket
Code:
PVE:vnc@pve:653EA581::dxh+tfxaF4E6HxGS4VP96jA7i2mxtO6etVADObsv1WWOeAUd3nxEbFWoybPfedrFu38JQoO9T8HpZCywWX+bWM25yrq1EcbQ4/FWgT0a7MzNEwVJVkWCIV7TiNknIalILnX5xFSdnMX9XyRCHgA5K8SDJAfFNG4Hnyy6xyNfmhbur8nonG6W1XMyeS+MQMLFfBr7z7I4s7Di+YYdHMgvMkm1U6w3H9m4NvUdy/Ptn9vvpR+v5iRvYireFxJI1X5lU3aGBEZ0sqQ15L+eFDdTzG3HgIbimPzmid+7h1CvY+Z95EF9LnPOwFUEMZSb3zyEUWFC/Gf+eBRAWE75+JdBDg==
Then the script sends =>
POST /nodes/{node}/qemu/{vm_id}/vncproxy
, GET /nodes/{node}/qemu/{vm_id}/vncwebsocket?vncticket=xxxx&port=xxxxx
And as a result the script create an iframe
Code:
https://pr-0.panel.example.com/?console=kvm&novnc=1&node={node}&resize=1&vmid={vm_id}&path=api2/json/nodes/{node}/qemu/{vm_id}/vncwebsocket?port={vnc_port}&vncticket={vnc_ticket}
Well, everything is ok. It works.
But. I can't understand some things.
1) We can't use only vncticket, we have to create and set a cookie. Is it right?
2) If we set a cookie, an user can open proxmox domain and he/she will be logined there (because his browser stil has a cookie)
3) Why do we need use vncticket? I checked some links and each of them give me access to the VM via noVNC
Code:
https://pr-0.panel.example.com/?console=kvm&novnc=1&node=node0&resize=1&vmid=11192&path=api2%2Fjson%2Fnodes%2Fnode0%2Fqemu%2F11192%2Fvncwebsocket%3Fvncwebsocket%3Fport%3D5900%26vncticket%3DK%2F%60%5E4%29K%2B
https://pr-0.panel.example.com/?console=kvm&novnc=1&node=node0&resize=1&vmid=11192&path=api2%2Fjson%2Fnodes%2Fnode0%2Fqemu%2F11192%2Fvncwebsocket%3Fvncwebsocket%3Fport%3D5900%26
https://pr-0.panel.example.com/?console=kvm&novnc=1&node=node0&resize=1&vmid=11192&path=
4) Proxmox can't generate a secret for vmid, can it? I changed vmid in url and get access to other VM
Code:
https://pr-0.panel.example.com/?console=kvm&novnc=1&node=node0&resize=1&vmid=11192&path=api2%2Fjson%2Fnodes%2Fnode0%2Fqemu%2F11192%2Fvncwebsocket%3Fvncwebsocket%3Fport%3D5900%26vncticket%3DK%2F%60%5E4%29K%2B
https://pr-0.panel.example.com/?console=kvm&novnc=1&node=node0&resize=1&vmid=11193&path=api2%2Fjson%2Fnodes%2Fnode0%2Fqemu%2F11192%2Fvncwebsocket%3Fvncwebsocket%3Fport%3D5900%26vncticket%3DK%2F%60%5E4%29K%2B
https://pr-0.panel.example.com/?console=kvm&novnc=1&node=node0&resize=1&vmid=11194&path=api2%2Fjson%2Fnodes%2Fnode0%2Fqemu%2F11192%2Fvncwebsocket%3Fvncwebsocket%3Fport%3D5900%26vncticket%3DK%2F%60%5E4%29K%2B
I suspect the last two things are because I'm set cookies on the first step