CredHub

Overview

CredHub is a component designed for centralized credential management in Cloud Foundry (CF). It is a single component that can address several scenarios in the CF ecosystem. At the highest level, CredHub centralizes and secures credential generation, storage, lifecycle management, and access.

What Can CredHub Do?

CredHub performs a number of different functions to help generate and protect the credentials in your CF deployment, including:

  • Securing data for storage
  • Authentication
  • Authorization
  • Access and change logging
  • Data typing
  • Credential generation
  • Credential metadata
  • Credential versioning

Application Architecture

CredHub consists of a REST API and a CLI. The REST API conforms to the Config Server API spec. CredHub is an OAuth2 resource server that integrates with User Account Authentication (UAA) to provide core authentication and federation capabilities.

Diagram shows that the CredHub CLI interacts with CredHub to export credentials to the Encryption Provider, Data Store, and Authentication Provider

Deployment Architecture

The two primary architectures for CredHub are either colocated on the BOSH Director VM or deployed and managed independently as a service. You can choose your method depending on the needs of your organization.

Colocated with the BOSH Director

You can deploy CredHub on the same VM as the BOSH Director. If you need a lightweight credential storage instance for the BOSH Director only, you may choose the colocated deployment. This configuration does not provide high availability.

When you use the colocated deployment architecture, the BOSH Director, CredHub, UAA, and the Director database are all installed on a single BOSH VM, as shown in the following diagram:

Diagram that show the following components colocated on the BOSH VM: BOSH Director, CredHub, UAA, and the Director database

For more information, read Setting Up and Deploying CredHub with BOSH.

Deployed as a Service

You can deploy CredHub as an independent service on one or more VMs. If you need a highly available credential storage instance for multiple components in your deployment, you may choose to deploy CredHub as a service.

CredHub is a stateless application, so you can scale it to multiple instances that share a common database cluster and encryption provider.

When you deploy CredHub as a service, the load balancer and external databases communicate directly with the CredHub VMs, as shown in the following diagram:

Diagram that shows multiple CredHub VMs that connect to UAA, an HSM, an external database, and a load balancer. The load balancer connects to four consumer VMs.

CredHub Credential Types

Credentials exist in multiple places in the CF ecosystem. CF components use credentials to authenticate connections between components. CF installations often have hundreds of active credentials. Leaked credentials are common causes of data and security breaches, so managing them securely is very important.

For more information, read CredHub Credential Types.

Backing Up and Restoring CredHub Instances

The CredHub application does not hold state, but you must ensure its dependent components are backed up. Redundant backups can help prevent data loss if an individual component fails. For more information, read Backing Up and Restoring CredHub Instances.