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

profiles: replace private-opt with whitelist & document private-opt issues #6021

Merged
merged 3 commits into from
Oct 18, 2023

Conversation

glitsj16
Copy link
Collaborator

private-opt breaks file-copy-limit, use a whitelist instead of draining RAM
cfr. #5307

This PR streamlines the comment and does the relevant whitelisting in /opt.

@kmk3 kmk3 changed the title exchange private-opt with a whitelist profiles: exchange private-opt with a whitelist Sep 25, 2023
kmk3
kmk3 previously requested changes Sep 25, 2023
Copy link
Collaborator

@kmk3 kmk3 left a comment

Choose a reason for hiding this comment

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

(Adding a NAK mostly due to the duplication)

Misc: It seems like a good idea to avoid private-opt for very heavy programs
(like electron-based ones), but I'm not sure about never using it on upstream
profiles (I might expand on this later).

etc/profile-m-z/youtube.profile Outdated Show resolved Hide resolved
@glitsj16
Copy link
Collaborator Author

Misc: It seems like a good idea to avoid private-opt for very heavy programs
(like electron-based ones), but I'm not sure about never using it on upstream
profiles (I might expand on this later).

@kmk3 Thanks for your review. I had similar doubts about discarding private-opt across the board. True, for less sizable applications the RAM overhead looks tolerable. I'm just not sure where we should draw the line. IMO it's rather likely that users will have way more than one sandbox running in parallel, and things start to add up. I should have elaborated on my reasoning in this context. When I compared the sandbox gains of having private-opt on top of whitelisting the relevant path(s) under /opt I just couldn't see all that much extra hardening to be honest. Looking forward to your insights/arguments.

@kmk3 kmk3 added the documentation Issues and pull requests related to the documentation label Sep 30, 2023
@kmk3 kmk3 force-pushed the private-opt-whitelist branch from 6967039 to 6429a21 Compare October 2, 2023 17:36
In most profiles.

Kept private-opt for enpass (~85MB), mate-dictionary (<20MB),
minecraft-launcher (~1.6MB) and ppsspp (~44MB). The only app I couldn't
check: xmr-stak.
@kmk3 kmk3 force-pushed the private-opt-whitelist branch from 6429a21 to f7ae17a Compare October 18, 2023 17:55
@kmk3
Copy link
Collaborator

kmk3 commented Oct 18, 2023

Sorry for the delay, I couldn't get to this earlier.

@glitsj16 on Sep 26:

Thanks for your review. I had similar doubts about discarding private-opt
across the board. True, for less sizable applications the RAM overhead looks
tolerable. I'm just not sure where we should draw the line. IMO it's rather
likely that users will have way more than one sandbox running in parallel,
and things start to add up. I should have elaborated on my reasoning in this
context. When I compared the sandbox gains of having private-opt on top of
whitelisting the relevant path(s) under /opt I just couldn't see all that
much extra hardening to be honest.

👍

Looking forward to your insights/arguments.

Not much insight, just this:

Pros:

  • Programs in /opt tend to be heavy, so less RAM would be wasted
  • Always using whitelist /opt/dir upstream would be simpler

Cons:

  • Programs in /opt tend to be complex and proprietary, so a bit of extra
    security might be useful

I mostly just wanted to give it some consideration, but indeed it's hard to
draw a line and I'm also not sure how much it really matters.

@glitsj16 on Sep 27:

Did some extra research on the size of the non-electron apps. I implemented
your suggestions, including a warning note to firejail(1). Kept private-opt
for enpass (~85MB), mate-dictionary (<20MB), minecraft-launcher (~1.6MB) and
ppsspp (~44MB). The only app I couldn't check: xmr-stak (FTBFS on my Arch
Linux box). I returned it to the functional state it had prior to this PR.

Sounds good to me.

@kmk3 kmk3 dismissed their stale review October 18, 2023 18:08

Fixed

@kmk3
Copy link
Collaborator

kmk3 commented Oct 18, 2023

Main force-push changes:

  • Removed whitelist when there's private-opt for consistency
  • Edited/added more to the docs

It currently looks good to me.

Thoughts on the changes?

@glitsj16
Copy link
Collaborator Author

@kmk3

Sorry for the delay, I couldn't get to this earlier.

That's quite allright, no worries.

Thoughts on the changes?

I'm okay with your changes. Like you mentioned, there will always be pros & cons to private-opt and users should be aware of the RAM-ifications. Not much more we can do here IMO.

Thanks again for your efforts and opinions!

@glitsj16 glitsj16 merged commit 1759055 into netblue30:master Oct 18, 2023
3 checks passed
@glitsj16 glitsj16 deleted the private-opt-whitelist branch October 18, 2023 22:47
@kmk3 kmk3 changed the title profiles: exchange private-opt with a whitelist profiles: replace private-opt with whitelist & document private-opt issues Oct 18, 2023
kmk3 added a commit that referenced this pull request Oct 19, 2023
These profile-related changes seem significant enough to warrant
entries, as #6021 adds some guidance on the use of private-opt and #5987
standardizes the format of commented code in all profiles.

Relates to #5987 #6021.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Issues and pull requests related to the documentation
Projects
Status: Done (on RELNOTES)
Development

Successfully merging this pull request may close these issues.

2 participants