[[:Template:Q project name]] Security

From Kicksecure
Revision as of 08:57, 9 December 2021 by Nurmagoz (talk | contribs)
Jump to navigation Jump to search

About this Kicksecure-Qubes Security Page
Contributor maintained wiki page.
Support Status stable
Difficulty easy
Contributor torjunkiearchive.org iconarchive.today icon
Support Support

Introduction

The following list of actionable items can help to improve security and anonymity on the Qubes platform, and by extension [[Kicksecure-Qubes|Template:Q project name]] users. It is advised to regularly consult either the Google Qubes forumsarchive.org iconarchive.today icon or preferably the JavaScript-free option The Mail Archivearchive.org iconarchive.today icon.

Additional channels exist for the latest security newsarchive.org iconarchive.today icon and advicearchive.org iconarchive.today icon. A Qubes forumarchive.org iconarchive.today icon has also been established for general discussion, user support and Qubes news. [1]

Security Domain

GPG and Software Packages

  • Always keep the system up-to-date in dom0archive.org iconarchive.today icon, templates and standalonesarchive.org iconarchive.today icon.
    • Prefer the Qubes Update tool or its command-line equivalent for updates. [2] [3] [4]
  • Check gpg is enabled in config filesarchive.org iconarchive.today icon (gpgcheck=1) if new Fedora repositories are installed.
  • New repositories should be considered less trusted -- it is safest to keep them separate from Templates that feed more sensitive VMs.
  • Safely import new signing keys by checking it is the same from multiple sources.
  • Preferably only install packages from trusted sources, for example pre-configured Fedora, Debian, Kicksecure and Qubes sources.
  • Untrusted or unverifiable programs should be installed in Standalone VMs or less trusted, cloned templates.

