The system keychain is stored in /Library/Keychains/System.keychain
and the key to unlock it is stored in /var/db/SystemKey
(its default file permissions are readable by root only). The location of these files is referenced in the security-checksystem script (from the security_systemkeychain source). It is even possible to test to automatic locking/unlocking of the system keychain by using
systemkeychain -vt
The keychain security framework allows non-privileged programs to make requests for information provided they are in the ACL stored within the keychain entry. Obviously if a user has root they on a system they can directly access both the file storing the system keychain and the key to unlock it, thus they do not have make requests via the security framework and are not beholden to the ACLs stored within the keychain itself.
(I didn't actually answer the original questions so let's give this another go)
How are the keys architected such that any administrative user can unlock the System Keychain?
The libsecurity keychain framework allows regular processes to interact with the system keychain in an authenticated manner using Apple's XPC interprocess communication framework (IPC).
Program A sends a request to access the system keychain information using IPC. A check is made that the requesting user is already in the wheel group and also knows the password of a user in the wheel group. Once authorization is confirmed, the privileged kcproxy
daemon can be used to access material in /var/db/SystemKey
, unlock the system keychain and return the requested information.
Are there cryptographic restrictions that limit what an administrative user can do with information in the System Keychain in any way?
No - an administrative user is allowed to access/change anything in the system keychain. Even if they couldn't, they could copy the underlying files to another machine on which they have complete control and just unlock/access it there.
Given an unencrypted system backup without /Users, how would you gain access to the keys in the System Keychain?
If the backup contained copies of /Library/Keychains/System.keychain
and /var/db/SystemKey
then I would copy them to their respective locations on a new OS X system and use systemkeychain
to make the later unlock the former and dump the keychain database using security dump-keychain
.
A late reply, as I found this post while searching for something related.
You have to create a new keychain, and copy your iCloud keychain items to the new local keychain. Then you can use the security tool to dump them.
Since this is 1Password-related question, for others in the future, you can use MrC's conversion utility to directly convert the keychain dump into a 1Password consumable 1PIF file. It is much better than CSV importing.
https://discussions.agilebits.com/discussion/30286/mrcs-convert-to-1password-utility/p1
Best Answer
Why?
The login keychain is for your user account. Moving that data to the system keychain would make your information available to all user accounts including 'Guest' accounts. Do you really want to do that?
I don't know if it is possible to do what you want, but if I look at my login keychain it includes my personal passwords, Apple ID, public keys (no problem), and private keys. These should never be made available to anyone. They are private for a reason.
Don't do this.