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

run after qubes-mount-dirs.service for code simplification? #34

Open
adrelanos opened this issue Jul 16, 2019 · 2 comments
Open

run after qubes-mount-dirs.service for code simplification? #34

adrelanos opened this issue Jul 16, 2019 · 2 comments
Labels

Comments

@adrelanos
Copy link
Contributor

[Unit]
After=qubes-sysinit.service
Before=qubes-mount-dirs.service
After=qubes-sysinit.service dev-xvdb.device
DefaultDependencies=no
Before=local-fs.target rw.mount home.mount qubes-gui-agent.service

The issue with mount-dirs.sh is that it calls /usr/lib/qubes/init/bind-dirs.sh which could execute malicious code through /rw/config/qubes-bind-dirs.d which during a previous boot could have used to place a malicious malware hook. But that's something that can be fixed upstream in Qubes by moving bind-dirs into its own systemd unit file.

Assuming that is sorted out upstream in Qubes, then Qubes-VM-Hardening could use:

[Unit]
After=qubes-mount-dirs.service qubes-bind-dirs.service
Before=local-fs.target rw.mount home.mount qubes-gui-agent.service

Dunno if it would also need DefaultDependencies=no.

Thereby Qubes-VM-Hardening could do its thing while not risking that any applications process any potentially maliciously modified files in the private image? Then Qubes-VM-Hardening could be simplified and wouldn't require to use mount / umount itself? Do you see any loopholes in this approach?

@tasket tasket added the cleanup label Jul 16, 2019
@tasket
Copy link
Owner

tasket commented Jul 16, 2019

My initial thought is that vm-boot-protect can't go after qubes-bind-dirs in any case, so the latter would have to go on the Before= line. And if we're letting qubes-mount-dirs handle all mounting, then I don't think rw.mount or home.mount can be on Before= line.

FWIW, this question about having upstream create a separate qubes-bind-dirs came up before. But at the time I saw no other reason for them to change, and I wanted to do what was both expedient and safe.

@adrelanos
Copy link
Contributor Author

Created QubesOS/qubes-issues#5256 for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants