Logo di Managing Secrets

Managing Secrets

Community
ancoleman
managing-secrets

Managing secrets (API keys, database credentials, certificates) with Vault, cloud providers, and Kubernetes. Use when storing sensitive data, rotating credentials, syncing secrets to Kubernetes, implementing dynamic secrets, or scanning code for leaked secrets.

Panoramica

Pubblicato daancoleman
Repositoryai-design-components
Nome della skillmanaging-secrets
Stelle
525
Fork
77
File inclusi
14
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • File inclusi: 14

    Script, template e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

    Pubblicata da ancoleman su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Managing Secrets in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/ancoleman/ai-design-components/tree/main/skills/secret-management
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ancoleman/ai-design-components.git /tmp/ai-design-components
mkdir -p .claude/skills
cp -r /tmp/ai-design-components/skills/secret-management .claude/skills/managing-secrets
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Managing Secrets in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Managing Secrets non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Managing Secrets non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

Managing Secrets

Secure storage, rotation, and delivery of secrets (API keys, database credentials, TLS certificates) for applications and infrastructure.

When to Use This Skill

Use when:

  • Storing API keys, database credentials, or encryption keys
  • Implementing secret rotation (manual or automatic)
  • Syncing secrets from external stores to Kubernetes
  • Setting up dynamic secrets (database, cloud providers)
  • Scanning code for leaked secrets
  • Implementing zero-knowledge patterns
  • Meeting compliance requirements (SOC 2, ISO 27001, PCI DSS)

Quick Decision Frameworks

Framework 1: Choosing a Secret Store

ScenarioPrimary ChoiceAlternative
Kubernetes + Multi-CloudVault + ESOCloud Secret Manager + ESO
Kubernetes + Single CloudCloud Secret Manager + ESOVault + ESO
Serverless (AWS Lambda)AWS Secrets ManagerAWS Parameter Store
Multi-Cloud EnterpriseHashiCorp VaultDoppler (SaaS)
Small Team (<10 apps)Doppler, Infisical1Password Secrets Automation
GitOps-CentricSOPS (git-encrypted)Sealed Secrets (K8s-only)

Decision Tree:

  • Kubernetes? → External Secrets Operator (ESO) with chosen backend
  • Single cloud? → Cloud-native (AWS/GCP/Azure)
  • Multi-cloud/on-prem? → HashiCorp Vault
  • GitOps? → SOPS or Sealed Secrets

Framework 2: Static vs. Dynamic Secrets

Secret TypeUse Dynamic?TTLSolution
Database credentialsYES1 hourVault DB engine
Cloud IAM (AWS/GCP)YES15 minVault cloud engine
SSH/RDP accessYES5 minVault SSH engine
TLS certificatesYES24 hoursVault PKI / cert-manager
Third-party API keysNOQuarterlyVault KV v2 (manual rotation)

Framework 3: Kubernetes Secret Delivery

MethodUse CaseRotationRestart Required
External Secrets OperatorStatic secrets, periodic syncPolling (1h)Yes
Secrets Store CSI DriverFile-based, watch rotationinotifyNo
Vault Secrets OperatorVault-specific, dynamicAutomatic renewalOptional

HashiCorp Vault Fundamentals

Core Components

  • Secrets Engines: KV v2 (static), Database (dynamic), AWS, PKI, SSH
  • Auth Methods: Kubernetes, JWT/OIDC, AppRole, LDAP
  • Policies: HCL-based access control (least privilege)
  • Leases: TTL for secrets, auto-renewal, auto-revocation

Static Secrets (KV v2)

bash
# Create secret
vault kv put secret/myapp/config api_key=sk_live_EXAMPLE

# Read secret
vault kv get secret/myapp/config

# List versions
vault kv metadata get secret/myapp/config

Dynamic Database Credentials

bash
# Configure PostgreSQL
vault write database/config/postgres \
  plugin_name=postgresql-database-plugin \
  connection_url="postgresql://{{username}}:{{password}}@postgres:5432/mydb"

# Create role
vault write database/roles/app-role \
  db_name=postgres \
  creation_statements="CREATE ROLE \"{{name}}\"..." \
  default_ttl="1h"

# Generate credentials
vault read database/creds/app-role

For detailed Vault architecture, see references/vault-architecture.md.

Kubernetes Integration

