13 Secrets Automation

As described in other sections (in particular “A modern approach to authentication” and “Transport security”), all authenticated interactions with 1Password require that the client prove knowledge of the session key without revealing any secrets. That session key in turn can only be established through proof of knowledge or access to the account passwordSomething you must remember and type when unlocking 1Password. It’s never transmitted from your devices. Previously known as Master Password. and Secret KeyA randomly generated user secret key that is created upon first signup. It’s created and stored locally. Along with the user’s account password, it’s required both for decrypting data and for authenticating to the server. The Secret Key prevents an attacker who has acquired remotely stored data from attempting to guess a user’s account password. Previously known as the Account Key..

This aspect of our security design makes it much harder for someone to work their way around 1Password’s authenticationThe process of one entity proving its identity to another. Typically the authenticating party does this by proving to the verifier that it knows a particular secret that only the authenticator should know., as every request to the service is cryptographically bound to the authentication process itself. It also limits the number of authentication attempts a client can perform in a particular time period.

This security design introduces a challenge when automated processes need to retrieve, modify, or create secrets in 1Password. Such apps and processes are not designed to sign in to 1Password directly; typically those processes are designed to authenticateThe process of one entity proving its identity to another. Typically the authenticating party does this by proving to the verifier that it knows a particular secret that only the authenticator should know. through more traditional means. Reauthenticating for each request would be cumbersome at best.

The 1Password Connect server lives in your environment and acts as a RESTful connection between your apps and the 1Password service.

Figure 13.1: The 1Password Connect server lives in your environment and acts as a RESTful connection between your apps and the 1Password service.

The overall solution we provide as part of Secrets Automation is a Connect Server. It’s capable of signing in to 1Password directly, and apps and automated processes can interact with it through a RESTfulThe adjectival form of representational state transfer (REST). See REST interface. The API for the Connect Server can be called by customer-created clients or built with plug-ins we offer.

Any automated process given power over an organization’s resources, particularly the kinds of resources managed within 1Password, creates an area of attack.23 Therefore, it’s necessary to design them with security in mind. In general, there are two principles to adhere to when deploying automations like these.

  • The power allotted to any given automation should be closely tied and limited to what it’s expected to do.
  • The credentials required by the automation to perform its duties must be securely managed.

1Password Secrets Automation is designed according to these principles — it’s also design to help customers follow the same principles.

You may want to read through what follows multiple times,24 because many of the interacting parts are mentioned before they’re fully defined. In particular, the descriptions of the credentials JSON and bearer token each depend on each other.

13.1 The Connect server

The Connect server is deployed in your environment and serves as a bridge between the client processes and the 1Password service. Although simple in principle, there are a number of interacting parts, so it’s useful to start with an overview and quick facts about it that will be elaborated on later in this chapter.

13.1.1 Service account

1Password service accounts aren’t highly visible to users, but it’s important to mention them to better describe how Secrets Automation works in practice.

Generally speaking, a service account is a special user within a 1Password account, but the user isn’t associated with a person or group of people. They help an organization manage the secrets used by entities with very specific roles and functions.

If Patty, a member of a 1Password account, is responsible for ensuring backups can be restored, they may need access to the credentials for the backups system. But the automated processes that perform backups and restorations shouldn’t have all of Patty’s 1Password privileges. They should only have the privileges required to perform their duties.

The appropriate service accounts are set up in 1Password when setting up Secrets Automation. During creation of a service account, the administrator will select which vaults the service account will have access to and share those vaults with the service account. In this respect, the service account is like an ordinary user. Unlike an ordinary user, the service account has no management privileges and will be prevented from further sharing the vaults to which it has been given the keys by the 1Password backend system.

The account passwordSomething you must remember and type when unlocking 1Password. It’s never transmitted from your devices. Previously known as Master Password. for the service account is randomly generated and discarded after deriving the Account Unlock Key (AUK)Key used to decrypt a user’s personal key set. It’s derived from the user’s account password and Secret Key. Previously known as the Master Unlock Key. and SRP-\(x\)The client secret, 𝑥, used by the Secure Remote Password (SRP) protocol. Derived from the user’s account password and Secret Key.. Key generation is performed client side, either in the web client or the command-line interface (CLI).

Dangerous bend

The service accounts created for Secrets Automation complement the ones created for use by the SCIM bridge, and used for automated management of 1Password users. They have the ability to create and delete users, and add users to groups, but no ability to retrieve data from vaults.

13.1.2 Local deployment

The Connect server, with the encrypted 1Password credentials, is deployed on your system. At initial release, April 2021, we provided setups for deploying it within a Docker container or via Kubernetes. At no time does AgileBits have access to the Connect server or data it stores.

13.1.3 Credential store

The Connect server locally stores encrypted credentials, containing the AUKKey used to decrypt a user’s personal key set. It’s derived from the user’s account password and Secret Key. Previously known as the Master Unlock Key. and SRP-\(x\)The client secret, 𝑥, used by the Secure Remote Password (SRP) protocol. Derived from the user’s account password and Secret Key. for the associated service account. This saves it from having to go through the entire key derivation process each time it needs to start a 1Password session.

An overview of the credentials file, with three major components and some header information.

Figure 13.2: An overview of the credentials file, with three major components and some header information.

13.1.4 The credentials file

