env-secrets-manager

0
0
Source

Env & Secrets Manager

Install

mkdir -p .claude/skills/env-secrets-manager && curl -L -o skill.zip "https://mcp.directory/api/skills/download/4624" && unzip -o skill.zip -d .claude/skills/env-secrets-manager && rm skill.zip

Installs to .claude/skills/env-secrets-manager

About this skill

Env & Secrets Manager

Tier: POWERFUL Category: Engineering Domain: Security / DevOps / Configuration Management


Overview

Manage environment-variable hygiene and secrets safety across local development and production workflows. This skill focuses on practical auditing, drift awareness, and rotation readiness.

Core Capabilities

  • .env and .env.example lifecycle guidance
  • Secret leak detection for repository working trees
  • Severity-based findings for likely credentials
  • Operational pointers for rotation and containment
  • Integration-ready outputs for CI checks

When to Use

  • Before pushing commits that touched env/config files
  • During security audits and incident triage
  • When onboarding contributors who need safe env conventions
  • When validating that no obvious secrets are hardcoded

Quick Start

# Scan a repository for likely secret leaks
python3 scripts/env_auditor.py /path/to/repo

# JSON output for CI pipelines
python3 scripts/env_auditor.py /path/to/repo --json

Recommended Workflow

  1. Run scripts/env_auditor.py on the repository root.
  2. Prioritize critical and high findings first.
  3. Rotate real credentials and remove exposed values.
  4. Update .env.example and .gitignore as needed.
  5. Add or tighten pre-commit/CI secret scanning gates.

Reference Docs

  • references/validation-detection-rotation.md
  • references/secret-patterns.md

Common Pitfalls

  • Committing real values in .env.example
  • Rotating one system but missing downstream consumers
  • Logging secrets during debugging or incident response
  • Treating suspected leaks as low urgency without validation

Best Practices

  1. Use a secret manager as the production source of truth.
  2. Keep dev env files local and gitignored.
  3. Enforce detection in CI before merge.
  4. Re-test application paths immediately after credential rotation.

Cloud Secret Store Integration

Production applications should never read secrets from .env files or environment variables baked into container images. Use a dedicated secret store instead.

Provider Comparison

ProviderBest ForKey Feature
HashiCorp VaultMulti-cloud / hybridDynamic secrets, policy engine, pluggable backends
AWS Secrets ManagerAWS-native workloadsNative Lambda/ECS/EKS integration, automatic RDS rotation
Azure Key VaultAzure-native workloadsManaged HSM, Azure AD RBAC, certificate management
GCP Secret ManagerGCP-native workloadsIAM-based access, automatic replication, versioning

Selection Guidance

  • Single cloud provider — use the cloud-native secret manager. It integrates tightly with IAM, reduces operational overhead, and costs less than self-hosting.
  • Multi-cloud or hybrid — use HashiCorp Vault. It provides a uniform API across environments and supports dynamic secret generation (database credentials, cloud IAM keys) that expire automatically.
  • Kubernetes-heavy — combine External Secrets Operator with any backend above to sync secrets into K8s Secret objects without hardcoding.

Application Access Patterns

  1. SDK/API pull — application fetches secret at startup or on-demand via provider SDK.
  2. Sidecar injection — a sidecar container (e.g., Vault Agent) writes secrets to a shared volume or injects them as environment variables.
  3. Init container — a Kubernetes init container fetches secrets before the main container starts.
  4. CSI driver — secrets mount as a filesystem volume via the Secrets Store CSI Driver.

Cross-reference: See engineering/secrets-vault-manager for production vault infrastructure patterns, HA deployment, and disaster recovery procedures.


Secret Rotation Workflow

Stale secrets are a liability. Rotation ensures that even if a credential leaks, its useful lifetime is bounded.

Phase 1: Detection

  • Track secret creation and expiry dates in your secret store metadata.
  • Set alerts at 30, 14, and 7 days before expiry.
  • Use scripts/env_auditor.py to flag secrets with no recorded rotation date.

