I'm working on a script to import numerous Certs (Like 50) into System.keychain
. macOS Sonoma Security Features are preventing the security command from fully working.
Note: Intune MDM Trusted Cert Configuration Profiles only allow one at a time.
The security command will install the certs but won't authorize them even if it is running as root (still set to "Use System Defaults" in Keychain). - Must Use Command Line:
security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain <cert.crt>
security add-trusted-cert -d -r trustAsRoot -k /Library/Keychains/System.keychain <cert.crt>
In our Ansible Playbooks/Roles we used this HACK:
security authorizationdb write com.apple.trust-settings.admin allow
Reference on the Apple Developer Forum thread security add-trusted-cert asks password twice in some cases: The authorization was denied since no user interaction was possible
Is there a better/newer way to do this in Sonoma from the terminal?