Chuyển đến nội dung
Skillpedia
Bảo mật29k · #9585

env-secrets-manager

Skill này làm gì

Skill này quét repository để tìm thông tin xác thực có thể đã bị rò rỉ, xếp hạng các phát hiện theo mức nghiêm trọng và gợi ý dọn dẹp như xoay vòng khóa và quy tắc bỏ qua tốt hơn. Dành cho lập trình viên và nhóm bảo vệ bí mật cấu hình.

Khi nào nên dùng

  • ✓Khi bạn sắp push các commit có thay đổi file env hoặc cấu hình.
  • ✓Khi bạn cần kiểm tra repository để tìm bí mật bị commit do nhầm lẫn.
  • ✓Khi một biến production bị thiếu và bạn cần tìm nguyên nhân.

Liên kết skill

https://github.com/alirezarezvani/claude-skills/blob/main/engineering/skills/env-secrets-manager/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/alirezarezvani/claude-skills/blob/main/engineering/skills/env-secrets-manager/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tôi muốn bạn quét repository của tôi để tìm API key bị rò rỉ và cho tôi biết cần xoay vòng cái nào trước.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent chạy một công cụ kiểm tra trên repository, công cụ này đánh dấu các thông tin xác thực có khả năng bị lộ theo mức nghiêm trọng, rồi gợi ý cách sửa như xoay vòng khóa và cập nhật file ví dụ và file bỏ qua.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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. <!-- noqa: SEC-AUDITOR (advice against reading secrets from .env) -->

Provider Comparison

Provider Best For Key Feature
HashiCorp Vault Multi-cloud / hybrid Dynamic secrets, policy engine, pluggable backends
AWS Secrets Manager AWS-native workloads Native Lambda/ECS/EKS integration, automatic RDS rotation
Azure Key Vault Azure-native workloads Managed HSM, Azure AD RBAC, certificate management
GCP Secret Manager GCP-native workloads IAM-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 cred
Câu hỏi thường gặp

Nó có tự sửa các rò rỉ cho tôi không?

Nó báo cáo và gợi ý các bước ngăn chặn, như xoay vòng thông tin xác thực thật và xóa các giá trị bị lộ.

Nó có chạy được trong CI không?

Có. Nó có thể xuất kết quả dạng JSON cho các pipeline tự động.

Tôi nên xem gì trước?

Các phát hiện critical và high trước, rồi xoay vòng mọi thông tin xác thực thật.

Chi tiết

Mô tả gốc của tác giả

Use when auditing .env files, planning credential rotation, chasing a missing env var in production or hardening a repo against leaked secrets. Scans for committed secrets and drift with env_auditor.py.

repo: alirezarezvani/claude-skills

Độ phổ biến

Sao GitHub
29k
Vị trí xếp hạng
#9585
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự