-
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
improve hide-hardware-info.service, make /sys
hiding optional
#172
Comments
I am not sure how that PR would look but I guess rather small. Since this is not enabled by default and for extra security, I tend to add what you suggested here. Worth trying. |
Actually we do not even need that service I think. We can set the permissions using the permission hardener service. We are just going to do these with the already existing permission hardener service. chmod 400 /proc/kallsyms And that's it. This hides a lot of hardware and kernel info. And I am pretty positive it won't break anything. |
But these are all probably related to Could you test please if these work? related: |
That's an interesting idea to get rid of the extra service. Nice in theory, but... Could you check please what other features the current implementation has?
Nice idea but permission-hardener no longer runs at boot time. Only at package install time or when run manually. This was changed to fix the slow/broken boot issues. But changes to /proc (or /sys) need to be done at boot time since these are virtual file systems which are created during boot. Even only So I guess the best way here is to improve
|
2 of them are already in I think, so we just have to add the one.
Yessir. This is the one only cause of breakage, in my observation at least. |
Ok. PR to update the script run by hide-hardware-info.service would be welcome.
|
/sys
hiding optional and enable by default
This one seems really cool and doable. Ping @monsieuremre |
I remember having tested this locally some time ago. Adding But also, I remember I have found a way better solution for this thing after doing all the tests. That's when I created the full system policy. It is now merged with apparmor.d. So I would recommend focusing on packaging @roddhjav's package for whonix, which it now natively supports. We don't need to enable the full system policy even to have the protections for these stuff. Especially with the new apparmor version it is possible to have profiles for unconfined processes. We can make sure these paths are only reachable by certain applications that are have their dedicated apparmor profiles. This way, we would protect the entirety of I have seen @roddhjav create profiles from mere log files before. See this one. I am sure if we provide the project with enough data points, he might be able to work something out for xfce too and the full system policy would also for for whonix, we would also be involved of course, as much as we could. I think this should be prioritized no matter what. But as our fallback protection, as I said, I will create a pull for this issue, in some time. |
As I said, I did draft some solution that also addresses this issue. It seems to work for file permissions dynamically. I think it can be implemented for mounting things as well (have to try out first). But for sensitive proc, I think I found a better way. We can modify the mount options. Procfs has the mount option |
So basically, I have this one but I gotta say. While we are at it, let's hide pid too. Our workaround solution is not good enough because like things with pkexec don't work. I see. Users under the group proc are exempt from our hardening. So like, why don't we just set group id for the pkexec binary. We will set the group id as proc for pkexec (or anything at all that might break). Like Stuid and setgid are not cool security wise, but we are sgid'ing to group rpoc, which is non root, only proc privileges. So worst case some program that uses pkexec may elevate privileges to get access to prov (literally requires vulnerability in the os), which still would be like, no issue because thats basically what we have as of now. Did you consider this? Has this been tried. |
Created for it. |
While debugging another issue, I figured out that |
Hoping to track within the PR from now on, so closing. |
A smaller change only required here, not mixed with remounting. |
#202 had interesting suggestions.
|
This is what's happening after merging #204.
Needs testing. |
Created, for it. |
flatpak: thanks to #204 this is now fixed.
These are all covered by default.
Created, for it. |
/sys
hiding optional and enable by default/sys
hiding optional
For enable hide-hardware-information.service by default, please open a separate ticket if you wish to suggest that. All was implemented what has been discussed in this ticket or follow-up tickets have been created. If something has been forgotten, I guess small, actionable follow-up tickets would be the most productive. hide-hardware-information.service known issues: |
Ok.
Although not tested, I am almost 100% sure practically all the breakage is caused by restricting
/sys
. My recommendation is, we leave this one out. Add/proc/kallsyms
to the list as well, as this contains all the memory addresses for each kernel symbol. And enable what we already have, restricting the sub-directories under proc.Should I follow with the respective pull?
The text was updated successfully, but these errors were encountered: