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

Updates docs and config for Qubes 4.0.1 #248

Merged
merged 7 commits into from
Apr 15, 2019

Conversation

conorsch
Copy link
Contributor

@conorsch conorsch commented Apr 6, 2019

Ensures the docs are accurate as of Qubes 4.0.1. Ran through a clean install and fixed errors encountered during the provisioning process. Fortunately, much of the manual recommendations we'd made around EOL Fedora templates can now be removed from the README—although I expect we'll soon be forced to do the same for 29 -> 30 (Fedora-29 goes EOL ~ 2019-09).

Closes #245.
Closes #189.
Closes #191.

Testing

Ideally, perform a clean installation of Qubes 4.0.1 following these new docs! That's a large ask, though, so more practically, the following should work:

  1. Check out this branch in sd-dev (or other AppVM you use for development)
  2. Switch to dom0 for following commands
  3. Run make clean to purge any old config.
  4. Run make all to provision all VMs, and confirm no errors.
  5. Run make test and confirm all passing.

Assuming those steps go smoothly, take a moment to run qvm-ls | grep fedora and make sure the only references you see are to fedora-29. If you see other versions, you may want to clean up, e.g.

qvm-remove fedora-28-dvm
sudo dnf remove qubes-template-fedora-28

And similar for any other versions of Fedora VMs you may have.

Conor Schaefer added 5 commits April 5, 2019 17:00
The Debian Stretch VM never should have included the jessie-backports
target, and its inclusion causes apt updates to fail, blocking
installation of any and all packages. Let's snip it out.

Tried a few paths toward implementation, and it was a rocky road.
The "quiet: true" declaration is included for compatibility with the
Whonix templates, which are also based on Debian, but don't use
/etc/apt/sources.list. See the salt docs [0] for reference:

  quiet -- Do not raise any exceptions. E.g. ignore the fact that the
  file that is tried to be edited does not exist and nothing really
  happened.

However, that parameter doesn't seem to be honored when used in the SLS
files called in dom0. Another option was to wrap the jessie deletion task
in a Jinja conditional, e.g.:

  {% if 0 == salt['cmd.retcode']('test -f /etc/apt/sources.list') %}

but then the corresponding `require` for that task must *also* be
wrapped in the same conditional, otherwise Salt gets confused. That
would be a bear to maintain. Finally settled on "only if" which will
cause the task to be skipped (meaning the task passes even on Whonix)
and still available for use as a requirement.

[0] https://docs.saltstack.com/en/latest/ref/states/all/salt.states.file.html#salt.states.file.line
Removes README ad-hoc steps for fedora-29

As of Qubes 4.0.1, fedora-29 is automatically installed, so no manual
steps are required to configure the common `sys-*` VMs with fedora-29
as base.

Removes ad-hoc commands for whonix-14 templates

As of Qubes 4.0.1, the default base templates for the Whonix VMs are the
14 series, so the out of the box config is what we want, allowing us to
drop the custom commands. Furthermore, the old templates are not
installed on 4.0.1, so we don't need to remove those, either.
The current version of Fedora is 29, so let's ensure that's the version
we have set in config and corresponding tests. We'll shortly need to
bump to fedora-30, as well.
Since we're running the per-VM checks in a loop (rather than using
pytest.mark.parametrize, which would require additional dependencies
in dom0), any failing check will break out of the loop. Let's state
explicitly which VM failed the check, to aid in debugging the config
logic.
We don't need to update the `qubes-kernel-vm-support` package in the
debian-9 template any longer, as the version shipped with 4.0.1
out of the box is sufficient for compatibility with our custom kernels.
It's still a good idea to make sure all VMs are fully updated, however,
particularly because the Salt logic currently *copies* existing VMs,
meaning that any missing updates will increase the delay on provisioning,
both initially and over time, since each copy of the TemplateVM will
need updates applied to it individually.
@conorsch conorsch requested review from sssoleileraaa, emkll and rmol April 6, 2019 00:08

Before trying to use this project, install [Qubes 4.0](https://www.qubes-os.org/downloads/) on your development machine. Accept the default VM configuration during the install process.
Before trying to use this project, install [Qubes 4.0.1](https://www.qubes-os.org/downloads/) on your development machine. Accept the default VM configuration during the install process.
Copy link
Contributor

@emkll emkll Apr 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to mitigate against CVE-2019-3462, Qubes recommends installing all debian-based templates from scratch. Shipping our own Debian-based template should help/mitigate for all non-whonix based templates, but we may need to have some logic in place to detect if there are any RPM changes and destroy /rebuild the templates

https://www.qubes-os.org/news/2019/01/23/qsb-46/

I don't think this should be in scope of this PR but something to consider for the beta

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that thanks to this patch, upgrading the debian-9 template in-place on first boot of the workstation will handle the case appropriately. You're right that you should add logic to verify it's done, to guard against mistakes. Hopefully Qubes 4.0.2 will back in the latest apt version in the Debian templates, but no reason to expect that'll be in place by the beta.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We opened issue #249 to track.

@sssoleileraaa
Copy link
Contributor

sssoleileraaa commented Apr 10, 2019

Just making a note that @emkll and I are able to see the same RPC policy error for GetDate at this point. Will review as I step through the README in this PR and followup with comments.

The 4.0 -> 4.0.1 transition involved replacing spaces as separators with
tabs as separators (which is more consistent with the other policy
files). Tests must be updated accordingly.
@conorsch
Copy link
Contributor Author

Pushed up a small tweak to the GetDate tests, after conferring with @emkll. @creviera can you try again and see if you can reproduce the failing test? All tests are now passing for me locally.

@sssoleileraaa
Copy link
Contributor

All tests pass 🎉

Copy link
Contributor

@sssoleileraaa sssoleileraaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@conorsch
Copy link
Contributor Author

Thank you for the careful review, @creviera !

@conorsch conorsch merged commit 4633259 into master Apr 15, 2019
@conorsch conorsch deleted the 245-first-run-for-qubes-4.0.1 branch April 15, 2019 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Updates for Qubes 4.0.1 Whonix 13 templates still used for sys-whonix Fedora-26 still used for sys- VMs
3 participants