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

Rename VMs for clarity #407

Merged
merged 4 commits into from Jan 20, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion MANIFEST.in
Expand Up @@ -7,6 +7,6 @@ include LICENSE
include VERSION
include Makefile
include sd-proxy/*
include sd-svs/*
include sd-app/*
include sd-workstation/*
include scripts/*
38 changes: 19 additions & 19 deletions Makefile
Expand Up @@ -16,7 +16,7 @@ dom0-rpm: ## Builds rpm package to be installed on dom0
clone: assert-dom0 ## Pulls the latest repo from work VM to dom0
@./scripts/clone-to-dom0

qubes-rpc: prep-salt ## Places default deny qubes-rpc policies for sd-svs and sd-gpg
qubes-rpc: prep-salt ## Places default deny qubes-rpc policies for sd-app and sd-gpg
sudo qubesctl --show-output --targets sd-dom0-qvm-rpc state.highstate

sd-workstation-template: prep-salt ## Provisions base template for SDW AppVMs
Expand All @@ -31,21 +31,21 @@ sd-gpg: prep-salt ## Provisions SD GPG keystore VM
sudo qubesctl --show-output state.sls sd-gpg
sudo qubesctl --show-output --skip-dom0 --targets sd-workstation-buster-template,sd-gpg state.highstate

sd-svs: prep-salt ## Provisions SD SVS VM
sudo qubesctl --show-output state.sls sd-svs
sudo qubesctl --show-output --skip-dom0 --targets sd-svs-buster-template,sd-svs state.highstate
sd-app: prep-salt ## Provisions SD APP VM
sudo qubesctl --show-output state.sls sd-app
sudo qubesctl --show-output --skip-dom0 --targets sd-app-buster-template,sd-app state.highstate

sd-whonix: prep-salt ## Provisions SD Whonix VM
sudo qubesctl --show-output state.sls sd-whonix
sudo qubesctl --show-output --skip-dom0 --targets sd-whonix-buster-template,sd-whonix state.highstate

sd-svs-disp: prep-salt ## Provisions SD Submission Viewing VM
sudo qubesctl --show-output state.sls sd-svs-disp
sudo qubesctl --show-output --skip-dom0 --targets sd-svs-disp-buster-template,sd-svs-disp state.highstate
sd-viewer: prep-salt ## Provisions SD Submission Viewing VM
sudo qubesctl --show-output state.sls sd-viewer
sudo qubesctl --show-output --skip-dom0 --targets sd-viewer-buster-template,sd-viewer state.highstate

sd-export: prep-salt ## Provisions SD Export VM
sudo qubesctl --show-output state.sls sd-export
sudo qubesctl --show-output --skip-dom0 --targets sd-export-buster-template,sd-export-usb,sd-export-usb-dvm state.highstate
sd-devices: prep-salt ## Provisions SD Export VM
sudo qubesctl --show-output state.sls sd-devices
sudo qubesctl --show-output --skip-dom0 --targets sd-devices-buster-template,sd-devices,sd-devices-dvm state.highstate

sd-log: prep-salt ## Provisions SD logging VM
sudo qubesctl --show-output state.sls sd-log
Expand All @@ -65,21 +65,21 @@ prep-salt: assert-dom0 ## Configures Salt layout for SD workstation VMs
remove-sd-whonix: assert-dom0 ## Destroys SD Whonix VM
@./scripts/destroy-vm sd-whonix

remove-sd-svs-disp: assert-dom0 ## Destroys SD Submission reading VM
@./scripts/destroy-vm sd-svs-disp
remove-sd-viewer: assert-dom0 ## Destroys SD Submission reading VM
@./scripts/destroy-vm sd-viewer

remove-sd-proxy: assert-dom0 ## Destroys SD Proxy VM
@./scripts/destroy-vm sd-proxy

remove-sd-svs: assert-dom0 ## Destroys SD SVS VM
@./scripts/destroy-vm sd-svs
remove-sd-app: assert-dom0 ## Destroys SD APP VM
@./scripts/destroy-vm sd-app

remove-sd-gpg: assert-dom0 ## Destroys SD GPG keystore VM
@./scripts/destroy-vm sd-gpg

remove-sd-export: assert-dom0 ## Destroys SD EXPORT VMs
@./scripts/destroy-vm sd-export-usb
@./scripts/destroy-vm sd-export-usb-dvm
remove-sd-devices: assert-dom0 ## Destroys SD EXPORT VMs
@./scripts/destroy-vm sd-devices
@./scripts/destroy-vm sd-devices-dvm

remove-sd-log: assert-dom0 ## Destroys SD logging VM
@./scripts/destroy-vm sd-log
Expand All @@ -96,8 +96,8 @@ test: assert-dom0 ## Runs all application tests (no integration tests yet)
test-base: assert-dom0 ## Runs tests for VMs layout
python3 -m unittest -v tests.test_vms_exist.SD_VM_Tests

test-svs: assert-dom0 ## Runs tests for SD SVS VM config
python3 -m unittest -v tests.test_svs.SD_SVS_Tests
test-app: assert-dom0 ## Runs tests for SD APP VM config
python3 -m unittest -v tests.test_app.SD_App_Tests

test-proxy: assert-dom0 ## Runs tests for SD Proxy VM
python3 -m unittest -v tests.test_proxy_vm
Expand Down
152 changes: 37 additions & 115 deletions README.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dom0/sd-svs-config.sls → dom0/sd-app-config.sls
@@ -1,22 +1,22 @@
# -*- coding: utf-8 -*-
# vim: set syntax=yaml ts=2 sw=2 sts=2 et :
##
# sd-svs-config
# sd-app-config
# ========
#
# Moves files into place on sd-svs
# Moves files into place on sd-app
#
#

# populate config.json for sd-svs. This contains the journalist_key_fingerprint
# populate config.json for sd-app. This contains the journalist_key_fingerprint
# used to encrypt replies

{% import_json "sd/config.json" as d %}

install-securedrop-proxy-yaml-config:
file.managed:
- name: /home/user/.securedrop_client/config.json
- source: salt://sd/sd-svs/config.json.j2
- source: salt://sd/sd-app/config.json.j2
- template: jinja
- context:
submission_fpr: {{ d.submission_key_fpr}}
Expand Down
4 changes: 2 additions & 2 deletions dom0/sd-svs-files.sls → dom0/sd-app-files.sls
Expand Up @@ -2,10 +2,10 @@
# vim: set syntax=yaml ts=2 sw=2 sts=2 et :

##
# sd-svs-files
# sd-app-files
# ========
#
# Moves files into place on sd-svs-template
# Moves files into place on sd-app-template
#
##
include:
Expand Down
24 changes: 12 additions & 12 deletions dom0/sd-svs.sls → dom0/sd-app.sls
Expand Up @@ -5,16 +5,16 @@
# qvm.work
# ========
#
# Installs 'sd-svs' AppVM, to persistently store SD data
# Installs 'sd-app' AppVM, to persistently store SD data
# This VM has no network configured.
##
include:
- sd-workstation-template
- sd-upgrade-templates

sd-svs-template:
sd-app-template:
qvm.vm:
- name: sd-svs-buster-template
- name: sd-app-buster-template
- clone:
- source: securedrop-workstation-buster
- label: yellow
Expand All @@ -27,13 +27,13 @@ sd-svs-template:
- sls: sd-workstation-template
- sls: sd-upgrade-templates

sd-svs:
sd-app:
qvm.vm:
- name: sd-svs
- name: sd-app
- present:
- label: yellow
- prefs:
- template: sd-svs-buster-template
- template: sd-app-buster-template
- netvm: ""
- tags:
- add:
Expand All @@ -43,16 +43,16 @@ sd-svs:
- enable:
- service.paxctld
- require:
- qvm: sd-svs-buster-template
- qvm: sd-app-buster-template

# Ensure the Qubes menu is populated with relevant app entries,
# so that Nautilus/Files can be started via GUI interactions.
sd-svs-template-sync-appmenus:
sd-app-template-sync-appmenus:
cmd.run:
- name: >
qvm-start --skip-if-running sd-svs-buster-template &&
qvm-sync-appmenus sd-svs-buster-template
qvm-start --skip-if-running sd-app-buster-template &&
qvm-sync-appmenus sd-app-buster-template
- require:
- qvm: sd-svs-buster-template
- qvm: sd-app-buster-template
- onchanges:
- qvm: sd-svs-buster-template
- qvm: sd-app-buster-template
8 changes: 4 additions & 4 deletions dom0/sd-export-files.sls → dom0/sd-devices-files.sls
Expand Up @@ -2,17 +2,17 @@
# vim: set syntax=yaml ts=2 sw=2 sts=2 et :

##
# sd-export-files
# sd-devices-files
# ========
#
# Moves files into place on sd-export
# Moves files into place on sd-devices
#
##
include:
- fpf-apt-test-repo

# Libreoffice needs to be installed here to convert to pdf to allow printing
sd-export-install-libreoffice:
sd-devices-install-libreoffice:
pkg.installed:
- name: libreoffice
- retry:
Expand All @@ -21,6 +21,6 @@ sd-export-install-libreoffice:
- install_recommends: False

# Install securedrop-export package https://github.com/freedomofpress/securedrop-export
sd-export-install-package:
sd-devices-install-package:
pkg.installed:
- name: securedrop-export
34 changes: 17 additions & 17 deletions dom0/sd-export.sls → dom0/sd-devices.sls
Expand Up @@ -2,16 +2,16 @@
# vim: set syntax=yaml ts=2 sw=2 sts=2 et :

#
# Installs 'sd-export' AppVM, to persistently store SD data
# Installs 'sd-devices' AppVM, to persistently store SD data
# This VM has no network configured.
##
include:
- sd-workstation-template
- sd-upgrade-templates

sd-export-template:
sd-devices-template:
qvm.vm:
- name: sd-export-buster-template
- name: sd-devices-buster-template
- clone:
- source: securedrop-workstation-buster
- label: red
Expand All @@ -23,14 +23,14 @@ sd-export-template:
- sls: sd-workstation-template
- sls: sd-upgrade-templates

sd-export-usb-dvm:
sd-devices-dvm:
qvm.vm:
- name: sd-export-usb-dvm
- name: sd-devices-dvm
- present:
- template: sd-export-buster-template
- template: sd-devices-buster-template
- label: red
- prefs:
- template: sd-export-buster-template
- template: sd-devices-buster-template
- netvm: ""
- template_for_dispvms: True
- tags:
Expand All @@ -41,29 +41,29 @@ sd-export-usb-dvm:
- enable:
- service.paxctld
- require:
- qvm: sd-export-buster-template
- qvm: sd-devices-buster-template

# Ensure the Qubes menu is populated with relevant app entries,
# so that Nautilus/Files can be started via GUI interactions.
sd-export-template-sync-appmenus:
sd-devices-template-sync-appmenus:
cmd.run:
- name: >
qvm-start --skip-if-running sd-export-buster-template &&
qvm-sync-appmenus sd-export-buster-template
qvm-start --skip-if-running sd-devices-buster-template &&
qvm-sync-appmenus sd-devices-buster-template
- require:
- qvm: sd-export-buster-template
- qvm: sd-devices-buster-template
- onchanges:
- qvm: sd-export-buster-template
- qvm: sd-devices-buster-template

sd-export-create-named-dispvm:
sd-devices-create-named-dispvm:
qvm.vm:
- name: sd-export-usb
- name: sd-devices
- present:
- template: sd-export-usb-dvm
- template: sd-devices-dvm
- class: DispVM
- label: red
- tags:
- add:
- sd-workstation
- require:
- qvm: sd-export-usb-dvm
- qvm: sd-devices-dvm
4 changes: 2 additions & 2 deletions dom0/sd-dom0-qvm-rpc.sls
Expand Up @@ -45,8 +45,8 @@ dom0-rpc-qubes.OpenInVM:
- marker_start: "### BEGIN securedrop-workstation ###"
- marker_end: "### END securedrop-workstation ###"
- content: |
@tag:sd-client @dispvm:sd-svs-disp allow
@tag:sd-client sd-export-usb allow
@tag:sd-client @dispvm:sd-viewer allow
@tag:sd-client sd-devices allow
@anyvm @tag:sd-workstation deny
@tag:sd-workstation @anyvm deny
dom0-rpc-qubes.OpenURL:
Expand Down
2 changes: 1 addition & 1 deletion dom0/sd-proxy.sls
Expand Up @@ -48,5 +48,5 @@ sd-proxy-dom0-securedrop.Proxy:
file.prepend:
- name: /etc/qubes-rpc/policy/securedrop.Proxy
- text: |
sd-svs sd-proxy allow
sd-app sd-proxy allow
@anyvm @anyvm deny
8 changes: 4 additions & 4 deletions dom0/sd-svs-disp-files.sls → dom0/sd-viewer-files.sls
Expand Up @@ -2,26 +2,26 @@
# vim: set syntax=yaml ts=2 sw=2 sts=2 et :

##
# sd-svs-disp-files
# sd-viewer-files
# ========
#
# Installs configuration packages specific to the SVS DispVM,
# Installs configuration packages specific to the Viewer DispVM,
# used for opening submissions.
#
##

include:
- fpf-apt-test-repo

sd-svs-disp-install-mimetype-handler-package:
sd-viewer-install-mimetype-handler-package:
pkg.installed:
- pkgs:
- securedrop-workstation-svs-disp
- evince
- require:
- sls: fpf-apt-test-repo

sd-svs-disp-install-libreoffice:
sd-viewer-install-libreoffice:
pkg.installed:
- name: libreoffice
- retry:
Expand Down