소스 정보
- 저장소
- AJBcoding/claude-skill-eval
- 최근 소스 활동
- 2025년 11월 18일 19:33
- 감지된 SKILL.md 언어
- 영어
- 스타
- 4
- 포크
- 1
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/AJBcoding/claude-skill-eval --skill moai-security-secrets명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | moai-security-secrets |
| version | 4.0.0 |
| status | stable |
| description | Enterprise Skill for advanced development |
| allowed-tools | Read, Bash, WebSearch, WebFetch |
Secure Credential Storage, Rotation & Distribution
Trust Score: 9.9/10 | Version: 4.0.0 | Enterprise Mode | Last Updated: 2025-11-12
Secret management is critical infrastructure: API keys, database passwords, and encryption keys must be stored securely, rotated regularly, and distributed safely. This Skill covers HashiCorp Vault, .env security, and secrets rotation patterns.
When to use this Skill:
SECRET TYPES:
├─ Credentials (passwords, API keys, tokens)
├─ Cryptographic Keys (encryption, signing)
├─ Connection Strings (database, message queues)
├─ Certificates (TLS, client auth)
└─ OAuth Tokens (access tokens, refresh tokens)
STORAGE HIERARCHY:
1. Vault System (HashiCorp Vault, AWS Secrets Manager)
2. Environment Variables (via secret injection)
3. Configuration Files (.env - local dev only)
4. Memory (never disk, clear after use)
5. NEVER: Hardcoded, version control, logs
Generate → Distribute → Rotate → Revoke → Destroy
↓ ↓ ↓ ↓ ↓
Secure Encrypted Schedule Immediate Wipe
Token Channel (30-90d) (breach) Keys
| Type | Frequency | Grace Period | Method |
|---|---|---|---|
| API Keys | 90 days | 24 hours | Generate new, deprecate old |
| Database Passwords | 30 days | 48 hours | New password, app restart |
| TLS Certificates | 30 days before expiry | N/A | Automated renewal |
| Session Secrets | 24 hours | Immediate | Rotate all sessions |
| Encryption Keys | On breach | N/A | Re-encrypt all data |
Vault Server Setup:
# Installation
wget https://releases.hashicorp.com/vault/1.18.0/vault_1.18.0_linux_amd64.zip
unzip vault_1.18.0_linux_amd64.zip
# Start Vault
vault server -config=/etc/vault/config.hcl
# Initialize & unseal
vault operator init
vault operator unseal [key1] [key2] [key3]
# Enable secret engine
vault secrets enable -path=app kv-v2
vault secrets enable database
Node.js Vault Client:
const vault = require('@hashicorp/vault-client');
const client = new vault.ApiClient({
endpoint: process.env.VAULT_ADDR,
token: process.env.VAULT_TOKEN
});
// 1. Read secret
async function getSecret(path) {
try {
const response = await client.read(`secret/data/${path}`);
return response.data.data;
} catch (err) {
console.error('Vault error:', err);
throw err;
}
}
// 2. Store secret
async function setSecret(path, data) {
await client.write(`secret/data/${path}`, {
data: data
});
}
// 3. Generate dynamic database password
async function generateDBPassword(role) {
const cred = await client.read(`database/creds/${role}`);
{
: cred..,
: cred..,
: cred.
};
}
() {
newKey = crypto.().();
(, { : newKey });
(appName, newKey);
(, {
: ,
: ()
});
}
() {
response = client...({
: process..,
: process..
});
response..;
}
NEVER commit secrets to version control:
# .gitignore
.env
.env.local
.env.*.local
.env.prod
.env.backup
secrets/
keys/
Environment Variable Validation:
// config/env.js
const z = require('zod');
const envSchema = z.object({
NODE_ENV: z.enum(['development', 'production']).default('development'),
DATABASE_URL: z.string().url(),
DATABASE_PASSWORD: z.string().min(16),
API_KEY: z.string().min(32),
ENCRYPTION_KEY: z.string().length(64),
JWT_SECRET: z.string().min(32),
OAUTH_CLIENT_ID: z.string(),
OAUTH_CLIENT_SECRET: z.string(),
VAULT_ADDR: z.string().url().optional(),
VAULT_TOKEN: z.string().optional()
});
// Validate on startup
export const env = envSchema.parse(process.env);
// Ensure no secrets in logs
Object.keys(env).( {
(key.() || key.() || key.()) {
.(env, key, {
() {
;
}
});
}
});
// jobs/secrets-rotation.js
const cron = require('node-cron');
const vault = require('@hashicorp/vault-client');
class SecretsRotationJob {
constructor(vaultClient) {
this.vault = vaultClient;
this.rotationSchedules = [
{ path: 'app/database-password', schedule: '0 2 * * 0', ttl: '30d' },
{ path: 'app/api-keys', schedule: '0 3 * * SUN', ttl: '90d' },
{ path: 'app/session-secret', schedule: '0 * * * *', ttl: '24h' }
];
}
// Start rotation scheduler
start() {
this.rotationSchedules.forEach(({ path, schedule }) => {
cron.schedule(schedule, () => {
this.rotateSecret(path).catch(err => {
console.error(`Rotation failed for :`, err);
.(path, err);
});
});
});
}
() {
.();
newSecret = .(path);
..(, newSecret);
..(, {
: ,
:
});
.(path, );
.(path, );
( () => {
..();
}, );
}
() {
.();
..(, { : });
emergency = .(path);
..(, emergency);
.(path, );
.(path, );
.(path);
}
() {
(path.()) {
{
: ().().(),
: (),
: (.() + * * * )
};
}
(path.()) {
{
: ,
: ()
};
}
{};
}
() {
services = .(path);
( service services) {
..(, {
path,
version,
: ()
}, { : service });
}
}
() {
maxRetries = ;
retries = ;
(retries < maxRetries) {
adopted = .(path, version);
(adopted === ) {
.();
;
}
.();
( (r, ));
retries++;
}
}
() {
..({
: ,
: ,
: error.,
:
});
}
}
rotationJob = (vaultClient);
rotationJob.();
# Install Sealed Secrets controller
kubectl apply -f https://github.com/bitnami-labs/sealed-secrets/releases/download/v0.23.1/controller.yaml
# Create secret
kubectl create secret generic my-secret \
--from-literal=password=mypassword \
--dry-run=client -o yaml > secret.yaml
# Seal the secret
kubeseal -f secret.yaml -w sealed-secret.yaml
# Deploy sealed secret (safe to commit to git)
kubectl apply -f sealed-secret.yaml
# Sealed secret auto-decrypts in cluster
# Use in pod
apiVersion: v1
kind: Pod
metadata:
name: my-app
spec:
containers:
- name: app
image: my-app:latest
env:
- name: PASSWORD
valueFrom:
secretKeyRef:
name:
// Zero-knowledge password verification
class ZKAuth {
// Registration: Client commits to password without server knowing
async register(email, password) {
// Client-side only
const salt = crypto.randomBytes(16);
const commitment = hash(hash(password) + salt);
// Send only commitment
await fetch('/auth/register', {
method: 'POST',
body: JSON.stringify({ email, commitment, salt })
});
}
// Authentication: Prove knowledge without revealing password
async login(email, password) {
const challenge = await fetch(`/auth/challenge?email=${email}`);
// Client-side proof generation
const response = hmac(sha256(password), challenge);
// Send only proof (no password)
const result = await fetch('/auth/login', {
method: 'POST',
body: JSON.stringify({ email, response })
});
result.();
}
}
Version: 4.0.0 Enterprise
Skill Category: Security (Secret Management)
Complexity: Advanced
Time to Implement: 4-6 hours
Prerequisites: DevOps, Kubernetes basics, cryptography concepts