-
Notifications
You must be signed in to change notification settings - Fork 46
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
Distinguishes between TemplateVM & AppVM in log collection #487
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
509fd86
Consolidates log aggregation into single state file
b6406f1
Expands config tests for logging
fa2b53b
Removes duplicate sd-log RPC policy
caa77af
Sets log hostname for Whonix & Viewer
be27968
Ensures sd-gpg does not log, adds tests
e73aceb
Removes special case logging setup for proxy
adc6dd4
Reboots logging VMs during install
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: set syntax=yaml ts=2 sw=2 sts=2 et : | ||
|
||
include: | ||
- fpf-apt-test-repo | ||
|
||
{% if "template" in grains['id'] or grains['id'] in ["securedrop-workstation-buster", "whonix-gw-15"] %} | ||
# Install securedrop-log package in TemplateVMs only | ||
install-securedrop-log-package: | ||
pkg.installed: | ||
- pkgs: | ||
- securedrop-log | ||
- require: | ||
- sls: fpf-apt-test-repo | ||
{% endif %} | ||
|
||
{% if grains['id'] == "sd-log-buster-template" %} | ||
install-redis-for-sd-log-template: | ||
pkg.installed: | ||
- pkgs: | ||
- redis-server | ||
- redis | ||
remove-sd-rsyslog-config-for-logserver: | ||
file.absent: | ||
- name: /etc/rsyslog.d/sdlog.conf | ||
|
||
{% elif grains['id'] == "sd-log" %} | ||
# Only for the "sd-log" AppVM, configure /rw/config to disable | ||
# custom log config, and also start the necessary services. | ||
sd-log-remove-rsyslog-qubes-plugin: | ||
file.blockreplace: | ||
- name: /rw/config/rc.local | ||
- append_if_not_found: True | ||
- marker_start: "### BEGIN securedrop-workstation ###" | ||
- marker_end: "### END securedrop-workstation ###" | ||
- content: | | ||
# Removes sdlog.conf file for rsyslog | ||
rm -f /etc/rsyslog.d/sdlog.conf | ||
systemctl restart rsyslog | ||
systemctl start redis | ||
systemctl start securedrop-log | ||
cmd.run: | ||
- name: /rw/config/rc.local | ||
- require: | ||
- file: sd-log-remove-rsyslog-qubes-plugin | ||
|
||
{% elif grains['id'] == "sd-gpg" %} | ||
# For sd-gpg, we disable logging altogether, since access | ||
# to the keyring will be logged in sd-app | ||
sd-gpg-remove-rsyslog-qubes-plugin: | ||
file.blockreplace: | ||
- name: /rw/config/rc.local | ||
- append_if_not_found: True | ||
- marker_start: "### BEGIN securedrop-workstation ###" | ||
- marker_end: "### END securedrop-workstation ###" | ||
- content: | | ||
# Removes sdlog.conf file for rsyslog | ||
rm -f /etc/rsyslog.d/sdlog.conf | ||
systemctl restart rsyslog | ||
cmd.run: | ||
- name: /rw/config/rc.local | ||
- require: | ||
- file: sd-gpg-remove-rsyslog-qubes-plugin | ||
|
||
{% elif grains['id'] == "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-for-sd-whonix: | ||
file.blockreplace: | ||
- name: /rw/config/rc.local | ||
- append_if_not_found: True | ||
- marker_start: "### BEGIN securedrop-workstation ###" | ||
- marker_end: "### END securedrop-workstation ###" | ||
- content: | | ||
# Add sd-rsyslog.conf file for syslog | ||
ln -sf /rw/config/sdlog.conf /etc/rsyslog.d/sdlog.conf | ||
cat <<EOF > /etc/sd-rsyslog.conf | ||
[sd-rsyslog] | ||
remotevm = sd-log | ||
localvm = {{ grains['id'] }} | ||
EOF | ||
systemctl restart rsyslog | ||
cmd.run: | ||
- name: /rw/config/rc.local | ||
- require: | ||
- file: sd-rc-enable-logging-for-sd-whonix | ||
|
||
{% else %} | ||
# For all other VMs, configure to send to sd-log | ||
configure-rsyslog-for-sd: | ||
file.managed: | ||
- name: /etc/sd-rsyslog.conf | ||
- source: "salt://sd-rsyslog.conf.j2" | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
[sd-rsyslog] | ||
remotevm = sd-log | ||
localvm = {{ vmname }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 .sls in dom0/ folder will be automatically picked up by manifest.in and the rpm spec