As requested on the Discord channel, here are my observations following my recent tests with Thunderbird/Firefox and their policies under MacOS.
When one of these software programs is updated, all the contents of the .app directory in /Applications are deleted by the install_app() function which then copies the .app folder of the new version, so the distribution folder and the policies.json file are deleted (we also use autoconfig/MCD to configure LDAP or add identifiers on new profiles, and this is also lost as a result).
I have therefore retrieved/renamed/modified your Firefox/Thunderbird packages in our repository to reapply the audit of all these packages after installation, which has the effect of reapplying the modifications directly, without waiting for the next audit (the audit() function calling the install() function in case of a missing file).
The other solution, if you only use policies, is to use a .plist file (https://github.com/mozilla/policy-templ... master/mac / https://github.com/thunderbird/policy-t...entral/mac) which will not be removed by the update.
This involves maintaining two separate files or converting the .json file to .plist within the package (possibly using the plutil command). https://gist.github.com/sugarmo/5334805 (but I haven't tested it).
This also means having to run the following command (here for Firefox, but the same applies to Thunderbird, see the previous links):
Code: Select all
run("sudo defaults write /Library/Preferences/org.mozilla.firefox EnterprisePoliciesEnabled -bool TRUE")Another problem encountered, which strangely only occurs on Thunderbird: during a first installation and/or after an update, on the first launch of the program, Mac will check the signature of the application.
If the signature is invalid, it displays a message indicating that the application is damaged and refuses to launch it (requiring you to go through System Preferences / Privacy & Security to force authorization, which is a bit of a pain, especially with each update). However, the signature is no longer valid after copying any file (typically the policies.json file) to /Applications/Thunderbird/Contents/Resources/
The signature can be verified using the following command:
Code: Select all
codesign --verify --verbose /Applications/Thunderbird.appThe only solution I found to avoid this problem is to re-sign the package after adding the policy files, using the following command:
Code: Select all
codesign -f -s - /Applications/Contents/MacOS/thunderbirdIf it can save others from wasting hours on this...