When setting up a Connect server initially, the user’s 1Password client constructs a 1password-credentials.json file along with a bearer token. The credentials file has three substantive components: The verifier is used as part of an additional authentication of the bearer token; encCredentials contain the encrypted credentials necessary for the associated service account to sign in to 1Password; and uniqueKey is key shared between the client-facing Connect server and the Connect server syncher.

13.1.5 Encrypted credentials

The encrypted credentials, illustrated in Figure 13.3 contain, unsurprisingly, the encrypted 1Password credentials required to unlock 1Password as the associated service account.

The `encCredentials` object is a JSON web key (JWK) used to encrypted 1Password unlocking credentials. It's encrypted with a key derived from the bearer token.

Figure 13.3: The encCredentials object is a JSON web key (JWK) used to encrypted 1Password unlocking credentials. It’s encrypted with a key derived from the bearer token.

Encryption, as with all our symmetric encryption, is with Advanced Encryption Standard (AES)Probably the best studied and most widely used symmetric block cipher. using Galois Counter Mode (GCM)An authenticated encryption mode for use with block ciphers. for authenticated encryption. The nonceA non-secret value used in conjunction with an encryption key to ensure relationships between multiple plaintexts are not preserved in the encrypted data. Never encrypt different data with the same combination of key and nonce. Ideally, most software developers using encryption – as they should – would never have to interact with or much less understand the difference between them. We do not live in such a world. is given in the \(iv\).

When decrypted, the object is structured as in the Golang structure in Figure 13.4. The URL will typically be something like example.1password.com; the email addresses created for service accounts are never expected to be used for email, and only serve as a username. The user Universally Unique Identifier (UUID)A large arbitrary identifier for an entity. No two entities in the universe should have the same UUID. uniquely identifies the service account Secret KeyA randomly generated user secret key that is created upon first signup. It’s created and stored locally. Along with the user’s account password, it’s required both for decrypting data and for authenticating to the server. The Secret Key prevents an attacker who has acquired remotely stored data from attempting to guess a user’s account password. Previously known as the Account Key.25, SRP-\(x\)The client secret, 𝑥, used by the Secure Remote Password (SRP) protocol. Derived from the user’s account password and Secret Key., and AUKKey used to decrypt a user’s personal key set. It’s derived from the user’s account password and Secret Key. Previously known as the Master Unlock Key. are as described in “A deeper look at keys.”

Decrypted credential structure. The URL, Email, UserUUID, and SecretKey are used to identify the user, account, and service. The SRP-$x$ and AUK are the secrets required to authenticate with 1Password and decrypt (the keys needed to decrypt the keys which encrypt) the vault data.

Figure 13.4: Decrypted credential structure. The URL, Email, UserUUID, and SecretKey are used to identify the user, account, and service. The SRP-\(x\) and AUK are the secrets required to authenticate with 1Password and decrypt (the keys needed to decrypt the keys which encrypt) the vault data.

Connect server verifier

Figure 13.5: Connect server verifier

13.1.6 Verifier

The token within the bearer token is run through a key derivation function, which must match the verifier stored by the Connect server.

This verification is redundant, as the signature verification of the entire bearer token provides all the authenticationThe process of one entity proving its identity to another. Typically the authenticating party does this by proving to the verifier that it knows a particular secret that only the authenticator should know. necessary and guarantees the integrity of the request.

13.1.7 Interprocess key

The 1Password Connect server has two running processes. One provides the user-facing service while the other synchronizes data with 1Password itself. Among other things, this allows the Connect server to operate even when a direct connection to 1Password is unavailable.26 This also allows for much faster responses from the Connect server. The data stored by the sync server is encrypted as with any 1Password client.

Connect server IPC key. The Connect server interprocess key is used to secure communication between the sync server and the client facing Connect service.

Figure 13.6: Connect server IPC key. The Connect server interprocess key is used to secure communication between the sync server and the client facing Connect service.

The interprocess key, here called uniqueKey27 is used as a shared secret between the client-facing Connect server and synchronization server in order to encrypt the bearer token between them.

13.2 Bearer token

The bearer token is a JSON web token (JWT)A means of representing claims to be transferred between two parties and defined in RFC 7517. These are typically signed cryptographically. that’s transmitted from the user’s client process to the Connect server using the HTTP Authorization header. It contains a key that’s used, indirectly, to decrypt the 1Password credentials stored by the Connect server. It also contains claims, in the JWT sense, listing what 1Password vaults it has access to. As a signed JWT, it’s also used directly for authenticationThe process of one entity proving its identity to another. Typically the authenticating party does this by proving to the verifier that it knows a particular secret that only the authenticator should know. to the Connect server. Serialized JWTs are composed of three base64-encoded parts: header, payload, and signature. These parts are separated by the “.” character.

Sample JWT header for bearer tokens

Figure 13.7: Sample JWT header for bearer tokens


  1. This is true whether or not those processes are systematically managed within an organization or are left untracked. It is not difficult to guess which might introduce more risk.↩︎

  2. Or, perhaps, zero times.↩︎

  3. It’s only the non-secret part of the Secret Key used in the process. All service account identifying information must be consistent for successful authentication.↩︎

  4. This might be particularly handy if you are managing your network equipment with Secrets Automation.↩︎

  5. All keys are unique, but are some keys more unique than others? They’re all unique, but coming up with names for yet another key when developing something is difficult, and the temporary placeholder name may stick around longer than anyone might expect.↩︎

  6. Arciszewski (2017)↩︎