On Fri, Dec 16, 2016 at 1:42 AM, Buddhi Madhav <buddhi.mad...@veritas.com> wrote: > Does this authentication scheme works? > > 1) Pass the encrypted password to qemu-kvm as follows: > > # . /qemu-io --object secret,id=secmaster0,format=base64,file=key.b64 > --object > secret,id=password-secret,keyid=secmaster0,file=pw.aes,iv=$(<iv.b64) > > 2) QEMU process will decrypt the password. (call > qcrypto_secret_lookup_as_utf8()).
I'm not sure if AES encrypting the password secret file adds anything. If an attacker is able to read pw.aes they can also read key.b64 and see the initialization vector on the command-line (using ps(1)). Therefore they would be able to decrypt the password. The main benefit of using -object secret,file= is to limit access to the secret via UNIX file permissions and to prevent exposing the secret on the command-line. You get those benefits without AES: --object secret,id=password-secret,file=pw Dan: Am I missing something? > 3) For every disk open, QEMU process sends VM ID, vdisk ID, and decrypted > password. Hyperscale server > validates the password, and sends back the access token(unique 32bit ID). Two issues: 1. This is secure only if the transport offers confidentiality (e.g. encryption over TCP). Otherwise an attacker can intercept the traffic and steal the decrypted password. 2. This is secure only if the client authenticates the server. Otherwise the server could be a man-in-the-middle that steals the password. Your scheme is secure over AF_UNIX where the UNIX domain socket is located in a directory where only the real server process has permission to create files. AF_UNIX cannot be intercepted by external attackers or unprivileged users, so the transport offers confidentiality. This scheme is not secure over TCP/IP/Ethernet since the server is not being authenticated and there is no confidentiality. Are there network protocol and security folks at Veritas who can advise you? This isn't a QEMU-specific issue, it's a VxHS network protocol issue. You need to choose a modern, secure approach to networking. Stefan