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

Opt-out logs cleanup on qube removal #8569

Open
emanruse opened this issue Oct 6, 2023 · 25 comments
Open

Opt-out logs cleanup on qube removal #8569

emanruse opened this issue Oct 6, 2023 · 25 comments
Labels
C: core P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: enhancement Type: enhancement. A new feature that does not yet exist or improvement of existing functionality.

Comments

@emanruse
Copy link

emanruse commented Oct 6, 2023

How to file a helpful issue

Qubes OS release

4.1

Brief summary

Dom0 keeps logs for non-existing qubes.

Steps to reproduce

Create a few VMs (easiest - DispVMs), then delete them.

Expected behavior

Logs for non-existing qubes should be deleted automatically (instantly or after configurable time).

Actual behavior

Logs are preserved for infinity and pile up in /var/log/... (related subdirs)

@emanruse emanruse added P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists. labels Oct 6, 2023
@andrewdavidwong andrewdavidwong changed the title Auto clean-up logs for non-existing qubes Deleting a qube does not remove its log files from dom0 Oct 7, 2023
@andrewdavidwong andrewdavidwong added C: core needs diagnosis Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed. affects-4.1 This issue affects Qubes OS 4.1. labels Oct 7, 2023
@h01ger
Copy link

h01ger commented Oct 7, 2023 via email

@emanruse
Copy link
Author

emanruse commented Oct 11, 2023 via email

@DemiMarie DemiMarie added the privacy This issue pertains to data or information privacy through technological means. label Oct 14, 2023
@kryptonik-os
Copy link

Hi,
As advised by qubist in the https://forum.qubes-os.org/, I'm sharing a bug with the script he's creating in the topic https://forum.qubes-os.org/t/really-disposable-ram-based-qubes/21532
concerning a DispVMs that completely erases itself without leaving any trace (files, folders, etc...).
As indicated in "Actual behavior" in your topic, there are indeed log traces in /var/log/... for all VMs created, even DispVMs.
His script does a good job of erasing all traces of DipsVMs created with its script in the /var/log/ folders (which is a good thing) however, it works ONLY if the DispVM is closed BEFORE the Qubes-OS shutdow otherwise all traces remain present...

Another thing, with script, there are files left in the ~/.config/menus/applications-merged/ folder.
Of course, his script is under construction:) But traces in /var/log can be deleted automatically under some conditions with this script. :)

@emanruse
Copy link
Author

emanruse commented Oct 30, 2023 via email

@andrewdavidwong
Copy link
Member

andrewdavidwong commented Oct 30, 2023

this is also a privacy issue.

Technically, this is only a privacy issue for Whonix disposables (if that*), since all non-Whonix qubes (including disposables) are explicitly out-of-scope regarding privacy:

https://www.qubes-os.org/faq/#what-about-privacy-in-non-whonix-qubes

Of course, it would be nice if, someday, we could also have some privacy guarantees regarding non-Whonix disposables, but that would be a separate issue (and an enhancement request rather than a bug report).


*(I say "if that" because it's not clear to me that Whonix disposables are intended to be amnesiac from dom0's perspective. Any opinion on this, @adrelanos?)

@emanruse
Copy link
Author

emanruse commented Oct 31, 2023 via email

@adrelanos
Copy link
Member

I am not sure it would be possible, realistic to get all the local traces under control to withstand forensic analysis. Related:

The related warnings, see "Amnesic Capability":
https://www.whonix.org/wiki/Qubes/Disposables#Warnings

What might work and what might be more realistic is the following:

*(I say "if that" because it's not clear to me that Whonix disposables are intended to be amnesiac from dom0's perspective. Any opinion on this, @adrelanos?)

Would be nice to have for sure. Would be a feature unspecific to Whonix. A general Qubes feature.

@emanruse
Copy link
Author

emanruse commented Oct 31, 2023 via email

@adrelanos
Copy link
Member

Logs shouldn't be removed unless it's an anti-forensics feature. To not redact any logs is the standard behavior for any *nix based operating system. Could be considered a feature, not a bug. Could be considered the expected behavior.

Even in live mode operating systems logs aren't redacted (just lost after reboot because entirely in RAM).

Debian apt remove might leave log (and config) files behind. apt purge might remove them. But that depends on each individual package, is not an anti-forensics feature and there could be oversights, for which no bugs are reported (or fixed) because of low interest in this.

Translated to Qubes, there would need to be a VM remove versus a VM purge feature. Could frame this as a missing Qubes feature. Not sure that's adding more confusion for such a minor feature than gain.

@no-usernames-left
Copy link

@adrelanos On "ordinary" operating systems I would agree, but this is Qubes.