Phase 2: Rotation

  1. Generate a new credential (API key, database password, certificate).
  2. Deploy the new credential to all consumers (apps, services, pipelines) in parallel.
  3. Verify each consumer can authenticate using the new credential.
  4. Revoke the old credential only after all consumers are confirmed healthy.
  5. Update metadata with the new rotation timestamp and next rotation date.

Phase 3: Automation

  • AWS Secrets Manager — use built-in Lambda-based rotation for RDS, Redshift, and DocumentDB.
  • HashiCorp Vault — configure dynamic secrets with TTLs; credentials are generated on-demand and auto-expire.
  • Azure Key Vault — use Event Grid notifications to trigger rotation functions.
  • GCP Secret Manager — use Pub/Sub notifications tied to Cloud Functions for rotation logic.

Emergency Rotation Checklist

When a secret is confirmed leaked:

  1. Immediately revoke the compromised credential at the provider level.
  2. Generate and deploy a replacement credential to all consumers.
  3. Audit access logs for unauthorized usage during the exposure window.
  4. Scan git history, CI logs, and artifact registries for the leaked value.
  5. File an incident report documenting scope, timeline, and remediation steps.
  6. Review and tighten detection controls to prevent recurrence.

CI/CD Secret Injection

Secrets in CI/CD pipelines require careful handling to avoid exposure in logs, artifacts, or pull request contexts.

GitHub Actions

  • Use repository secrets or environment secrets via ${{ secrets.SECRET_NAME }}.
  • Prefer OIDC federation (aws-actions/configure-aws-credentials with role-to-assume) over long-lived access keys.
  • Environment secrets with required reviewers add approval gates for production deployments.
  • GitHub automatically masks secrets in logs, but avoid echo or toJSON() on secret values.

GitLab CI

  • Store secrets as CI/CD variables with the masked and protected flags enabled.
  • Use HashiCorp Vault integration (secrets:vault) for dynamic secret injection without storing values in GitLab.
  • Scope variables to specific environments (production, staging) to enforce least privilege.

Universal Patterns

  • Never echo or print secret values in pipeline output, even for debugging.
  • Use short-lived tokens (OIDC, STS AssumeRole) instead of static credentials wherever possible.
  • Restrict PR access — do not expose secrets to pipelines triggered by forks or untrusted branches.
  • Rotate CI secrets on the same schedule as application secrets; pipeline credentials are attack vectors too.
  • Audit pipeline logs periodically for accidental secret exposure that masking may have missed.

Pre-Commit Secret Detection

Catching secrets before they reach version control is the most cost-effective defense. Two leading tools cover this space.

gitleaks

# .gitleaks.toml — minimal configuration
[extend]
useDefault = true

[[rules]]
id = "custom-internal-token"
description = "Internal service token pattern"
regex = '''INTERNAL_TOKEN_[A-Za-z0-9]{32}'''
secretGroup = 0
  • Install: brew install gitleaks or download from GitHub releases.
  • Pre-commit hook: gitleaks git --pre-commit --staged
  • Baseline scanning: gitleaks detect --source . --report-path gitleaks-report.json
  • Manage false positives in .gitleaksignore (one fingerprint per line).

detect-secrets

# Generate baseline
detect-secrets scan --all-files > .secrets.baseline

# Pre-commit hook (via pre-commit framework)
# .pre-commit-config.yaml
repos:
  - repo: https://github.com/Yelp/detect-secrets
    rev: v1.5.0
    hooks:
      - id: detect-secrets
        args: ['--baseline', '.secrets.baseline']
  • Supports custom plugins for organization-specific patterns.
  • Audit workflow: detect-secrets audit .secrets.baseline interactively marks true/false positives.

False Positive Management

  • Maintain .gitleaksignore or .secrets.baseline in version control so the whole team shares exclusions.
  • Review false positive lists during security audits — patterns may mask real leaks over time.
  • Prefer tightening regex patterns over broadly ignoring files.

Audit Logging

Knowing who accessed which secret and when is critical for incident investigation and compliance.

Cloud-Native Audit Trails

ProviderServiceWhat It Captures
AWSCloudTrailEvery GetSecretValue, DescribeSecret, RotateSecret API call
AzureActivity Log + Diagnostic LogsKey Vault access events, including caller identity and IP
GCPCloud Audit LogsData access logs for Secret Manager with principal and timestamp
VaultAudit BackendFull request/response logging (file, syslog, or socket backend)

Alerting Strategy

  • Alert on access from unknown IP ranges or service accounts outside the expected set.
  • Alert on bulk secret reads (more than N secrets accessed within a time window).
  • Alert on access outside deployment windows when no CI/CD pipeline is running.
  • Feed audit logs into your SIEM (Splunk, Datadog, Elastic) for correlation with other security events.
  • Review audit logs quarterly as part of access recertification.

Cross-References

This skill covers env hygiene and secret detection. For deeper coverage of related domains, see:

SkillPathRelationship
Secrets Vault Managerengineering/secrets-vault-managerProduction vault infrastructure, HA deployment, DR
Senior SecOpsengineering/senior-secopsSecurity operations perspective, incident response
CI/CD Pipeline Builderengineering/ci-cd-pipeline-builderPip

Content truncated.

senior-architect

alirezarezvani

Comprehensive software architecture skill for designing scalable, maintainable systems using ReactJS, NextJS, NodeJS, Express, React Native, Swift, Kotlin, Flutter, Postgres, GraphQL, Go, Python. Includes architecture diagram generation, system design patterns, tech stack decision frameworks, and dependency analysis. Use when designing system architecture, making technical decisions, creating architecture diagrams, evaluating trade-offs, or defining integration patterns.

170129

content-creator

alirezarezvani

Create SEO-optimized marketing content with consistent brand voice. Includes brand voice analyzer, SEO optimizer, content frameworks, and social media templates. Use when writing blog posts, creating social media content, analyzing brand voice, optimizing SEO, planning content calendars, or when user mentions content creation, brand voice, SEO optimization, social media marketing, or content strategy.

11619

content-trend-researcher

alirezarezvani

Advanced content and topic research skill that analyzes trends across Google Analytics, Google Trends, Substack, Medium, Reddit, LinkedIn, X, blogs, podcasts, and YouTube to generate data-driven article outlines based on user intent analysis

10913

ceo-advisor

alirezarezvani

Executive leadership guidance for strategic decision-making, organizational development, and stakeholder management. Includes strategy analyzer, financial scenario modeling, board governance frameworks, and investor relations playbooks. Use when planning strategy, preparing board presentations, managing investors, developing organizational culture, making executive decisions, or when user mentions CEO, strategic planning, board meetings, investor updates, organizational leadership, or executive strategy.

8413

cold-email

alirezarezvani

When the user wants to write, improve, or build a sequence of B2B cold outreach emails to prospects who haven't asked to hear from them. Use when the user mentions 'cold email,' 'cold outreach,' 'prospecting emails,' 'SDR emails,' 'sales emails,' 'first touch email,' 'follow-up sequence,' or 'email prospecting.' Also use when they share an email draft that sounds too sales-y and needs to be humanized. Distinct from email-sequence (lifecycle/nurture to opted-in subscribers) — this is unsolicited outreach to new prospects. NOT for lifecycle emails, newsletters, or drip campaigns (use email-sequence).

3813

content-humanizer

alirezarezvani

Makes AI-generated content sound genuinely human — not just cleaned up, but alive. Use when content feels robotic, uses too many AI clichés, lacks personality, or reads like it was written by committee. Triggers: 'this sounds like AI', 'make it more human', 'add personality', 'it feels generic', 'sounds robotic', 'fix AI writing', 'inject our voice'. NOT for initial content creation (use content-production). NOT for SEO optimization (use content-production Mode 3).

359

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

644969

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

593705

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

319400

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

341398

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

454339

fastapi-templates

wshobson

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

304231

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.