Skip to content
Snippets Groups Projects
  • Daniel P. Berrangé's avatar
    00019455
    nbd: allow authorization with nbd-server-start QMP command · 00019455
    Daniel P. Berrangé authored
    
    As with the previous patch to qemu-nbd, the nbd-server-start QMP command
    also needs to be able to specify authorization when enabling TLS encryption.
    
    First the client must create a QAuthZ object instance using the
    'object-add' command:
    
       {
         'execute': 'object-add',
         'arguments': {
           'qom-type': 'authz-list',
           'id': 'authz0',
           'parameters': {
             'policy': 'deny',
             'rules': [
               {
                 'match': '*CN=fred',
                 'policy': 'allow'
               }
             ]
           }
         }
       }
    
    They can then reference this in the new 'tls-authz' parameter when
    executing the 'nbd-server-start' command:
    
       {
         'execute': 'nbd-server-start',
         'arguments': {
           'addr': {
               'type': 'inet',
               'host': '127.0.0.1',
               'port': '9000'
           },
           'tls-creds': 'tls0',
           'tls-authz': 'authz0'
         }
       }
    
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
    Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
    Message-Id: <20190227162035.18543-3-berrange@redhat.com>
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
    00019455
    History
    nbd: allow authorization with nbd-server-start QMP command
    Daniel P. Berrangé authored
    
    As with the previous patch to qemu-nbd, the nbd-server-start QMP command
    also needs to be able to specify authorization when enabling TLS encryption.
    
    First the client must create a QAuthZ object instance using the
    'object-add' command:
    
       {
         'execute': 'object-add',
         'arguments': {
           'qom-type': 'authz-list',
           'id': 'authz0',
           'parameters': {
             'policy': 'deny',
             'rules': [
               {
                 'match': '*CN=fred',
                 'policy': 'allow'
               }
             ]
           }
         }
       }
    
    They can then reference this in the new 'tls-authz' parameter when
    executing the 'nbd-server-start' command:
    
       {
         'execute': 'nbd-server-start',
         'arguments': {
           'addr': {
               'type': 'inet',
               'host': '127.0.0.1',
               'port': '9000'
           },
           'tls-creds': 'tls0',
           'tls-authz': 'authz0'
         }
       }
    
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
    Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
    Message-Id: <20190227162035.18543-3-berrange@redhat.com>
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>