Most companies have spent years locking up their secrets in a vault, some have started recently. Database passwords, API keys and certificates sitting behind identity-based policies, audit logs and short lifetimes. Yet one credential usually escapes all of that care: the one an application needs to open the vault in the first place.That first credential is called secret zero.
With Vault 2.2, HashiCorp added TPM authentication, which lets a machine prove who it is with hardware instead of a copied secret. Combined with SPIFFE workload identity, which had already been introduced previously as an auth method in Vault, companies can now remove the bootstrap secret from on-premises environments entirely. This post explains how, and why it matters beyond the security team.
The weakest link is the first one
Before an application can fetch a single secret, it has to log in. Today that login usually relies on something like an AppRole SecretID or a token. Someone has to put that credential on the machine: a provisioning script, a cloud-init file, a CI variable or a person.
Every one of those paths creates exposure:
- It can be copied. A credential in a file works just as well on an attacker's laptop as on the intended server.
- It spreads. It passes through pipelines, images, backups and tickets, each a new place to leak.
- It is hard to rotate. Rotating means redelivering it to every machine, so teams often stop rotating.
- It hides in plain sight. Audit logs show a valid login, not whether the right machine made it.
In the public cloud this problem is largely solved by platform identity. AWS, Azure, Google Cloud and IBM Cloud vouch for each instance. On-premises virtual machines never had an equivalent, and that is where many companies still run their plenty of workloads.
Layer 1: the machine proves itself with hardware
A Trusted Platform Module (TPM) is a small security chip, physical or virtual, built into most servers and hypervisors. Each TPM holds an Endorsement Key (EK). Its private half is created inside the chip and never leaves it. Its public half can be shared freely, which makes it a perfect machine fingerprint.
Vault 2.2 uses that fingerprint in a new TPM auth method:
- Enroll. When a VM is provisioned, the pipeline registers the TPM's public EK in Vault and links it to a role and its policies.
- Attest. At startup, the VM asks Vault for a certificate. Vault sends back a challenge that only that exact TPM can decrypt.
- Authenticate. Once the TPM answers correctly, Vault issues a short-lived client certificate whose private key lives inside the TPM. The VM logs in with it and receives a Vault token.
The key point is what never happens: no secret is delivered to the machine. The only thing anyone handles is a public key. If an attacker copies the VM's files, certificate included, to another server, login fails, because the private key stayed behind in the chip.
The operating model changes too. Instead of distributing secrets, platform teams register machines. Enrollment becomes one more step in VM provisioning, and access stays governed centrally by Vault policy. We can go one step further and automate this with Terraform's Vault provider.
Using terraform you might ask yourself: Doesn't it need a token aswell? The answer is yes. But something has to be allowed to write to Vault. The trust problem does not vanish, it changes shape in three useful ways.
- It moves from every machine to one place. Instead of a secret on each of hundreds of VMs, there is one enrollment identity in one pipeline, reducing the attack surface. That single point can be guarded, monitored and reviewed far more closely.
- It doesn't need to be a stored secret. Most CI platforms issue each pipeline run a short-lived OIDC token, and Vault can trust that platform through JWT auth, as in the provider block above. HCP Terraform offers the same through dynamic provider credentials. The trust chain then ends at the CI platform's signing key and at whoever can approve a merge, not at a password in a file.
- It can do very little. Give the enroller a narrow policy: write to
identity/tpm and the TPM groups, nothing else. It cannot read a single application secret, so stealing it does not hand over the data. Take advantage of Vault's highly granular permission policies.
What remains is the risk of enrolling the wrong machine. If an attacker can get their own EK into the pipeline, Vault will trust it. So take each EK from a source the VM does not control, such as the virtualization platform or an asset inventory, verify the EK certificate chain where your vTPM provides one, and require a reviewed terraform plan before every apply. Trust has not disappeared, but it now sits where controls and audit already live.
Layer 2: each workload gets its own identity
A TPM identifies a machine, not the software on it. If a payments service and a reporting job share a VM, the TPM sees them as the same thing. For least privilege, zero trust approach, each workload needs its own identity.
That is what SPIFFE provides. It is an open standard for workload identity, and SPIRE is its most common implementation. Every service gets a name such as spiffe://example.org/payments and a short-lived, automatically rotated credential called an SVID. Before issuing one, SPIRE checks the workload itself, for example which Unix user or Kubernetes service account it runs as.
Vault accepts these SVIDs through its SPIFFE auth method and maps each identity to its own policy. The payments service can read the payments database credentials. The reporting job, on the same host, cannot.
SPIFFE also reaches beyond Vault. The same identity can secure service-to-service mTLS and federate across clouds and data centers, giving companies one identity language for every environment.
An injected workload can't use a real workload's identity without root access. The workloads never present a credential to get its identity. The SPIRE agent works out who is calling from facts the caller cannot fake:
- The kernel names the caller. A process connects to the agent over a local Unix socket. The kernel, not the process, tells the agent its PID, user and group.
- Attestor plugins inspect that process. Using the PID, the agent looks up facts from the operating system and platform: binary path and hash, systemd unit, container image, Kubernetes pod and service account.
- Facts are matched against registration entries. An administrator has declared in advance which combination of facts earns which SPIFFE ID. The agent issues an SVID only if every condition matches.
So an injected process fails in most realistic cases. A shell started by an attacker runs as the wrong user, from the wrong binary or outside the right unit, and gets nothing. Copying the binary is not enough either, because the parent ID ties the entry to one attested node.
The limits are honest ones. Attestation identifies a process, not its intentions. Code injected into the genuine payments process, or an attacker with root on the host, can obtain that identity, because root can impersonate any user and tamper with any binary. SPIFFE contains that damage rather than preventing it: SVIDs expire within hours, each identity reaches only its own secrets within Vault, and the node itself can be revoked. Host hardening and runtime detection remain part of the picture.
Better together
The two layers answer different questions. TPM auth answers "is this really our machine?" SPIFFE answers "which service on it is asking?" Used together, the hardware becomes the root of trust and each workload inherits a precise identity on top of it. This means that you can implement one without the other one, but they do work better together, bringing cohesion to the infrastructure.

