-
Notifications
You must be signed in to change notification settings - Fork 43
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
Converts all SDW AppVMs to Debian 9 #155
Conversation
All of the `sd-*` VMs for the SecureDrop Workstation now use Debian 9 as the base template. This will allow us to use deb packages across the board for all AppVMs, as well as the hardened based image with a custom kernel in the near future, as well. Updates the test suites to accommodate for gpg v1/v2 output variance, as well as removes Fedora 28 as a permitted base for the AppVMs in the platform tests.
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.
I can confirm that all tests pass and that submissions are decrypted, and files can be opened in the sd-svs-disp based disposable VM (after installing nautilus in the debian-9 template, using the Files application).
I am, however, experiencing some regressions with the processing of default applications in debian-9 based VMs:
- xdg-open invoked by the command line in sd-svs does not open in a disposable VM (using gnome/nautilus, however, correctly opens the file is a disposable vm). This is a regression, current master under fedora28 would open these files in disposable VMs when using xdg-open.
- Text submissions (i.e. messages) fail to open in a new window (within the dispvm) due to what appears to be the default editor in debian-9 (
nano
). Using something likeupdate-alternatives
should work, but the change must be applied in the template (we could apply this in the securedrop-workstation template):
sudo update-alternatives --install /usr/bin/editor editor /usr/bin/gedit 50
This PR obviously does not change the template for sys-net and sys-firewall, and we should perhaps open a follow-up issue to discuss how we will keep those vms up-to-date.
Hadn't tested with There's an automatic fallback to It's not technically necessary that we resolve the |
Ah, of course: we need #131 to make that config change persistent, since |
This may be a larger problem with the Debian 9 transition: xdg-open when run via a terminal (rather than invoked via e.g. Nautilus integration, or otherwise in a GUI desktop environment) does not honor the mimetype handlers declared in the desktop files. For text/plain, edited the mailcap file in order to address.
9d37b3a
to
97a6806
Compare
Take another look, @emkll. The |
We'll have to circle back on making sure that all mimetypes are honored, but for now we can simply ensure that submitted plaintext files are opened correctly in `sd-svs-disp`, not `sd-svs`; the latter should never open files directly, only call out to the former for opening.
We can't configure sd-svs-disp directly via Salt, since changes won't persist between VM instantiations. Let's instead modify the base template, currently debian-9. This is not clean, since it will pollute the debian-9 template (which is not SecureDrop Workstation-specific) for all uses, but it's a temporary measure until we have SDW-specific templates.
Marking as WIP until we shake out the remaining issues on the mimetype handling regression. We'll almost certainly need to open a separate issue to track mimetype coverage in Debian 9, but the near-term issue blocking merge is that files opened in Nautilus in Previously I'd incorrectly assigned the mailcap mimetype override to More recently I've applied the mailcap mimetype override to
It's step 5 that we need to resolve for merge here. I agree with @emkll that it's still mimetypes biting us. So far I've observed that mimetypes are handled "correctly" (i.e. as they've been in fedora-28) in debian-9 only when there's an active desktop environment. Invocations from terminal—which may include the @joshuathayer can you take a look at this and try to resolve step 5 above? |
All of the `sd-*` VMs for the SecureDrop Workstation now use Debian 9 as the base template. This will allow us to use deb packages across the board for all AppVMs, as well as the hardened based image with a custom kernel in the near future, as well. Updates the test suites to accommodate for gpg v1/v2 output variance, as well as removes Fedora 28 as a permitted base for the AppVMs in the platform tests.
This may be a larger problem with the Debian 9 transition: xdg-open when run via a terminal (rather than invoked via e.g. Nautilus integration, or otherwise in a GUI desktop environment) does not honor the mimetype handlers declared in the desktop files. For text/plain, edited the mailcap file in order to address.
We'll have to circle back on making sure that all mimetypes are honored, but for now we can simply ensure that submitted plaintext files are opened correctly in `sd-svs-disp`, not `sd-svs`; the latter should never open files directly, only call out to the former for opening.
We can't configure sd-svs-disp directly via Salt, since changes won't persist between VM instantiations. Let's instead modify the base template, currently debian-9. This is not clean, since it will pollute the debian-9 template (which is not SecureDrop Workstation-specific) for all uses, but it's a temporary measure until we have SDW-specific templates.
It's critical that any intended overrides to mailcap mimetype rules be declared in a specific section of the /etc/mailcap file, otherwise the declarations will be handled along with all the other package/system-provided rules, and likely be ignored.
e8b86db
to
1bc5c28
Compare
Ready for re-review. The mailcap override recently inserted wasn't taking precedence because it wasn't in the correct section of the file. From
Indeed, the overrides must land between those headings. Updated the insertion logic to be more precise (rather than prepending to the top of the file, which does not trigger override behavior) and can confirm: "File is displayed in We'll likely need to port the entirety of the mimetypes already declared in desktop files to the mailcap setup. That work should happen as part of the overall conversion to custom templates (#131). Will open a separate issue to track. |
Remarking as WIP. The issue at present is that the Salt config always reportes |
@kushaldas how do you feel here? This seems very similar to complaints you've made against using salt as a software distribution mechanism which I strongly agree with. Falls in line with a lot of the problems that have bit us with using ansible on the securedrop server vs pushing around large binaries (in this case, pre-built templates) |
…mofpress/securedrop-workstation into 111-use-debian-9-as-base-template
I traced through
I suspect there's a better way to fix this problem. I don't know much about desktop environments and stuff, but I don't think we're running under Gnome at all, right? I suspect we'd be happier if |
Also I feel like we should break this PR out into a couple of issues, then revisit when those are sorted
Does that breakdown make sense to people? |
Is it even worth aiming for landing this PR, or should we move straight on to #131, taking the lessons learned here into account (including the potential need for RPM-packaging the base template)? As for the |
@eloquence, I think we'd be best off finding a real fix for the xdg-* issue, since even when we have a real client app we'll still want to attempt to keep users opening files directly in the client VM. I just pushed onto this branch (hope that's OK, @conorsch ) what I think is a good initial step in that direction- it should fix the @conorsch and @emkll feel free to try the xdg stuff with this latest commit applied (note that it updates the whonix-ws-14 template, so make sure to shut down that template before running sd-journalist!) |
Oops, upon rereading the comments on this PR, I see the problems people were experiencing were in sd-svs and sd-svs-disp, while my commit above addresses a related problem in sd-journalist (where we currently don't want anybody opening anything). The fix for sd-svs*, I think for both the "xdg-open doesn't work on sd-svs" problem and (at least partially) the "text files are not opened correctly in sd-svs-disp" problem should be the same: ensure that I just manually installed those on my Looking deeper into the disposable VM's handling of
It's pretty easy to update that (we just add an entry to Since fixes to all these problems involve changes to templates, I agree with @eloquence and others that we should put this on ice and focus instead on #131 now. I think we've identified a number of changes which we'll want to integrate with our new templates, at least:
|
Great info here, @joshuathayer, thanks for the detail! I'll try to reproduce the success you've had with the new package inclusions and report back.
Recall that editing files in $HOME won't work in TemplateVMs, since every AppVM gets its own homedir by default. So in the partial progress for #131, I've switched use of
Agreed, but warrants confirmation via testing. I'll open the new issues you described, along with two others—use a dedicated template, e.g. |
Thanks @joshuathayer, installing Installing these packages does indeed fix the
xdg-open ~/Sources/TheSource/file will now open in a sd-svs-disp-based disposable vm. However, the default file in sd-svs-disp for text/plain is vim. Running the following command in
With that, plaintext submissions are now properly opened in gedit on the disposable vm, either invoked by nautilus or by xdg-open on the command line of sd-svs. |
For the record, this command:
adds customizations to $HOME, which would not persist in TemplateVMs. We can instead declare the resultant rules in a system location at |
We learned a lot of lessons in this attempt. Superseded by changes in #160, so closing. |
All of the
sd-*
VMs for the SecureDrop Workstation now use Debian 9 asthe base template. This will allow us to use deb packages across the
board for all AppVMs, as well as the hardened based image with a custom
kernel in the near future, as well.
Updates the test suites to accommodate for gpg v1/v2 output variance, as
well as removes Fedora 28 as a permitted base for the AppVMs in the
platform tests.
Testing
make all
indom0
and confirm no errors.make test
indom0
and confirm no errors.sd-
VMs are running Debian 9 (or Whonix 14, which is itself based on Debian 9).Regarding 4, there's a bit of manual work that may be required, in order to get a file browser for in the SVS.
sudo apt install -y nautilus
inside thedebian-9
template.I propose not automating this step since it's a temporary workaround. We're planning to implement TemplateVMs in #131, as well as ditching file browsing in favor of the SecureDrop Client on the SVS.