Skip to content

hashicorp-services/vault-plugin-wif-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Vault Workload Identity Federation (WIF)

Solving the secret-zero problem through WIF to establish trust with CSP Plugins

Plugins like the AWS Secrets Engine require static security credentials. The operator supplies the long-lived and highly privileged AWS credentials in the plugin configuration. Plugin WIF enables secretless configuration by integrating Vault's identity provider with plugins, providing them an identity source (JWT) that Vault can use to exchange cloud credentials via OIDC. This secretless configuration reduces security concerns associated with using long-lived, highly privileged credentials. This solution is available for AWS, GCP, and Azure secret engines and authentication methods.

Prerequisites

Security Considerations

Vault Mount isolation & Protecting against privilege escalation

When configuring your cloud provider to trust Vault's OIDC provider, it is recommended to set at least one condition. This ensures segregation between different Vault mounts. We recommend using the sub claim, which includes the mount accessor in its value (e.g., plugin-identity:namespace_id:secret:gcp_45789da7 ) and restricts token requests to the intended mount.

JWT Payload Examples

GCP Secrets Engine mount from a nested foo/bar Vault namespace.

{
  "aud": [
    "https://iam.googleapis.com/projects/43515679591/locations/global/workloadIdentityPools/vault-plugin-wif-pool-3db4/providers/vault-plugin-wif-provider"
  ],
  "exp": 1721919156,
  "iat": 1721917356,
  "iss": "https://vault.foo.com/v1/foo/bar/identity/oidc/plugins",
  "nbf": 1721917356,
  "sub": "plugin-identity:ilnzr:secret:gcp_45789da7",
  "vaultproject.io": {
    "accessor": "gcp_45789da7",
    "class": "secret",
    "local": false,
    "namespace_id": "ilnzr",
    "namespace_path": "foo/bar/",
    "path": "gcp/",
    "plugin": "gcp",
    "version": "v0.19.0+builtin"
  }
}

AWS Auth Method from the root namespace.

{
  "aud": [
    "sts.amazonaws.com"
  ],
  "exp": 1721919304,
  "iat": 1721919004,
  "iss": "https://vault.foo.com/v1/identity/oidc/plugins",
  "nbf": 1721919004,
  "sub": "plugin-identity:root:auth:auth_aws_b0779138",
  "vaultproject.io": {
    "accessor": "auth_aws_b0779138",
    "class": "auth",
    "local": false,
    "namespace_id": "root",
    "namespace_path": "",
    "path": "aws/",
    "plugin": "aws",
    "version": "v1.17.2+builtin.vault"
  }
}

Additional Resources

Tutorials

Plugin WIF documentation

Cloud Provider documentation

About

Vault plugin WIF setup examples

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages