-
Notifications
You must be signed in to change notification settings - Fork 51
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
Secure Bind Mount & Protect Hardware #202
Conversation
Thank you, there's some really nice research here! I am afraid, we are going in cycles here. Some stuff disregarded here... If a systemd unit file based implementation, then there's already a better systemd unit file here: related: The existing script
I would prefer to improve that instead.
Secure mount options should not be mixed with: I am not sure this can be merged. But just leave it open. There are really good suggestions here. |
mount --options defaults,nosuid,nodev --bind --make-private /home /home | ||
mount --options defaults,nodev,nosuid --bind --make-private /tmp /tmp | ||
mount --options defaults,nodev,nosuid,noexec --bind --make-private /boot/efi /boot/efi | ||
mount --options defaults,nodev,noosuid,noexec --bind --make-private /boot /boot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type noosuid
here but nvm.
Adding more folders to remount-secure now... |
as suggested in Kicksecure#202
Done. |
Changes suggested here:
|
Hello. This pull request resolves two currently open issues. One is protecting hardware by limiting access to /proc and /sys. Well good news. I present you the best way possible. Mounting proc with subset=pid ensure that only the pid subset under proc is visible, everything else is invisible. This is also the case for root. No one can see anything.
/proc/dma
,/proc/iomem
,/proc/ioports
,/proc/meminfo
,/proc/kallsyms
,/proc/kcore
and literally tons of other stuff, everything protected even from root. Justls /proc
to see for yourself what gets hidden.When it comes to /sys, starting based on this comment, I found the sources of breakages. The comment is true, but not complete, because there are also other subsets that break too, apart from just fs. Those are enabled, and everything else is disabled. Tested.
And bind mounting. You said not having bind mounts is a big deal. You said binds are important, they are our lives. Well. You say no more. I give you binds, a lot of them, and them only. At this point, we might as well just bind everything, disregarding if it has a proper real partition. Because even if it does have a partition, bind mounting to itself does no harm literally. The overhead seems to be really really minimal and unnoticable. So this is the current suggestion. Test for yourself and report please.