Disposable means gone once you're done with it, like a used tissue. The logs should be too. If you think they should remain, then there should be a way to launch a disposable qube (from the CLI perhaps, to avoid cluttering up the GUI) in such a way as to retain all the logs for troubleshooting.

@adrelanos
Copy link
Member

@adrelanos On "ordinary" operating systems I would agree, but this is Qubes.

Disposable means gone once you're done with it, like a used tissue. The logs should be too. If you think they should remain, then there should be a way to launch a disposable qube (from the CLI perhaps, to avoid cluttering up the GUI) in such a way as to retain all the logs for troubleshooting.

Why?

That is a anti-forensics for which there are existing feature requests.

My interpretation by looking at #904 which is open since 2015 is that this is either not a high priority for Qubes and/or difficult to implement.

(And I am not criticizing this. Understandable on my part. Sure, it's a nice feature but realistically also a niche feature for which a readily available band-aid is available, that is full disk encryption. The availability of band-aids often prevents "the real solution". Anti-forensics would require a strong commitment by Qubes, speak lots of assigned developer time to that. Selective anti-forensics for some type of VMs only on an otherwise fully persistent operating system is difficult to implement. It has some of the same technically challanges which have been documented in the Kicksecure wiki article Encrypted Images.)

If the user exception is not met, if the terminology Disposable implies anti-forensics capabilities which are currently not implemented and unrealistic to materialize in the next years, then the correct way would be to rename Disposable to something more appropriate. I don't have suggestions for a better name and this can wait for feedback from the Qubes developers.

@emanruse
Copy link
Author

emanruse commented Nov 1, 2023 via email

@kryptonik-os
Copy link

I have to say that I tend to agree with the analysis of @emanruse When I did the "cleanup" in the /var/log/ folder and realized Of all the useless files that remained in memory,I say to "wow :o what is that?? :o ".
Surely; It's a privacy issue, but it's mostly a A big organizational problem. For most files, they're just text files so it doesn't matter too much in terms of memory, but then, what a struggle to find one's way around! :o lol. That we keep the.log of AppVMs, why not, it can always be useful (I do not talk ,of course of the security issues, just organization. Security issues are something else again) but having ALL the.log of DispVMs I really don't see the interest...

@unman
Copy link
Member

unman commented Nov 12, 2023 via email

@emanruse
Copy link
Author

emanruse commented Nov 12, 2023 via email

@emanruse
Copy link
Author

emanruse commented Nov 15, 2023 via email

@marmarek
Copy link
Member

I think a good compromise would be opt-out logs cleanup on qube removal. Like, a cleanup_logs propery on a qube, default to true. Then remove_from_disk function in core-admin will check it and if set to True, remove qube-related logs. If you want to preserve them, set it to false (for DispVMs, you'd set it on DispVM template, properties inheritance will do the trick).

Note it still won't erase all traces of existence of a qube, for example a few global logs (like system journal) will still have mentions of that qube. But I think this part clear here.

@emanruse
Copy link
Author

emanruse commented Nov 15, 2023 via email

@kryptonik-os
Copy link

@emanruse

After stopping and deleting a qube, a "non-file" with 0 bytes size remains:
/run/qubes/audio-control.=
It cannot be removed even as root, it does not appear in lsof, so I have no idea what is using/locking it.

I've noticed this but /run/qubes/audio-control.<qube-name>= , after the QUBES-OS reboot, that goes away (for me)

@emanruse
Copy link
Author

emanruse commented Nov 15, 2023 via email

@kryptonik-os
Copy link

Everything on all tmpfs mounts (/run included) goes away on reboot.
My bad :)

Like it disappear at reboot, i never ask me this question...

@marmarek
Copy link
Member

marmarek commented Nov 15, 2023 via email

@emanruse
Copy link
Author

emanruse commented Nov 15, 2023 via email

@andrewdavidwong andrewdavidwong changed the title Deleting a qube does not remove its log files from dom0 Opt-out logs cleanup on qube removal Nov 16, 2023
@andrewdavidwong andrewdavidwong added T: enhancement Type: enhancement. A new feature that does not yet exist or improvement of existing functionality. and removed T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists. privacy This issue pertains to data or information privacy through technological means. needs diagnosis Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed. affects-4.1 This issue affects Qubes OS 4.1. labels Nov 16, 2023
@emanruse
Copy link
Author

emanruse commented Feb 6, 2024 via email

@emanruse
Copy link
Author

emanruse commented Feb 6, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: core P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: enhancement Type: enhancement. A new feature that does not yet exist or improvement of existing functionality.
Projects
None yet
Development

No branches or pull requests

9 participants