---
name: integrating-secrets-managers
description: 'Manage this skill enables AI assistant to seamlessly integrate with various secrets managers like hashicorp vault and aws secrets manager. it generates configurations and setup code, ensuring best practices for secure credential management. use this skill when... Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.'
allowed-tools: Read, Write, Edit, Grep, Glob, Bash(cmd:*)
version: 1.25.0
author: Jeremy Longshore <jeremy@intentsolutions.io>
license: MIT
tags:
  - devops
  - aws
  - integrating-secrets
compatibility: Designed for Claude Code
title: integrating-secrets-managers
canonical_url: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/integrating-secrets-managers
last_updated: 2026-10-07T06:06:28.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [assets/aws_iam_policy_template.json](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/integrating-secrets-managers/assets/aws_iam_policy_template.json), [assets/example_secrets.yaml](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/integrating-secrets-managers/assets/example_secrets.yaml), [assets/README.md](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/integrating-secrets-managers/assets/README.md), [assets/vault_config_template.hcl](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/integrating-secrets-managers/assets/vault_config_template.hcl), [references/README.md](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/integrating-secrets-managers/references/README.md), [scripts/aws_secrets_manager_setup.py](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/integrating-secrets-managers/scripts/aws_secrets_manager_setup.py), [scripts/README.md](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/integrating-secrets-managers/scripts/README.md).
>
> If the user asked to install this Skill, run `npx skilld install jeremylongshore/tons-of-skills-marketplace/integrating-secrets-managers`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/integrating-secrets-managers`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/jeremylongshore/tons-of-skills-marketplace/integrating-secrets-managers) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/integrating-secrets-managers`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/integrating-secrets-managers --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/integrating-secrets-managers --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Integrating Secrets Managers

## Overview

Integrate secrets management platforms (HashiCorp Vault, AWS Secrets Manager, GCP Secret Manager, Azure Key Vault) into applications and infrastructure. Generate authentication configurations, access policies, secret rotation schedules, and application code patterns for secure credential retrieval at runtime.

## Prerequisites

- Secrets manager instance running and accessible (Vault server, AWS Secrets Manager enabled)
- Cloud provider CLI authenticated or Vault CLI installed (`vault`, `aws`, `gcloud`, `az`)
- IAM/policy permissions to create secrets and access policies
- Understanding of which application components need which secrets
- Network connectivity between application workloads and the secrets manager endpoint

## Instructions

1. Inventory all secrets currently in use: database credentials, API keys, TLS certificates, OAuth tokens
2. Select the secrets manager based on infrastructure: Vault for multi-cloud, AWS Secrets Manager for AWS-native, GCP Secret Manager for GCP
3. Create the secrets store structure: organize by application, environment, and secret type (e.g., `apps/myapp/prod/database`)
4. Generate access policies with least-privilege: each application identity gets read access only to its own secrets
5. Configure authentication method: Kubernetes service account (Vault K8s auth), IAM role (AWS), Workload Identity (GCP)
6. Implement secret retrieval in the application: SDK call at startup, sidecar injection (Vault Agent), or CSI driver mount
7. Set up automatic secret rotation: define rotation lambda/function, rotation interval, and notification on rotation events
8. Remove hardcoded secrets from code and configuration files; replace with secret references
9. Add monitoring: alert on secret access failures, rotation failures, and unauthorized access attempts

## Output

- Vault policies (HCL) or IAM policies (JSON) for secret access
- Authentication configuration (Vault K8s auth, AWS IAM role, GCP Workload Identity)
- Application code snippets for secret retrieval (SDK-based or environment variable injection)
- Secret rotation configuration (AWS rotation Lambda, Vault dynamic secrets)
- Kubernetes External Secrets Operator or CSI SecretProviderClass manifests

## Error Handling

| Error | Cause | Solution |
|-------|-------|---------|
| `permission denied` on secret read | Policy does not grant access to the requested path | Update Vault policy or IAM policy to include the specific secret ARN/path |
| `Vault token expired` | Authentication token TTL exceeded | Configure token renewal or use short-lived tokens with auto-renewal via Vault Agent |
| `Secret not found` | Secret path/name incorrect or secret deleted | Verify the secret exists with `vault kv get` or `aws secretsmanager describe-secret` |
| `Rotation failed` | Rotation function lacks permissions or target service unreachable | Check rotation function logs; verify it has permissions to update credentials on the target service |
| `Connection refused to Vault` | Vault server down or network policy blocking access | Verify Vault is running and healthy; check network policies/firewalls between application and Vault |

## Examples

- "Integrate HashiCorp Vault with a Kubernetes deployment using the Vault Agent sidecar injector to inject database credentials as environment variables."
- "Set up AWS Secrets Manager with automatic rotation every 30 days for an RDS PostgreSQL password, with a Lambda rotation function."
- "Replace all hardcoded API keys in the application with GCP Secret Manager references using Workload Identity for authentication."

## Resources

- HashiCorp Vault: https://developer.hashicorp.com/vault/docs
- AWS Secrets Manager: https://docs.aws.amazon.com/secretsmanager/
- GCP Secret Manager: https://cloud.google.com/secret-manager/docs
- External Secrets Operator: https://external-secrets.io/
- Secrets management best practices: https://developer.hashicorp.com/vault/tutorials/recommended-patterns