The TPM proves the machine, SPIFFE splits that trust into one identity per workload, and Vault turns each identity into exactly the access it needs.
There are two ways to combine them. A VM can log in to Vault with its TPM, and Vault then issues SPIFFE identities to the workloads on it. Or SPIRE can use the TPM when it attests each node, so the whole SPIFFE chain starts from hardware.
What this means for companies
- A smaller attack surface. Stolen configuration files, leaked images and exposed pipeline variables stop being keys to the vault. An attacker needs the specific hardware, not just a copy of its files.
- Stronger evidence for auditors. Every login traces back to an enrolled TPM and, with SPIFFE, to a named workload. That supports zero-trust and least-privilege requirements in frameworks such as ISO 27001, SOC 2, PCI DSS and, in Europe, NIS2 and DORA.
- Less operational toil. No bootstrap secrets to distribute, rotate or chase after an incident. Credentials are short-lived and renew automatically. Enrollment fits into existing provisioning tooling such as Terraform.
- Cloud-grade identity on premises. Companies no longer need to move an application to the public cloud to get strong machine identity. Existing VM estates get the same model.
- Ready for AI agents. Autonomous agents need credentials too, and they multiply quickly. Giving each agent a verifiable workload identity is far safer than handing it a long-lived API key.
Know the limits, then start small
No technology removes trust; it moves it somewhere better. A few points to plan for:
- Enrollment becomes the control point. Vault trusts whichever TPM was enrolled, so the provisioning pipeline that registers EKs must itself be protected and audited.
- Virtual TPMs depend on the hypervisor. Whoever controls the virtualization layer can influence a vTPM, so that layer belongs inside your trust boundary.
- The first release is focused. TPM auth in Vault 2.2 targets Linux VMs with virtual TPMs. Windows and physical TPMs on bare metal are outside this release.
A practical path to adoption:
- Pick one on-prem application that still uses a bootstrap secret today.
- Enroll its VMs' TPMs in Vault and switch Vault Agent to TPM auth.
- Remove the old SecretID and prove that a copied configuration no longer works.
- Add SPIFFE identities where several workloads share hosts or talk to each other.
- Make TPM enrollment a standard step in your VM provisioning templates.
Closing the front door
Secrets management protected everything inside the vault but left the front door key under the mat. TPM authentication in Vault 2.2 replaces that key with something that cannot be copied: the machine's own hardware. SPIFFE then gives every workload behind that door its own badge.
Together, they let companies run on-premises infrastructure with the same identity-first security the cloud made standard. The first step is small: pick one application, enroll its machines and delete one secret for good.
Sources
#community-stories1