Closed File Path (Need Help)

HiddenWindow

New member
I'm trying to understand David's guide here https://sandboxie-plus.com/sandboxie/closedfilepath/

but I am semi-illiterate in this matter.

Here is my scenario,
Firefox is running in a sandbox. I go to a suspicious website. I want to prevent the suspicious website from potentially reading local files outside of this "private browsing and specific profile Firefox instance" to protect locally held files and data from being scraped or read.

I know FF needs to access the user data (C:/User/AppData/Roaming/Mozilla/Firefox) for the appropriate profile and the Downloads folder for downloads.

I want to force FF to only access one specific user profile while sandboxed, without read permissions for any other files on the PC except downloads of course.
If anyone here understands better and can assist, would be much obliged.
 
Here you can have an overview about the resource access settings.

The original source of Sandboxie did not have an access model that was based on how specific a rule is. David added "RuleSpecificity" UseRuleSpecificity=y which requires a supporter certificate to be used.

With it being enabled you can use ClosedFilePath=C:/Users/* and OpenFilePath=C:/Users/username/AppData/Roaming/Mozilla\Firefox/pathtoprofile

If you can use "RuleSpecificity" you can use UsePrivacyMode=y, what restricts access to mostly generic resources, where you have to grant access to the user folders by adding the rules you need.

Just for your information, a website can't access the file system directly, it may ask the browser. The implementation of the File System API in Firefox is said to be more conservative compared to Chromium based browsers. The general concept is that the user is prompted and has to pick the files or the folder. In general browsing the Same-Origin-Policy is isolating content based on the origin of the request. Firefox itself uses an internal sandbox by using different processes with different restrictions. Surely there could be flaws in the logic or exploits that break the security properties, which is where Sandboxie can be helpful in mitigating this problem.
 
Here you can have an overview about the resource access settings.

The original source of Sandboxie did not have an access model that was based on how specific a rule is. David added "RuleSpecificity" UseRuleSpecificity=y which requires a supporter certificate to be used.

With it being enabled you can use ClosedFilePath=C:/Users/* and OpenFilePath=C:/Users/username/AppData/Roaming/Mozilla\Firefox/pathtoprofile

If you can use "RuleSpecificity" you can use UsePrivacyMode=y, what restricts access to mostly generic resources, where you have to grant access to the user folders by adding the rules you need.

Just for your information, a website can't access the file system directly, it may ask the browser. The implementation of the File System API in Firefox is said to be more conservative compared to Chromium based browsers. The general concept is that the user is prompted and has to pick the files or the folder. In general browsing the Same-Origin-Policy is isolating content based on the origin of the request. Firefox itself uses an internal sandbox by using different processes with different restrictions. Surely there could be flaws in the logic or exploits that break the security properties, which is where Sandboxie can be helpful in mitigating this problem.

Thanks for the response.

Another question for you, since Sandboxie Plus (New UI) is different than classic - is this feature only able to be turned on by editing the .ini file or is it in the general UI somewhere? Eg. Options > Global Options or Sandbox > Sandbox Options?

So ClosedFilePath= applies to folders you specifically do not want the sandboxed app to access?
And OpenFilePath= applies to the folders you want to allow?

When a red sandbox is opened (security hardened with data protection), is it's default state to allow only the specific instance profile being used eg. if my main FF profile is (Personal Profile 1) and my secondary FF Sandboxie Privacy is (SB Profile 2) only SB Profile 2's user data folder gets accessed when SB Profile 2 is loaded using the Run menu?

It's a massive learning curve for me!
 
Sandboxie Plus (New UI) is different than classic - is this feature only able to be turned on by editing the .ini file or is it in the general UI somewhere?

The user interface of Sandboxie Classic has not received updates for the new features, so that editing the INI is the only way to enable them, as far as I know. Most features should be accessible in the new user interface for Sandboxie Plus.

Sandbox Options > Resource Access > [Access Policies] > "Privacy Mode..." enables the privacy mode (data protection), this should set "RuleSpecificity"
Sandbox Options > Resource Access > [Access Policies] > "Prioritize rules based on their Specificity and Process Match Level" enables "RuleSpecificity"

So ClosedFilePath= applies to folders you specifically do not want the sandboxed app to access?
And OpenFilePath= applies to the folders you want to allow?

Yes, Sandboxie denies access to files and folders for ClosedFilePath=, of any kind.
OpenFIlePath= Allows a sandboxed application which binary is on the real system to read and write to the real location.
OpenPipePath= Allows a sandboxed application, no matter where the binary is located to read and write to the real location.
ReadFilePath= Allows a sandboxed application to read from the real location, but prevents it from writing to the real location.
WriteFilePath= For a sandboxed application the specified path appears to be empty, but it can write into the sandbox. (E.g. C:\myapp\settings contains settings.ini so setting "WriteFilePath=C:\myapp\settings\*" and then starting myapp in that sandbox, allows the application to create a new settings file.
NormalFilePath= restores default access to sandboxes with data protection. By default, the sandboxed application can read all the files the starting user has reading access to. With Privacy Mode, the access gets restricted so that, the user folder like "C:\Users\username\Documents" can't be read. If you need the sandboxed application to read files at that location you use "NormalFilePath=C:\Users\username\Documents\*"

When a red sandbox is opened (security hardened with data protection), is it's default state to allow only the specific instance profile being used eg. if my main FF profile is (Personal Profile 1) and my secondary FF Sandboxie Privacy is (SB Profile 2) only SB Profile 2's user data folder gets accessed when SB Profile 2 is loaded using the Run menu?

With data protection enabled (be it blue or red) Firefox being started in such a sandbox, won't be able to access the profile data, that is located in the user folder on the real machine. It can read a profile that is located inside the sandbox. If you create a new sandbox with data protection (red or blue) and start Firefox in such a box, it will start with a fresh profile, unless you allow it to read the profile on the real machine (by using NormalFilePath) or even write access (using OpenFilePath) if you want passwords, cookies and extensions to be updated on the real system.

It's a massive learning curve for me!
I agree; It's not that easy. Data Protection makes it easier, since you don't have to create that many rules.
 
Back
Top