External Secrets Operator (ESO)

Syncs secrets from 30+ providers to Kubernetes Secrets.

yaml
apiVersion: external-secrets.io/v1beta1
kind: SecretStore
metadata:
  name: vault-backend
spec:
  provider:
    vault:
      server: "https://vault.example.com"
      auth:
        kubernetes:
          role: "app-role"
yaml
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
  name: database-credentials
spec:
  refreshInterval: 1h
  secretStoreRef:
    name: vault-backend
  target:
    name: db-credentials
  data:
  - secretKey: password
    remoteRef:
      key: secret/data/database/config

Vault Secrets Operator (VSO)

Kubernetes-native Vault integration with automatic lease renewal.

yaml
apiVersion: secrets.hashicorp.com/v1beta1
kind: VaultDynamicSecret
metadata:
  name: postgres-creds
spec:
  vaultAuthRef: vault-auth
  mount: database
  path: creds/app-role
  renewalPercent: 67  # Renew at 67% of TTL
  destination:
    name: dynamic-db-creds

For ESO vs CSI vs VSO comparison, see references/kubernetes-integration.md.

Secret Rotation Patterns

Pattern 1: Versioned Static Secrets (Blue/Green)

  1. Create new secret version in Vault
  2. Update staging environment
  3. Monitor for errors (24-48 hours)
  4. Gradual production rollout (10% → 50% → 100%)
  5. Revoke old secret (after 7 days)

Pattern 2: Dynamic Database Credentials

Vault auto-generates credentials with short TTL:

  • App fetches credentials from Vault
  • Vault automatically renews lease (at 67% of TTL)
  • On expiration, Vault revokes access
  • On renewal failure, app requests new credentials

Pattern 3: TLS Certificate Rotation

Using cert-manager + Vault PKI:

  • cert-manager requests certificate from Vault
  • Automatically renews before expiration (default: 67% of duration)
  • Updates Kubernetes Secret on renewal
  • Optional pod restart (via Reloader)

For detailed rotation workflows, see references/rotation-patterns.md.

Multi-Language Integration

Python (hvac)

python
import hvac

client = hvac.Client(url='https://vault.example.com')
client.auth.kubernetes(role='app-role', jwt=jwt)

# Fetch dynamic credentials
response = client.secrets.database.generate_credentials(name='postgres-role')
username = response['data']['username']
password = response['data']['password']

Go (Vault API)

go
import vault "github.com/hashicorp/vault/api"

client, _ := vault.NewClient(vault.DefaultConfig())
k8sAuth, _ := auth.NewKubernetesAuth("app-role")
client.Auth().Login(context.Background(), k8sAuth)

secret, _ := client.Logical().Read("database/creds/postgres-role")

TypeScript (node-vault)

typescript
import vault from 'node-vault';

const client = vault({ endpoint: 'https://vault.example.com' });
await client.kubernetesLogin({ role: 'app-role', jwt });

const response = await client.read('database/creds/postgres-role');

For complete examples, see examples/dynamic-db-credentials/.

Secret Scanning

Pre-Commit Hooks (Gitleaks)

bash
# Install Gitleaks
brew install gitleaks

# Run on staged files
gitleaks protect --staged --verbose

Pre-commit hook prevents secrets from being committed. For setup, see examples/secret-scanning/pre-commit.

CI/CD Integration

yaml
# GitHub Actions
- name: Run Gitleaks
  uses: gitleaks/gitleaks-action@v2

Remediation Workflow

When a secret is leaked:

  1. Rotate immediately (within 1 hour)
  2. Revoke at provider
  3. Remove from Git history (BFG Repo-Cleaner)
  4. Force push (notify team)
  5. Audit access (who had access during leak window)
  6. Document incident

For detailed remediation, see references/secret-scanning.md.

Zero-Knowledge Patterns

Client-Side Encryption (E2EE)

User password → PBKDF2 → encryption key → encrypt secret → send to server

Server stores only encrypted blobs (cannot decrypt).

Shamir's Secret Sharing

Split secret into N shares, require M to reconstruct (e.g., 3 of 5).

bash
# Initialize Vault with Shamir shares
vault operator init -key-shares=5 -key-threshold=3

# Unseal requires 3 of 5 key shares
vault operator unseal <KEY_1>
vault operator unseal <KEY_2>
vault operator unseal <KEY_3>

