Shield icon indicating copy to clipboard operation
Shield copied to clipboard

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

Open 0xmachos opened this issue 5 years ago • 3 comments

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.

0xmachos avatar Feb 08 '21 23:02 0xmachos

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.

theevilbit avatar Feb 09 '21 10:02 theevilbit

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.

0xmachos avatar Feb 10 '21 13:02 0xmachos

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.

theevilbit avatar Feb 10 '21 14:02 theevilbit