Open face opened 1 year ago
If I understand correctly, the main security concern with this approach is that a malicious device could advertise itself by a false description in an attempt to get itself automatically attached or to deceive the user into attaching it.
If I understand correctly, the main security concern with this approach is that a malicious device could advertise itself by a false description in an attempt to get itself automatically attached or to deceive the user into attaching it.
Good point. This might be a similar security concern as --persistent, which is also supported. I'm not sure if a device can fake advertise itself they way --persistent detects a device?
Which I was actually thinking about last night....it would be nice if --match and --index worked with --persistent too. Then I wouldn't need the attached systemd script. When I have time I'll look at how --persistent works internally, both for the feature and security concerns.
The problem you're addressing (if any)
My Dell dock gives different device Ids for my USB devices on every boot. I have a systemd boot script that uses
qvm-usb
to attach the NIC with a hard wire to sys-usb after the sys-usb qube starts. I had to modifyqvm-usb
to attach based on the description to get it to work. --persistent will not work due to the different device ID on every boot.The solution you'd like
So, I added a -m pattern -i index to the qvm-usb command. The index is needed if multiple matches occur. I'm not a python coder so I had some help by prompting chatgpt4 a few times:
github commit: https://github.com/face/qubes-core-admin-client/commit/5a6dbadae9a5dbd4e09341f38262126ec6ececc7
If that code is close, I would be happy to learn how the automated tests are run, add some, and submit a pull reqeust. However, as I said I'm not a python coder and got help from chatgpt...so no hard feelings if our code is not used by others, I'm getting millage :).
For example:
As the DEVID changes on every boot, my new options allow the following in a systemd boot script that runs after sys-usb qube boots:
Also I can use it for things in dom0 like:
For completness and anyone else who wants to use my modified qvm-usb, change the pattern and drop the following in dom0
/usr/lib/systemd/system/attach-nic.service
and then runsystemctl enable attach-nic.service
. This works great for USB wifi NICs too.I'm testing my changes on my sytem and they are working. So far the script seems backwards compatible too.
The value to a user, and who that user might be
Any Qubes user who would like to have persistent networking on boot when their hardware gives them different device IDs for every boot. Also any user who wold like to attach devices based on a name in a single command, withough listing and then adding a device in two steps.