HashiCorp Certified: Vault Associate Intermediate — Quiz 2
HashiCorp Certified: Vault Associate Intermediate — Quiz 2 — Study Guide
HashiCorp Certified: Vault Associate Intermediate — Quiz 2 Study Guide
HashiCorp Vault is the industry-standard tool for secrets management, and understanding how it controls *who* can access *what* — and for *how long* — is the foundation of every real-world deployment. This guide covers the core concepts you'll need to ace Quiz 2, from policies and authentication methods to dynamic secrets and audit logging.
Vault Architecture Overview
Vault is built around a few key components:
Think of Vault as a bank vault: auth methods are the ID check at the door, policies are the permissions slip that says which safety deposit boxes you can open, and audit logging is the security camera recording everything.
Namespaces
Namespaces allow multi-tenancy within a single Vault cluster. Each namespace is an isolated environment with its own policies, auth methods, and secrets engines — ideal for large enterprises separating teams or business units.
Identity and Access Management (IAM)
Vault's IAM features answer the question: "Who are you, and what are you allowed to do?"
The primary purpose of Vault IAM is to centralize and control access to secrets across multiple platforms, teams, and cloud providers — replacing scattered, hard-coded credentials with a unified access control layer.
Vault IAM components include:
Authentication Methods
Authentication is how Vault verifies identity. Once verified, Vault issues a token that is used for all subsequent requests.
Common Auth Methods
| Auth Method | Use Case |
|---|---|
| Token | Direct token-based access (default) |
| AppRole | Machine-to-machine / CI/CD pipelines |
| AWS | Cloud workloads using IAM credentials |
| LDAP | Users authenticating with corporate directory |
| GitHub | Developer access via GitHub tokens |
| Kubernetes | Pods authenticating via service accounts |
AWS Auth Method
The AWS auth method allows users and applications to authenticate using their existing AWS IAM credentials (IAM roles, EC2 instance profiles, or IAM users). This is the answer when a question asks about authenticating with "existing cloud provider credentials."
AppRole Auth Method
AppRole is designed for applications and automated pipelines. It uses two credentials:
# Fetch a token using AppRole
vault write auth/approle/login \
role_id="your-role-id" \
secret_id="your-secret-id"LDAP Auth Method
LDAP lets users log in with their corporate directory credentials (Active Directory, OpenLDAP). Vault maps LDAP groups to Vault policies automatically.
Policies
A Vault Policy is an HCL (or JSON) document that defines what actions a token is permitted to perform on specific paths.
Path and Capabilities
Every policy rule has two parts:
path — the Vault API path being controlled (e.g., secret/data/myapp/*)capabilities — the allowed operations on that path# Example Vault Policy
path "secret/data/myapp/*" {
capabilities = ["read", "list"]
}path "auth/token/renew-self" {
capabilities = ["update"]
}
Capabilities Reference
| Capability | HTTP Method | Description |
|---|---|---|
create | POST/PUT | Create new secrets |
read | GET | Read existing secrets |
update | POST/PUT | Update existing secrets |
delete | DELETE | Delete secrets |
list | LIST | List keys at a path |
deny | — | Explicitly deny access |
token_ttl in Policies
The token_ttl setting within a policy (or role) controls how long a token issued under that policy remains valid before it must be renewed or expires. This is a security control to limit the blast radius of a compromised token.
# Role with token TTL settings
vault write auth/approle/role/my-role \
token_ttl=1h \
token_max_ttl=4h \
policies="my-policy"Tokens and Leases
Tokens
Every authenticated session in Vault is represented by a token. Tokens:
Leases
When Vault generates a dynamic secret, it creates a lease — a binding contract that includes:
# Renew a lease
vault lease renew <lease-id>Revoke a lease immediately
vault lease revoke <lease-id>Secret Engines
Secret engines are the workhorses of Vault. Key types include:
Dynamic Secrets
Dynamic secrets are generated on-demand and automatically expire. For example, the AWS secrets engine can create a temporary IAM access key that expires after 1 hour — no long-lived credentials stored anywhere.
Audit Logging
Audit devices record every request and response to Vault, including:
Sensitive values are hashed in audit logs by default. Vault requires at least one audit device to be active for security compliance. Common backends: file, syslog, socket.
Security Best Practices
Troubleshooting Tips
token_ttl and token_max_ttl settingsvault token lookup to inspect a token's policies and TTLvault audit list to verify audit devices are enabledKey Takeaways
path + capabilities; token_ttl controls how long that token lives.