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

Can't Access Shield Preferences via defaults read $BUNDLE_ID or defaults read $HELPER_BUNDLE_ID #11

Open
0xmachos opened this issue Feb 8, 2021 · 3 comments

Comments

@0xmachos
Copy link

0xmachos commented Feb 8, 2021

macOS Version: macOS 11.2 (20D64)
Kernel Version: Darwin 20.3.0
Shield Version: v0.9.5
User Type: Admin
Terminal Full Disk Access: Yes
SIP: Enabled

Trying to access the Shield preferences via defaults using the BUNDLE_ID & HELPER_BUNDLE_ID (as defined in Constants.h) produces the following errors

$ defaults read com.csaba.fitzl.shield.ShieldHelper
2021-02-08 23:36:29.790 defaults[8539:479032] 
Domain com.csaba.fitzl.shield.ShieldHelper does not exist


$ defaults read com.csaba.fitzl.shield             
2021-02-08 23:40:52.026 defaults[8715:483516] 
Domain com.csaba.fitzl.shield does not exist

To access the Shield preferences you need to use the full path of the preferences file which is DIR_PATH_ES + PREFS_FILE (as defined in Constants.h).

$ defaults read /Library/Application\ Support/Shield/com.csaba.fitzl.shield.preferences.plist
{
    isBlocking = 1;
...
}

You mentioned in the v0.9.5 release notes that you've been using some of the Objective-See code, this works fine for OverSight (defaults read com.objective-see.OverSight) but not BlockBlock so the implementation of preferences in OverSight might help debug this.

@theevilbit
Copy link
Owner

I guess this is because I don't use the "~/Library/Preferences/" folder, while OverSight does. I want to add self-protection later on, so only Shield can modify its own settings, and thus I wanted to keep all files in one place to make it easier. I will defer this until I implement self-protection. Likely not an issue to protect one more location, but will see.

@0xmachos
Copy link
Author

That makes sense, feel free to close this if the two are incompatible.

It would be useful to be able to programatically set the options or set them via an MDM profile but if these are incompatible with self protection then just close this out.

@theevilbit
Copy link
Owner

The idea is that I would allow changing settings only through the app. But reading with "defaults read" could still work. I will keep it open for now, and see how it goes.

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

No branches or pull requests

2 participants