Hardware / Hardware Settings

  • Enable VT-d/IOMMUarchive.org iconarchive.today icon via BIOS to have DMA protectionarchive.org iconarchive.today icon, [5] effective network isolation and the ability to assign PCIe devices to a HVM. Check it is running via dom0 (qubes-hcl-report). [6]
  • Ensure Intel VT-xarchive.org iconarchive.today icon or AMD-Varchive.org iconarchive.today icon is available, since it is required for running HVM domains, such as Windows-based App Qubes.
  • Prepare and utilize a USB qubearchive.org iconarchive.today icon to protect against side-channel attacks. [7]
  • Use a Yubikeyarchive.org iconarchive.today icon to enhance the security of Qubes user authentication, mitigate the risk of password snooping and to improve USB keyboard security.
  • Prefer Intel Integrated Graphics Processing (IGP) units for greater system stability and security. [8]
  • Ensure computer hardware meets all other [[System_Requirements#Template:Q project name_System_Requirements|Template:Q project name requirements]] for the best security, functionality and future compatibility with Qubes 4.X releases.
  • Advanced users can consider configuring (not an official instructions link)archive.org iconarchive.today icon the experimental GUI domainarchive.org iconarchive.today icon in Qubes 4.1 to reduce the range of potential dom0 attacks. [9] [10]

ISO and Qubes Version

Protecting User Data and Activities

  • For critical user data, protect against unintentional leaksarchive.org iconarchive.today icon by setting an empty NetVM field (set to "none") for the corresponding qube.
    • To protect against "intentional sniffing", [13] pause or shut down all VMs except the target VM where sensitive operations are being performed (such as key generation). [14]
  • Do not forget that any files or changes to an App Qube's /home, /usr/local and /rw/config directories will persist across reboots; any sensitive material should be stored safely in non-networked VMs.
  • Observe the security contextarchive.org iconarchive.today icon of colored windows borders in Qubes before running applications or manipulating data.
  • If paying in cryptocurrencies:
    • Consider utilizing a “split” bitcoin walletarchive.org iconarchive.today icon which creates an offline “cold storage” wallet and an online “watching only” wallet. A blanket recommendation is impossible regarding which wallet should be used; see Bitcoin, Bitcoin Core and Money for further information.
    • Consider using a hardware wallet which has better security than a software wallet.
  • Avoid dual / multi-boot configurationsarchive.org iconarchive.today icon in Qubes. The other OS could modify the unprotected /boot partition or firmware to maliciously compromise Qubes and/or spy on user activities.
  • Be careful when running command line operations. Refer to a suitable resource firstarchive.org iconarchive.today icon, then proceed.
  • Use split-GPGarchive.org iconarchive.today icon for email to reduce the risk of key theft used for encryption / decryption and signing.
  • Do not allow Template:Q project name or other VMs to completely "own" the full screenarchive.org iconarchive.today icon. [15]
  • Disable previews (thumbnails) when using a file manager like Nautilus, as this is a known attack vector.
  • If utilizing a SSD, consider setting up a periodic job in dom0 to trim the diskarchive.org iconarchive.today icon since this aids against local forensics. [16] [17]

Template and Other VMs

  • Never run applications in Templates or dom0, except updating tools or editors for configuration purposes (running applications poses security risks).
  • Templates should never be directly connected to the Internet.
  • Do not configure either kicksecure or kicksecure as a Standalone VMarchive.org iconarchive.today icon. [18] [19]
  • Consider creating separate, specialized minimal Templatesarchive.org iconarchive.today icon for distinct App Qube clearnet activities (like browsing) to reduce the attack surface. [20] [21]
  • Avoid configuring network traffic between two qubesarchive.org iconarchive.today icon for security reasons.
  • Consider replacing passwordless root access with a dom0 user promptarchive.org iconarchive.today icon. [22]
  • Consider leveraging the non-persistence of Qubes' templates to fend off malwarearchive.org iconarchive.today icon by locking-down, quarantining and checking the contents of /rw private storage. [23] [24]
    • vm-boot-protect-root: suitable for service VMs like sys-usb and sys-net, as well as App Qubes such as untrusted, personal, banking, vault and so. [25]
    • vm-boot-protect: suitable for virtually any Debian or Fedora VM, such as Kicksecure VMs, Standalone VMs and Disposable VMs.
    • Non-Linux VMs are currently unsupported for both modes.
  • Consider split dm-cryptarchive.org iconarchive.today icon to isolate device-mapper based secondary storage encryption (not the root filesystem) and LUKS header processing to Disposables.
  • Consider running sys-net, sys-firewall and sys-usb as Static Disposablesarchive.org iconarchive.today icon.
  • Consider setting dom0 and all Templates to update over Tor by configuring this option on Qubes' first boot. [26] [27]
  • Prevent qubes which normally connect to clearnet from downloading repository metadata; see footnotes. [28] [29]
    • Disable the "Check for qube updates by default" option in Qube Manager Global settings: Qube ManagerSystemGlobal settingsUncheck Check for qube updates by default; and
    • Disable the qubes-update-check service for relevant Templates: Qubes ManagerRight-click TemplateQubes settingsServicesUncheck qubes-update-check. [30]
  • Disable cups in all Templates as well as in Standalones that have been created; see footnotes. [31] [32]

Footnotes

  1. https://www.mail-archive.com/qubes-users@googlegroups.com/msg35196.htmlarchive.org iconarchive.today icon
  2. Updating Qubes OSarchive.org iconarchive.today icon:

    Warning: Updating with direct commands such as qubes-dom0-update, dnf update, and apt update is not recommended, since these bypass built-in Qubes OS update security measures. Instead, we strongly recommend using the Qubes Update tool or its command-line equivalents, as described below. (By contrast, installing packages using direct package manager commands is fine.)

  3. Replace built-in Qube Manager update functionality with the Qubes Update toolarchive.org iconarchive.today icon
  4. It is understood that other mechanisms do not have the same security benefits of Qubes Updater GUI which uses the Salt version for update commands. That is, Qubes repository metadata may not be verified which allows attackers to block (but not modify) packages from being updated. For further information, see: Recommendation against "qubes-dom0-update" (use "Qubes Updater" instead)archive.org iconarchive.today icon.
  5. Qubes FAQarchive.org iconarchive.today icon:

    DMA is mechanism for PCI devices to access system memory (read/write). Without VT-d, any PCI device can access all the memory, regardless to which VM it is assigned (or if it is left in dom0). Most PCI devices allow the driver to request an arbitrary DMA operation (like “put received network packets at this address in memory”, or “get this memory area and send it to the network”). So, without VT-d, it gives unlimited access to the whole system. Now, it is only a matter of knowing where to read/write to take over the system, instead of just crashing. But since you can read the whole memory, it isn’t that hard.

  6. The Qubes wikiarchive.org iconarchive.today icon notes:

    If VT-d is not active, attempt to activate it by selecting the VT-d flag within the BIOS settings. If your processor/BIOS does not allow VT-d activation you still enjoy much better security than alternative systems, but you may be vulnerable to DMA attacks. Next time you buy a computer consult our HCL (Hardware Compatibility List)archive.org iconarchive.today icon and possibly contribute to it.

  7. Automatically configured in Qubes R4, but an optional configuration in R3.2.
  8. Proprietary binary blobs of other GPU manufacturers pose security risks and the available open source drivers are notoriously unstable in Qubes.
  9. Very briefly, the GUI domain is a qube separate from dom0 that handles all the display-related tasks and some system management. ... Furthermore, while in theory dom0 is isolated from the outside world, some graphical devices (e.g. displays connected via HDMI or DVI) offer two-way communication, which threatens this isolation and makes it harder to maintain. If a malicious device (rather than the user’s trusted monitor) were to be connected to one of these ports, it could inject data that could be processed inside of dom0. As long as graphical devices are in dom0, they also cannot be safely proxied to other domains. This is because the various solutions to multiplexing access to the GPU at the GPU/driver level (which would expose the “full” GPU to a VM) are orders of magnitude more complex than running display drivers in just one place. We consider this added complexity too risky to put it in dom0. Errors in the drivers could expose dom0 to an attack, and attacks on dom0 are the biggest threat to the Qubes security model.

  10. Qubes OS forum: How to install/use sys-gui (collecting all related information)archive.org iconarchive.today icon.
  11. User note: Qubes R4.0 and above provides fully virtualized (HVM or PVH) VMs that have greater protectionarchive.org iconarchive.today icon against processor speculative execution bugs like the Meltdown and Spectre attacks, and other exploits. Qubes R3.2 and earlier versions relied on para-virtualized (PV) VMs.
  12. For instance, this security bugarchive.org iconarchive.today icon allowed an attacker to escape from a PV domain and exploit the dom0 hypervisor. It only affected Qubes R3.2, since Qubes R4 only runs untrusted code in PVH or HVM domainsarchive.org iconarchive.today icon by default.
  13. Malicious software in one qube trying to use side channel attacks against another running qube.
  14. In simple terms, trusted, high-value qubes can be exploited if run in parallel with untrusted qubes (because they may have been previously exploited).
  15. Without visible, colored decorations drawn by each VM window, a malicious application might only pretend to release the full screen (while the screen appears normal), or the full desktop may be emulated so users are tricked into entering sensitive information into false "trusted" domains.
  16. This can be configured with either systemd (weekly only) or cron (daily or weekly).
  17. Qubes wikiarchive.org iconarchive.today icon:

    TRIM can improve security against local forensics when using SSDs, because with TRIM enabled deleting data (usually) results in the actual data being erased quickly, rather than remaining in unallocated space indefinitely. However deletion is not guaranteed, and can fail to happen without warning for a variety of reasons.

  18. Unlike App Qubes where only the /rw/ directories are persistent, Standalone VMs are complete clones of the template which have independent file systems. This means it is more vulnerable to the threat of persistent malware.
  19. https://forums.whonix.org/t/running-whonix-workstation-as-standalonevm/12008archive.org iconarchive.today icon
  20. Qubes developer unman has notedarchive.org iconarchive.today icon:

    It’s a mistake to think that attacks need be against applications. Every time you install an application, it will bring with it a number of libraries, dependencies and recommends. Use of those libraries from the application may be well controlled, but an attacker may be able to chain and abuse them in unexpected ways. That is increasing the attack surface, and using tuned templates minimizes that risk.

  21. This also reduces the frequency of updates and the associated threat of broken templates. Further, adversaries that get a toe-hold on a user's system will have less potential software vulnerabilities to exploit/chain.
  22. There might be potential attacks against the hypervisor or daemons/backends in dom0 that require root access. Qubes founder Joanna Rutkowska initially assessed there was limited benefit from isolating the root account from the user account, because all user data is already accessible from the latterarchive.org iconarchive.today icon. However, she later changed her opinion on the matter; see herearchive.org iconarchive.today icon.
  23. vm-boot-protect.service:

    • Acts at VM startup before private volume /rw mounts
    • User: Protect /home desktop & shell startup executables
    • Root: Quarantine all /rw configs & scripts, with whitelisting
    • Re-deploy custom or default files to /rw on each boot
    • SHA256 hash checking against unwanted changes
    • Provides rescue shell on error or request
    • Works with template-based App Qubes, sys-net and sys-vpn
  24. Disabling of Qubes' default passwordless-root is also required.
  25. If regular Linux applications like Firefox, Chromium, KeePassXC, office/media applications and Thunderbird are used without tailored Qubes-specific settings in /rw, then no configuration should be necessary.
  26. https://github.com/QubesOS/qubes-issues/issues/1159#issuecomment-167432121archive.org iconarchive.today icon
  27. This option has been available since Qubes R3.1 and prevents adversaries from easily learning which packages are installed or updated / upgraded. The dom0 UpdateVM can also be changed in Qube Manager Global settings.
  28. https://www.mail-archive.com/qubes-users@googlegroups.com/msg27567.htmlarchive.org iconarchive.today icon

    It is the qubes that perform update checks and then notify dom0 accordingly. So if you have a qube connected to clearnet it will check over clearnet. You can disable this in clearnet connected qubes - it's the qubes-update-check service. Or you can disable globally in qubes-global-settings.

  29. This removes any time-based correlation by adversaries, which might otherwise occur when package updates over Tor happen shortly after clearnet repository metadata is downloaded.
  30. Tests have shown that both settings must be disabled to prevent clearnet repository metadata downloads and update notifications.
  31. https://github.com/QubesOS/qubes-issues/issues/5179archive.org iconarchive.today icon
  32. In Template / Standalone. sudo systemctl mask cups Now cups will no longer needlessly autostart in every VM. If it is necessary to use a dedicated printing VM later on, follow these steps to start cups. sudo systemctl unmask cups sudo systemctl start cups These two commands can probably be automated using /etc/rc.local.
Notification image

We believe security software like Kicksecure needs to remain Open Source and independent. Would you help sustain and grow the project? Learn more about our 12 year success story and maybe DONATE!