Skip to content

Commit

Permalink
templatevm: set default netvm to None for templates
Browse files Browse the repository at this point in the history
Since we have qrexec-based updates proxy, we can even stronger isolate
templates from outside threats.

QubesOS/qubes-issues#1854
  • Loading branch information
marmarek committed Jun 5, 2017
1 parent 1ed0b14 commit d5cd58d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions qubes/vm/templatevm.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import qubes
import qubes.config
import qubes.vm.qubesvm
import qubes.vm.mix.net
from qubes.config import defaults
from qubes.vm.qubesvm import QubesVM

Expand All @@ -52,6 +53,13 @@ def appvms(self):
if hasattr(vm, 'template') and vm.template is self:
yield vm

netvm = qubes.VMProperty('netvm', load_stage=4, allow_none=True,
default=None,
# pylint: disable=protected-access
setter=qubes.vm.qubesvm.QubesVM.netvm._setter,
doc='VM that provides network connection to this domain. When '
'`None`, machine is disconnected.')

def __init__(self, *args, **kwargs):
assert 'template' not in kwargs, "A TemplateVM can not have a template"
self.volume_config = {
Expand Down

0 comments on commit d5cd58d

Please sign in to comment.