Skip to content

Commit

Permalink
Cleans up with comments and better way to remove package
Browse files Browse the repository at this point in the history
`make clean` now cleans whonix-gw-15 with proper removal of
`securedrop-log` package using Salt states.
  • Loading branch information
kushaldas committed Feb 19, 2020
1 parent c243d7b commit 232c56f
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 18 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ remove-sd-log: assert-dom0 ## Destroys SD logging VM
clean: assert-dom0 prep-salt ## Destroys all SD VMs
sudo qubesctl --show-output state.sls sd-clean-default-dispvm
$(MAKE) destroy-all
sudo qubesctl --show-output --skip-dom0 --targets whonix-gw-15 state.sls sd-clean-whonix
sudo qubesctl --show-output state.sls sd-clean-all
sudo dnf -y -q remove securedrop-workstation-dom0-config 2>/dev/null || true
$(MAKE) clean-salt
Expand Down
9 changes: 2 additions & 7 deletions dom0/sd-app-files.sls
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,15 @@ include:
- fpf-apt-test-repo

# FPF repo is setup in "securedrop-workstation" template
install-securedrop-client-package:
install-securedrop-client-and-securedrop-log-package:
pkg.installed:
- pkgs:
- securedrop-client
- require:
- sls: fpf-apt-test-repo

install-securedrop-log-package:
pkg.installed:
- pkgs:
- securedrop-log
- require:
- sls: fpf-apt-test-repo


sd-rsyslog-for-sd-app:
file.managed:
- name: /etc/sd-rsyslog.conf
Expand Down
2 changes: 1 addition & 1 deletion dom0/sd-clean-all.sls
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ sd-cleanup-whonix-gw-15:
- names:
- qvm-run whonix-gw-15 'sudo rm -f /etc/rsyslog.d/sdlog.conf'
- qvm-run whonix-gw-15 'sudo rm -f /etc/apt/sources.list.d/securedrop_workstation.list'
- qvm-run whonix-gw-15 'sudo apt remove -y securedrop-log'
- qvm-run whonix-gw-15 'sudo systemctl restart rsyslog'
- qvm-run whonix-gw-15 'sudo apt-key del 4ED79CC3362D7D12837046024A3BE4A92211B03C'
- qvm-run whonix-gw-15 'sudo apt-key del 22245C81E3BAEB4138B36061310F561200F4AD77'



Expand Down
11 changes: 11 additions & 0 deletions dom0/sd-clean-whonix.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# -*- coding: utf-8 -*-
# vim: set syntax=yaml ts=2 sw=2 sts=2 et :

##
# removes securedrop-log rsyslog plugin in whonix-gw-15
##

remove-securedrop-log-package-from-whonix:
pkg.removed:
- pkgs:
- securedrop-log
2 changes: 1 addition & 1 deletion dom0/sd-log-template-files.sls
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
include:
- fpf-apt-test-repo

install-securedrop-log-package:
sd-log-install-securedrop-log-package:
pkg.installed:
- pkgs:
- redis-server
Expand Down
9 changes: 2 additions & 7 deletions dom0/sd-proxy-template-files.sls
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,15 @@ sd-proxy-configure-mimetypes:

# Depends on FPF-controlled apt repo, already present
# in underlying "securedrop-workstation" base template.
install-securedrop-proxy-package:
install-securedrop-proxy-and-securedrop-log-package:
pkg.installed:
- pkgs:
- securedrop-proxy
- require:
- sls: fpf-apt-test-repo

install-securedrop-log-package:
pkg.installed:
- pkgs:
- securedrop-log
- require:
- sls: fpf-apt-test-repo


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

install-securedrop-proxy-yaml-config:
Expand Down
6 changes: 6 additions & 0 deletions dom0/sd-whonix-rsyslog-enable.sls
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,17 @@ sd-rsyslog-for-sd-whonix:
- context:
vmname: sd-whonix


# We can not place the file on the template under /etc/rsyslog.d/ because of whonix
# template. This sdlog.conf file is the same from the securedrop-log package, to
# make sure that rsyslogd use our logging plugin.
sd-rsyslog-sdlog-conf-for-sd-whonix:
file.managed:
- name: /rw/config/sdlog.conf
- source: "salt://sdlog.conf"

# Because whonix-gw-15 template is not allowing to create the config file on
# package install time, we do it via rc.local call.
sd-rc-enable-logging:
file.blockreplace:
- name: /rw/config/rc.local
Expand Down
4 changes: 2 additions & 2 deletions scripts/provision-all
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ echo "Setup sd-log-buster-template vm first"
sudo qubesctl --show-output --skip-dom0 --targets sd-log-buster-template state.highstate
# Provision whonix-gw-15 with log additions because it isn't tagged with sd-workstation (we don't want it removed after a make clean)
sudo qubesctl --show-output --skip-dom0 --targets whonix-gw-15 state.highstate
sudo qubesctl --show-output --skip-dom0 --targets whonix-gw-15 state.sls sd-whonix-template-files

#sudo qubesctl --show-output --skip-dom0 --targets whonix-gw-15 state.sls sd-whonix-template-files
qvm-shutdown --wait whonix-gw-15

# Format list of all VMs comma-separated, for use as qubesctl target
# We run this after dom0's highstate, so that the VMs are available for listing by tag.
Expand Down

0 comments on commit 232c56f

Please sign in to comment.