/harness-claude:owasp-secrets-managementfrom harness-claude
Guides secure handling of API keys, database credentials, and secrets using environment variables, AWS Secrets Manager, and HashiCorp Vault. Includes startup validation and .env best practices.
Claude never picks this skill on its own
Its frontmatter has no description. Without a description, Claude Code leaves it out of the list Claude chooses from. Typing /harness-claude:owasp-secrets-management still runs it.
What the skill costs in Claude's context, stage by stage
No description Claude Code can read, so Claude's list leaves it out: only you can start it.
SKILL.md joins the conversation and stays.
Keep credentials out of code, logs, and version control by using environment variables, secrets managers, and strict access controls
// BAD — will end up in version control
const db = new Client({ password: 'super_secret_password' });
const stripe = new Stripe('sk_example_abc123xyz');
// GOOD — always from environment
const db = new Client({ password: process.env.DB_PASSWORD });
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!);
Add a startup validation to catch missing secrets early:
// config/secrets.ts
const required = ['DB_PASSWORD', 'JWT_SECRET', 'STRIPE_SECRET_KEY', 'REDIS_URL'];
for (const key of required) {
if (!process.env[key]) {
throw new Error(`Missing required environment variable: ${key}`);
}
}
export const config = {
db: { password: process.env.DB_PASSWORD! },
jwt: { secret: process.env.JWT_SECRET! },
stripe: { secretKey: process.env.STRIPE_SECRET_KEY! },
} as const;
For production, fetch secrets from a managed service at startup:
import { SecretsManagerClient, GetSecretValueCommand } from '@aws-sdk/client-secrets-manager';
const client = new SecretsManagerClient({ region: 'us-east-1' });
async function getSecret(secretId: string): Promise<Record<string, string>> {
const response = await client.send(new GetSecretValueCommand({ SecretId: secretId }));
return JSON.parse(response.SecretString!);
}
// Bootstrap — called once at app startup
async function loadSecrets() {
const dbCreds = await getSecret('prod/myapp/database');
process.env.DB_PASSWORD = dbCreds.password;
process.env.DB_USERNAME = dbCreds.username;
const appSecrets = await getSecret('prod/myapp/app');
process.env.JWT_SECRET = appSecrets.jwt_secret;
}
import Vault from 'node-vault';
const vault = Vault({
endpoint: process.env.VAULT_ADDR,
token: process.env.VAULT_TOKEN, // Use AppRole in prod, not static token
});
async function getDbCredentials() {
// Dynamic secrets — Vault generates a new DB user per request
const result = await vault.read('database/creds/my-role');
return { username: result.data.username, password: result.data.password };
}
// Only load .env in non-production environments
if (process.env.NODE_ENV !== 'production') {
const { config } = await import('dotenv');
config(); // loads .env file
}
# .gitignore — ALWAYS ignore .env files containing real secrets
.env
.env.local
.env.production
*.env
# Commit only the template with no values
.env.example ← commit this
# .env.example — document required vars without values
DB_PASSWORD=
JWT_SECRET=
STRIPE_SECRET_KEY=
REDIS_URL=
// BAD — password appears in logs
logger.info('Connecting to database', { host, port, password });
// GOOD — redact sensitive fields
logger.info('Connecting to database', { host, port, password: '[REDACTED]' });
// Use a redaction library with pino
import pino from 'pino';
const logger = pino({
redact: {
paths: ['password', 'secret', 'token', 'apiKey', '*.password', '*.secret'],
censor: '[REDACTED]',
},
});
Secret rotation: Build services to reload secrets without restart. Use a secrets manager's automatic rotation feature. Store the secret ARN/path in env vars, not the secret value.
Scanning for leaked secrets: Add pre-commit hooks with git-secrets or trufflehog. Run gitleaks detect in CI to catch secrets in commit history.
Principle of least privilege for secrets access:
Environment hierarchy:
.env file (never commit real secrets)https://owasp.org/www-project-top-ten/
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeRead when SKILL.md points to them.
793 skills in this plugin
/a11y-aria-patternsARIA Patterns> Apply ARIA roles, states, and properties correctly to enhance assistive technology support for custom widgets/a11y-color-contrastColor Contrast and Color Independence> Ensure sufficient color contrast ratios and never use color as the sole means of conveying information/a11y-form-patternsAccessible Form Patterns> Build accessible forms with proper labeling, grouped controls, inline validation, and clear error communicationOther plugins' skills for the same job