2015-04-11 01:16:36 +00:00
|
|
|
|
---
|
2020-01-18 00:18:09 +00:00
|
|
|
|
layout: docs
|
|
|
|
|
page_title: Security Model
|
|
|
|
|
description: Learn about the security model of Vault.
|
2015-04-11 01:16:36 +00:00
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
# Security Model
|
|
|
|
|
|
2022-08-12 22:39:58 +00:00
|
|
|
|
Due to the nature of Vault and the confidentiality of data it manages,
|
2015-04-11 01:16:36 +00:00
|
|
|
|
the Vault security model is very critical. The overall goal of Vault's security
|
|
|
|
|
model is to provide [confidentiality, integrity, availability, accountability,
|
2016-01-14 18:42:47 +00:00
|
|
|
|
authentication](https://en.wikipedia.org/wiki/Information_security).
|
2015-04-11 01:16:36 +00:00
|
|
|
|
|
|
|
|
|
This means that data at rest and in transit must be secure from eavesdropping
|
|
|
|
|
or tampering. Clients must be appropriately authenticated and authorized
|
2022-08-12 22:39:58 +00:00
|
|
|
|
to access data or modify policies. All interactions must be auditable and traced
|
|
|
|
|
uniquely back to the origin entity, and the system must be robust against intentional
|
2015-04-11 01:16:36 +00:00
|
|
|
|
attempts to bypass any of its access controls.
|
|
|
|
|
|
|
|
|
|
# Threat Model
|
|
|
|
|
|
|
|
|
|
The following are the various parts of the Vault threat model:
|
|
|
|
|
|
2020-01-18 00:18:09 +00:00
|
|
|
|
- Eavesdropping on any Vault communication. Client communication with Vault
|
2015-04-11 01:16:36 +00:00
|
|
|
|
should be secure from eavesdropping as well as communication from Vault to
|
2022-01-28 15:15:22 +00:00
|
|
|
|
its storage backend or between Vault cluster nodes.
|
2015-04-11 01:16:36 +00:00
|
|
|
|
|
2020-01-18 00:18:09 +00:00
|
|
|
|
- Tampering with data at rest or in transit. Any tampering should be detectable
|
2015-04-11 01:16:36 +00:00
|
|
|
|
and cause Vault to abort processing of the transaction.
|
|
|
|
|
|
2020-01-18 00:18:09 +00:00
|
|
|
|
- Access to data or controls without authentication or authorization. All requests
|
2015-04-11 01:16:36 +00:00
|
|
|
|
must be proceeded by the applicable security policies.
|
|
|
|
|
|
2020-01-18 00:18:09 +00:00
|
|
|
|
- Access to data or controls without accountability. If audit logging
|
2015-04-11 01:16:36 +00:00
|
|
|
|
is enabled, requests and responses must be logged before the client receives
|
|
|
|
|
any secret material.
|
|
|
|
|
|
2020-01-18 00:18:09 +00:00
|
|
|
|
- Confidentiality of stored secrets. Any data that leaves Vault to rest in the
|
2015-04-11 01:16:36 +00:00
|
|
|
|
storage backend must be safe from eavesdropping. In practice, this means all
|
|
|
|
|
data at rest must be encrypted.
|
|
|
|
|
|
2020-01-18 00:18:09 +00:00
|
|
|
|
- Availability of secret material in the face of failure. Vault supports
|
2015-04-11 01:16:36 +00:00
|
|
|
|
running in a highly available configuration to avoid loss of availability.
|
|
|
|
|
|
2022-08-12 22:39:58 +00:00
|
|
|
|
The following are not considered part of the Vault threat model:
|
2015-04-11 01:16:36 +00:00
|
|
|
|
|
2020-01-18 00:18:09 +00:00
|
|
|
|
- Protecting against arbitrary control of the storage backend. An attacker
|
2015-04-11 01:16:36 +00:00
|
|
|
|
that can perform arbitrary operations against the storage backend can
|
2015-05-19 19:11:48 +00:00
|
|
|
|
undermine security in any number of ways that are difficult or impossible to protect
|
2015-04-11 01:16:36 +00:00
|
|
|
|
against. As an example, an attacker could delete or corrupt all the contents
|
2015-05-05 07:05:05 +00:00
|
|
|
|
of the storage backend causing total data loss for Vault. The ability to control
|
2015-04-11 01:16:36 +00:00
|
|
|
|
reads would allow an attacker to snapshot in a well-known state and rollback state
|
|
|
|
|
changes if that would be beneficial to them.
|
|
|
|
|
|
2020-01-18 00:18:09 +00:00
|
|
|
|
- Protecting against the leakage of the existence of secret material. An attacker
|
2015-04-11 01:16:36 +00:00
|
|
|
|
that can read from the storage backend may observe that secret material exists
|
|
|
|
|
and is stored, even if it is kept confidential.
|
|
|
|
|
|
2020-01-18 00:18:09 +00:00
|
|
|
|
- Protecting against memory analysis of a running Vault. If an attacker is able
|
2022-08-12 22:39:58 +00:00
|
|
|
|
to inspect the memory state of a running Vault instance, then the confidentiality
|
2015-04-11 01:16:36 +00:00
|
|
|
|
of data may be compromised.
|
|
|
|
|
|
2022-01-05 17:23:55 +00:00
|
|
|
|
- Protecting against flaws in external systems or services used by Vault.
|
|
|
|
|
Some authentication methods or secrets engines delegate sensitive operations to
|
|
|
|
|
systems external to Vault. If an attacker can compromise credentials or otherwise
|
|
|
|
|
exploit a vulnerability in these external systems, then the confidentiality or
|
|
|
|
|
integrity of data may be compromised.
|
|
|
|
|
|
|
|
|
|
- Protecting against malicious plugins or code execution on the underlying host.
|
|
|
|
|
If an attacker can gain code execution or write privileges to the underlying host,
|
|
|
|
|
then the confidentiality or the integrity of data may be compromised.
|
|
|
|
|
|
2022-03-15 20:27:41 +00:00
|
|
|
|
- Protecting against flaws in clients or systems that access Vault. If an attacker
|
|
|
|
|
can compromise a Vault client (e.g., system, browser) and obtain this client’s Vault
|
|
|
|
|
credentials, they can access Vault with the level of privilege associated with this
|
|
|
|
|
client.
|
|
|
|
|
|
2015-04-14 02:09:38 +00:00
|
|
|
|
# External Threat Overview
|
|
|
|
|
|
2022-08-12 22:39:58 +00:00
|
|
|
|
Vault architecture compromises of three distinct systems:
|
|
|
|
|
|
|
|
|
|
- Client: Speaks to Vault over an API.
|
|
|
|
|
- Server: Provides an API and serves requests.
|
|
|
|
|
- Storage backend: Utilized by the server to read and write data.
|
|
|
|
|
|
2015-04-14 02:09:38 +00:00
|
|
|
|
|
|
|
|
|
There is no mutual trust between the Vault client and server. Clients use
|
2018-03-19 23:53:12 +00:00
|
|
|
|
[TLS](https://en.wikipedia.org/wiki/Transport_Layer_Security) to verify the
|
|
|
|
|
identity of the server and to establish a secure communication channel. Servers
|
|
|
|
|
require that a client provides a client token for every request which is used
|
2020-01-18 00:18:09 +00:00
|
|
|
|
to identify the client. A client that does not provide their token is only
|
2018-03-19 23:53:12 +00:00
|
|
|
|
permitted to make login requests.
|
|
|
|
|
|
2022-01-28 15:15:22 +00:00
|
|
|
|
All server-to-server traffic between Vault instances within a cluster (i.e,
|
|
|
|
|
high availability, enterprise replication or integrated storage) uses
|
|
|
|
|
mutually-authenticated TLS to ensure the confidentiality and integrity of data
|
2022-08-12 22:39:58 +00:00
|
|
|
|
in transit. Nodes are authenticated prior to joining the cluster by an
|
2023-01-26 00:12:15 +00:00
|
|
|
|
[unseal challenge](/vault/docs/concepts/integrated-storage#vault-networking-recap) or
|
|
|
|
|
a [one-time-use activation token](/vault/docs/enterprise/replication#security-model).
|
2022-01-28 15:15:22 +00:00
|
|
|
|
|
2018-03-19 23:53:12 +00:00
|
|
|
|
The storage backends used by Vault are also untrusted by design. Vault uses a
|
|
|
|
|
security barrier for all requests made to the backend. The security barrier
|
|
|
|
|
automatically encrypts all data leaving Vault using a 256-bit [Advanced
|
|
|
|
|
Encryption Standard
|
|
|
|
|
(AES)](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard) cipher in
|
|
|
|
|
the [Galois Counter Mode
|
|
|
|
|
(GCM)](https://en.wikipedia.org/wiki/Galois/Counter_Mode) with 96-bit nonces.
|
|
|
|
|
The nonce is randomly generated for every encrypted object. When data is read
|
2022-08-12 22:39:58 +00:00
|
|
|
|
from the security barrier, the GCM authentication tag is verified during the
|
2018-03-19 23:53:12 +00:00
|
|
|
|
decryption process to detect any tampering.
|
2015-04-14 02:09:38 +00:00
|
|
|
|
|
2015-04-14 17:33:16 +00:00
|
|
|
|
Depending on the backend used, Vault may communicate with the backend over TLS
|
2022-08-12 22:39:58 +00:00
|
|
|
|
to provide an added layer of security. In some cases, such as a file backend,
|
2018-03-19 23:53:12 +00:00
|
|
|
|
this is not applicable. Because storage backends are untrusted, an eavesdropper
|
|
|
|
|
would only gain access to encrypted data even if communication with the backend
|
|
|
|
|
was intercepted.
|
2015-04-14 02:09:38 +00:00
|
|
|
|
|
|
|
|
|
# Internal Threat Overview
|
|
|
|
|
|
|
|
|
|
Within the Vault system, a critical security concern is an attacker attempting
|
|
|
|
|
to gain access to secret material they are not authorized to. This is an internal
|
2022-08-12 22:39:58 +00:00
|
|
|
|
threat if the attacker is already permitted to some level of access to Vault, and is
|
2015-04-14 02:09:38 +00:00
|
|
|
|
able to authenticate.
|
|
|
|
|
|
2018-10-08 16:45:17 +00:00
|
|
|
|
When a client first authenticates with Vault, an auth method is used to verify
|
|
|
|
|
the identity of the client and to return a list of associated ACL policies.
|
|
|
|
|
This association is configured by operators of Vault ahead of time. For
|
|
|
|
|
example, GitHub users in the "engineering" team may be mapped to the
|
|
|
|
|
"engineering" and "ops" Vault policies. Vault then generates a client token
|
|
|
|
|
which is a randomly generated, serialized value and maps it to the policy list.
|
|
|
|
|
This client token is then returned to the client.
|
|
|
|
|
|
2022-08-12 22:39:58 +00:00
|
|
|
|
On each request, a client provides this token. Vault then uses it to check that
|
2018-10-08 16:45:17 +00:00
|
|
|
|
the token is valid and has not been revoked or expired, and generates an ACL
|
2021-11-10 17:38:02 +00:00
|
|
|
|
based on the associated policies. Vault uses a strict default deny
|
2021-05-29 23:15:41 +00:00
|
|
|
|
enforcement strategy. This means unless an associated policy allows for a given action,
|
2018-10-08 16:45:17 +00:00
|
|
|
|
it will be denied. Each policy specifies a level of access granted to a path in
|
|
|
|
|
Vault. When the policies are merged (if multiple policies are associated with a
|
2020-01-18 00:18:09 +00:00
|
|
|
|
client), the highest access level permitted is used. For example, if the
|
2018-10-08 16:45:17 +00:00
|
|
|
|
"engineering" policy permits read/update access to the "eng/" path, and the
|
|
|
|
|
"ops" policy permits read access to the "ops/" path, then the user gets the
|
|
|
|
|
union of those. Policy is matched using the most specific defined policy, which
|
2021-01-27 04:14:47 +00:00
|
|
|
|
may be an exact match or the longest-prefix match glob pattern. See
|
2023-01-26 00:12:15 +00:00
|
|
|
|
[Policy Syntax](/vault/docs/concepts/policies#policy-syntax) for more details.
|
2015-04-14 02:09:38 +00:00
|
|
|
|
|
|
|
|
|
Certain operations are only permitted by "root" users, which is a distinguished
|
2018-10-08 16:45:17 +00:00
|
|
|
|
policy built into Vault. This is similar to the concept of a root user on a
|
2022-08-12 22:39:58 +00:00
|
|
|
|
Unix system or an administrator on Windows. In cases where clients are provided
|
|
|
|
|
with root tokens or associated with the root policy, Vault supports the
|
2020-01-18 00:18:09 +00:00
|
|
|
|
notion of "sudo" privilege. As part of a policy, users may be granted "sudo"
|
2018-10-08 16:45:17 +00:00
|
|
|
|
privileges to certain paths, so that they can still perform security sensitive
|
|
|
|
|
operations without being granted global root access to Vault.
|
|
|
|
|
|
2022-01-05 17:23:55 +00:00
|
|
|
|
Lastly, Vault supports using a [Two-person
|
|
|
|
|
rule](https://en.wikipedia.org/wiki/Two-person_rule) for unsealing using [Shamir's
|
2018-10-08 16:45:17 +00:00
|
|
|
|
Secret Sharing
|
2020-01-18 00:18:09 +00:00
|
|
|
|
technique](https://en.wikipedia.org/wiki/Shamir's_Secret_Sharing). When Vault
|
2019-05-30 00:13:13 +00:00
|
|
|
|
is started, it starts in a _sealed_ state. This means that the encryption key
|
2018-10-08 16:45:17 +00:00
|
|
|
|
needed to read and write from the storage backend is not yet known. The process
|
2022-03-17 05:01:38 +00:00
|
|
|
|
of unsealing requires providing the root key so that the encryption key can
|
|
|
|
|
be retrieved. The risk of distributing the root key is that a single
|
2022-08-12 22:39:58 +00:00
|
|
|
|
malicious attacker with access to it can decrypt the entire Vault. Instead,
|
2022-03-17 05:01:38 +00:00
|
|
|
|
Shamir's technique allows us to split the root key into multiple shares or
|
2020-01-18 00:18:09 +00:00
|
|
|
|
parts. The number of shares and the threshold needed is configurable, but by
|
2018-10-08 16:45:17 +00:00
|
|
|
|
default Vault generates 5 shares, any 3 of which must be provided to
|
2022-03-17 05:01:38 +00:00
|
|
|
|
reconstruct the root key.
|
2018-10-08 16:45:17 +00:00
|
|
|
|
|
|
|
|
|
By using a secret sharing technique, we avoid the need to place absolute trust
|
2022-03-17 05:01:38 +00:00
|
|
|
|
in the holder of the root key, and avoid storing the root key at all. The
|
|
|
|
|
root key is only retrievable by reconstructing the shares. The shares are not
|
2018-10-08 16:45:17 +00:00
|
|
|
|
useful for making any requests to Vault, and can only be used for unsealing.
|
|
|
|
|
Once unsealed the standard ACL mechanisms are used for all requests.
|
|
|
|
|
|
2020-01-18 00:18:09 +00:00
|
|
|
|
To make an analogy, a bank puts security deposit boxes inside of a vault. Each
|
2018-10-08 16:45:17 +00:00
|
|
|
|
security deposit box has a key, while the vault door has both a combination and
|
2020-01-18 00:18:09 +00:00
|
|
|
|
a key. The vault is encased in steel and concrete so that the door is the only
|
2022-08-12 22:39:58 +00:00
|
|
|
|
practical entrance. The analogy to Vault is that the cryptosystem is the
|
2020-01-18 00:18:09 +00:00
|
|
|
|
steel and concrete protecting the data. While you could tunnel through the
|
2018-10-08 16:45:17 +00:00
|
|
|
|
concrete or brute force the encryption keys, it would be prohibitively time
|
|
|
|
|
consuming. Opening the bank vault requires two-factors: the key and the
|
2020-01-18 00:18:09 +00:00
|
|
|
|
combination. Similarly, Vault requires multiple shares be provided to
|
2022-03-17 05:01:38 +00:00
|
|
|
|
reconstruct the root key. Once unsealed, each security deposit boxes still
|
2022-08-12 22:39:58 +00:00
|
|
|
|
requires that the owner provide a key, and similarly the Vault ACL system protects
|
2018-10-08 16:45:17 +00:00
|
|
|
|
all the secrets stored.
|