For implementations, see references/zero-knowledge.md.

Library Recommendations (2025)

Secret Stores

LibraryUse CaseTrust Score
HashiCorp VaultEnterprise, multi-cloudHigh (73.3/100)
External Secrets OperatorKubernetes integrationHigh (85.0/100)
AWS Secrets ManagerAWS workloadsHigh
GCP Secret ManagerGCP workloadsHigh
Azure Key VaultAzure workloadsHigh

Secret Scanning

LibraryUse CaseTrust Score
GitleaksPre-commit, CI/CDHigh (89.9/100)
TruffleHogGit history scanningMedium

Client Libraries

LanguageLibraryVersion
Pythonhvac2.2.0+
Govault/apiLatest
TypeScriptnode-vault0.10.2+
Rustvaultrs0.7+

Common Workflows

Workflow 1: Vault + ESO on Kubernetes

  1. Install Vault (Helm chart)
  2. Initialize and unseal Vault
  3. Enable Kubernetes auth
  4. Install External Secrets Operator
  5. Create SecretStore (Vault connection)
  6. Create ExternalSecret (secret mapping)

For step-by-step guide, see examples/vault-eso-setup/.

Workflow 2: Dynamic Database Credentials

  1. Enable database secrets engine
  2. Configure database connection
  3. Create role with TTL
  4. App fetches credentials
  5. Vault auto-renews lease

For implementation, see examples/dynamic-db-credentials/.

Workflow 3: Secret Scanning Remediation

  1. Gitleaks detects secret
  2. Block commit (pre-commit hook)
  3. Developer removes secret
  4. Developer stores in Vault
  5. Developer references Vault path

For setup, see examples/secret-scanning/.

Integration with Related Skills

  • auth-security: OAuth client secrets, JWT signing keys
  • databases-*: Dynamic database credentials
  • deploying-applications: Container registry credentials
  • observability: Grafana/Datadog API keys
  • infrastructure-as-code: Cloud provider credentials

Security Best Practices

  1. Never commit secrets to Git (use Gitleaks pre-commit hook)
  2. Use dynamic secrets where possible
  3. Rotate secrets regularly (quarterly for static, hourly for dynamic)
  4. Implement least privilege (Vault policies, RBAC)
  5. Enable audit logging
  6. Encrypt at rest (Vault storage, etcd encryption)
  7. Use short TTLs (< 24 hours for dynamic secrets)
  8. Monitor failed access attempts

Common Pitfalls

Secrets in Environment Variables

Environment variables visible in process lists. Solution: Use file-based secrets (Kubernetes volumes, CSI driver).

Hardcoded Secrets in Manifests

Base64 is not encryption. Solution: Use External Secrets Operator.

No Secret Rotation

Stale credentials increase breach risk. Solution: Use dynamic secrets or automate rotation.

Root Token in Production

Unlimited permissions. Solution: Use auth methods with least privilege policies.

For Detailed Information, See

  • references/vault-architecture.md - Vault internals, HA setup, policies
  • references/kubernetes-integration.md - ESO, CSI driver, VSO comparison
  • references/rotation-patterns.md - Detailed rotation workflows
  • references/secret-scanning.md - Gitleaks, remediation procedures
  • references/zero-knowledge.md - E2EE, Shamir's secret sharing
  • references/cloud-providers.md - AWS, GCP, Azure secret managers
  • examples/vault-eso-setup/ - Complete Kubernetes setup
  • examples/dynamic-db-credentials/ - Multi-language examples
  • examples/secret-scanning/ - Pre-commit hooks, CI/CD
  • scripts/setup_vault.sh - Automated Vault installation

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

Domande frequenti

Cosa fa la skill IA Managing Secrets?

Managing secrets (API keys, database credentials, certificates) with Vault, cloud providers, and Kubernetes. Use when storing sensitive data, rotating credentials, syncing secrets to Kubernetes, implementing dynamic secrets, or scanning code for leaked secrets.

Perché usare Managing Secrets su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Managing Secrets è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Managing Secrets in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/ancoleman/ai-design-components/tree/main/skills/secret-management. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Managing Secrets?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Managing Secrets?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Managing Secrets: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Managing Secrets è gratuita?

Sì. È pubblicata su GitHub da ancoleman con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