Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uses grsecurity-patched kernels for all templates #169

Merged
merged 2 commits into from
Oct 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ prep-salt: assert-dom0 ## Configures Salt layout for SD workstation VMs
@sudo cp sd-journalist.sec /srv/salt/sd
@sudo cp -r sd-journalist /srv/salt/sd
@sudo cp -r sd-svs /srv/salt/sd
@sudo cp -r sd-workstation /srv/salt/sd
@sudo cp dom0/* /srv/salt/
#sudo cp -r sd-svs-disp /srv/salt/sd # nothing there yet...

Expand Down
9 changes: 7 additions & 2 deletions dom0/sd-workstation-template-files.sls
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# -*- coding: utf-8 -*-
# vim: set syntax=yaml ts=2 sw=2 sts=2 et :

configure apt-test apt repo:
pkgrepo.managed:
- name: "deb [arch=amd64] https://apt-test-qubes.freedom.press stretch main"
- file: /etc/apt/sources.list.d/fpf-apt-test.list
- key_url: "salt://sd/sd-workstation/apt-test-pubkey.asc"

configure mimetype support for debian9:
pkg.installed:
- pkgs:
- gvfs-bin
- libgnomevfs2-bin
- securedrop-workstation-config
- securedrop-workstation-grsec
5 changes: 3 additions & 2 deletions dom0/sd-workstation-template.sls
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ sd-workstation-template:
- clone:
- source: debian-9
- label: yellow


- prefs:
- virt-mode: hvm
- kernel: ''
30 changes: 30 additions & 0 deletions sd-workstation/apt-test-pubkey.asc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
-----BEGIN PGP PUBLIC KEY B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14M34Jm5G91c/dj9zHtVwkLg4RG/rcumQdlpQhNmMycB2X
lat48atmEkutfLEQizXIlgiCdNEpgfUBy/jZZcCOjwr8PUPmSUWjKOVMv6CSLx8K
z2cP4We7tyq4qhc0cWjJOWOmJpu5tbmi6XEEWGaIJyN+POhHEcb0tI1rTJ88nrMb
DI/NF/35kuWIIkADOb2vABEBAAGJATYEGAEIACAWIQRO15zDNi19EoNwRgJKO+Sp
IhGwPAUCWE8ZmwIbDAAKCRBKO+SpIhGwPC3fB/0TfuScS718FiEcVRI3F2wBbzTQ
VARhGzEvPSU5Z3Cur/EB8ihpWvwi39tUMeg5HTheDl/8A7f1QCjIFSVEr1slGNLh
YFF07XGWhy837z6kiihK2z6/w6Q9QJqjE+QVZCKr97aIPejvEoHoslZTU5pJ52qF
J7KQd1hEvVs00DxY6VlyK0FzXqByKYq6Arl2tzlCZ6RPEHKXV2xSP06jLEagzgYe
DylVo9Xahenj4n/Mtq7Am6tGgU9Vy9cGbWNBdUND/mFQEEZSh9RJabPeluH12sir
5/tfsDr4DGHSz7ws+5M6Zbk6oNJEwQZ4cR+81qCfXE5X5LW1KlAL8wDl7dfS
=fYUi
-----END PGP PUBLIC KEY BLOCK-----
27 changes: 27 additions & 0 deletions tests/test_vms_exist.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
from base import WANTED_VMS


EXPECTED_KERNEL_VERSION = "4.14.74-grsec"


class SD_VM_Tests(unittest.TestCase):
def setUp(self):
self.app = Qubes()
Expand All @@ -16,6 +19,21 @@ def test_expected(self):
for test_vm in WANTED_VMS:
self.assertTrue(test_vm in vm_set)

def _check_kernel(self, vm):
"""
Confirms expected grsecurity-patched kernel is running.
"""
# Running custom kernel requires HVM with empty kernel
self.assertTrue(vm.virt_mode == "hvm")
self.assertTrue(vm.kernel == "")

# Check exact kernel version in VM
raw_output = vm.run("uname -r")
# Response is a tuple of e.g. ('4.14.74-grsec\n', '')
kernel_version = raw_output[0].rstrip()
assert kernel_version.endswith("-grsec")
assert kernel_version == EXPECTED_KERNEL_VERSION

def test_sd_whonix_config(self):
vm = self.app.domains["sd-whonix"]
nvm = vm.netvm
Expand All @@ -39,6 +57,7 @@ def test_sd_svs_config(self):
self.assertTrue(vm.template == "sd-svs-template")
self.assertFalse(vm.provides_network)
self.assertFalse(vm.template_for_dispvms)
self._check_kernel(vm)

def test_sd_svs_disp_config(self):
vm = self.app.domains["sd-svs-disp"]
Expand All @@ -47,6 +66,7 @@ def test_sd_svs_disp_config(self):
self.assertTrue(vm.template == "sd-svs-disp-template")
self.assertFalse(vm.provides_network)
self.assertTrue(vm.template_for_dispvms)
self._check_kernel(vm)

def test_sd_gpg_config(self):
vm = self.app.domains["sd-gpg"]
Expand All @@ -56,6 +76,13 @@ def test_sd_gpg_config(self):
self.assertTrue(vm.template == "sd-workstation-template")
self.assertFalse(vm.provides_network)
self.assertFalse(vm.template_for_dispvms)
self._check_kernel(vm)

def test_sd_workstation_template(self):
vm = self.app.domains["sd-workstation-template"]
nvm = vm.netvm
self.assertTrue(nvm is None)
self._check_kernel(vm)


def load_tests(loader, tests, pattern):
Expand Down