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

Wifi and Bluetooth Patch | Security and Privacy #145

Merged
merged 10 commits into from
Nov 5, 2023

Conversation

monsieuremre
Copy link
Contributor

With this patch, the mac address of the device is randomized per wifi connection. This randomizes all the bits and does not hide the fact that we are randomizing the address. The original mac is not extractable and this does not cause any issue. The same functionality exists in grapheneOS.

The privacy extensions for ipv6 addresses are also enabled. These are theoretically not necessary when we randomize the mac address. But they are still harmless and bring privacy. Unlike ip4 addresses, ipv6 addresses can also leak device information and not only network.

And also, disabling the kernel bluetooth modules was a little too much for daily usage for most people in this age. So I disabled it and configured bluetooth in a privacy respectin manner. Bluetooth starts disabled on start up. This wasn't the case in a default install. Temporary devices are forgotten immediately. Enforces private addresses. Some legacy devices that don't support private addresses are not accepted. There is a timeout for pairability and discoverability, unlike the default configs. I see this as good enough. Bluetooth is turned off on boot. User has the freedom to enable it using their GUI settings at their own risk.

On file was deleted. It is also addressed in the main script. Lines are not deleted, just commented out with the proper explanation.

@adrelanos
Copy link
Member

As per FHS and/or other conventions for a package / distribution /etc
shouldn't be used (for local system admin) but at least for systemd some
other location such as /lib or /usr/lib should be used. Could you
research that please and move accordingly?

Not sure about network manager. For that, /etc might be correct.

…sr/lib/NetworkManager/conf.d/99_ipv6-privacy.conf
…usr/lib/NetworkManager/conf.d/99_randomize-mac.conf
… usr/lib/systemd/networkd.conf.d/99_ipv6-privacy-extensions.conf
@monsieuremre
Copy link
Contributor Author

I changed the path for those that I could. There is only /etc/bluetooth/30_security-misc.conf left. Reading the man page, I gather this is the only valid path for a config file for bluetooth. We can specify a different path by modifying the bluetooth service and adding ExecStart=/usr/lib/bluetooth/bluetoothd --configfile /our/file. This would intruduce unnecessary complexity. So this should be left as is in /etc in my opinion.

@@ -49,3 +49,6 @@ rm_conffile /etc/sysctl.d/30_security-misc.conf
rm_conffile /etc/sysctl.d/30_silent-kernel-printk.conf
rm_conffile /etc/sysctl.d/30_security-misc_kexec-disable.conf

## replaced with privacy conscious configurations for bluetooth
## not to hinder day to day usage
rm_conffile /bin/disabled-bluetooth-by-security-misc
Copy link
Member

Choose a reason for hiding this comment

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

This isn't needed. There are no conf files in /bin/. rm_conffile is only useful for /etc because these files are treated in a special way by dpkg.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did not know this. Makes sense.

@adrelanos
Copy link
Member

Agreed. Seems already reasonable.


I don't like the 99 prefix as a number. Because as we've seen with /usr/lib/sysctl.d/99-protect-links.conf it is difficult to overrule these.

Not a big deal. If you like, I can adjust the numbers after merge.

@adrelanos
Copy link
Member

The rest seems good at first sight. But not yet tested.

Did you test this?

Could you please send a PR to update debian/control?
(Can be a separate PR or the same one. That's not important.)

@monsieuremre
Copy link
Contributor Author

monsieuremre commented Nov 1, 2023

The rest seems good at first sight. But not yet tested.

Did you test this?

I had tested everything when they were under /etc. But I read in their man pages that these paths are also parsed and equally valid for config files to be in. So I think they should work, but not explicitly tested.

@monsieuremre
Copy link
Contributor Author

Could you please send a PR to update debian/control? (Can be a separate PR or the same one. That's not important.)

I don't see what I would change in this file.

@monsieuremre
Copy link
Contributor Author

Agreed. Seems already reasonable.

I don't like the 99 prefix as a number. Because as we've seen with /usr/lib/sysctl.d/99-protect-links.conf it is difficult to overrule these.

Not a big deal. If you like, I can adjust the numbers after merge.

I chose this because I thought it would be better if get parsed the last. So I thought of it as giving them more priority. I don't know if my thinking was correct. You can edit the names to your liking after merge.

@adrelanos
Copy link
Member

adrelanos commented Nov 2, 2023 via email

@monsieuremre
Copy link
Contributor Author

Under Description: describing the bluetooth implementation. And maybe
some other stuff recently changed.

I think that and also the readme are now already out of date. And they are going to become more out of date with the recent pull request being merged. A better approach would be updating these at once with another pull request. So I think you can merge this one, if everything else seems ok to you.

@adrelanos
Copy link
Member

adrelanos commented Nov 3, 2023 via email

@monsieuremre
Copy link
Contributor Author

I will create a pull with a readme update for everything so far once we got most stuff merged and activated.

@monsieuremre
Copy link
Contributor Author

I think we are ready to merge this one. If there are problems or features that are not wished, I can fix/undo them.

@adrelanos
Copy link
Member

I cannot really test this as I don't even have any Bluetooth devices. But I guess this is better than completely disabling Bluetooth.

@adrelanos adrelanos merged commit 5a75bcf into Kicksecure:master Nov 5, 2023
@monsieuremre
Copy link
Contributor Author

You can at least test the MAC address thing I guess? See your MAC get changed on every new connection. IPv6 privacy extensions are also enabled, which actually, when randomizing the mac address, IPv6 gets private anyway. But yeah.

@monsieuremre monsieuremre deleted the wifi-and-bluetooth branch November 17, 2023 13:56
@adrelanos
Copy link
Member

@adrelanos
Copy link
Member

reverted network changes as per:

(Bluetooth unaffected.)

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.

2 participants