UNPKG

devibe

Version:

Intelligent repository cleanup with auto mode, AI learning, markdown consolidation, auto-consolidate workflow, context-aware classification, and cost optimization

243 lines 8.24 kB
export const BUILT_IN_PATTERNS = [ { id: 'aws-access-key', name: 'AWS Access Key ID', pattern: /AKIA[0-9A-Z]{16}/g, severity: 'critical', category: 'api-keys', recommendation: 'Use AWS credentials file or IAM roles instead', }, { id: 'aws-secret-key', name: 'AWS Secret Access Key', pattern: /aws_secret_access_key\s*=\s*[\w\/\+]{40}/gi, severity: 'critical', category: 'api-keys', recommendation: 'Use AWS credentials file or IAM roles instead', }, { id: 'generic-api-key', name: 'Generic API Key', pattern: /api[_-]?key["\s:=]+([a-zA-Z0-9_\-]{20,})/gi, severity: 'high', category: 'api-keys', recommendation: 'Move to environment variable or secret management', }, { id: 'stripe-key', name: 'Stripe API Key', pattern: /sk_(live|test)_[a-zA-Z0-9]{24,}/g, severity: 'critical', category: 'api-keys', recommendation: 'Revoke key immediately and use environment variables', }, { id: 'rsa-private-key', name: 'RSA Private Key', pattern: /-----BEGIN RSA PRIVATE KEY-----/g, severity: 'critical', category: 'private-keys', recommendation: 'Remove private key and use secure key management', }, { id: 'openssh-private-key', name: 'OpenSSH Private Key', pattern: /-----BEGIN OPENSSH PRIVATE KEY-----/g, severity: 'critical', category: 'private-keys', recommendation: 'Remove private key and use secure key management', }, { id: 'github-token', name: 'GitHub Personal Access Token', pattern: /ghp_[a-zA-Z0-9]{36}/g, severity: 'critical', category: 'tokens', recommendation: 'Revoke token immediately and use GitHub secrets', }, { id: 'slack-token', name: 'Slack Token', pattern: /xox[baprs]-[0-9a-zA-Z\-]{10,}/g, severity: 'high', category: 'tokens', recommendation: 'Revoke token and use environment variables', }, { id: 'password-assignment', name: 'Password in Code', pattern: /password["\s:=]+["']([^"'\s]{8,})["']/gi, severity: 'high', category: 'passwords', recommendation: 'Use secure credential storage or environment variables', }, { id: 'connection-string', name: 'Database Connection String', pattern: /(mongodb|postgres|mysql):\/\/[^:]+:[^@]+@/gi, severity: 'critical', category: 'credentials', recommendation: 'Use environment variables for connection strings', }, { id: 'bearer-token', name: 'Bearer Token', pattern: /bearer\s+[a-zA-Z0-9_\-\.=]{20,}/gi, severity: 'high', category: 'tokens', recommendation: 'Use secure token management', }, { id: 'google-api-key', name: 'Google API Key', pattern: /AIza[0-9A-Za-z\-_]{35}/g, severity: 'critical', category: 'api-keys', recommendation: 'Restrict API key and move to environment variables', }, { id: 'google-oauth', name: 'Google OAuth Token', pattern: /[0-9]+-[0-9A-Za-z_]{32}\.apps\.googleusercontent\.com/g, severity: 'high', category: 'oauth', recommendation: 'Use OAuth flow instead of hardcoded credentials', }, { id: 'firebase-key', name: 'Firebase Key', pattern: /firebase[_-]?key["\s:=]+["']([^"']+)["']/gi, severity: 'high', category: 'api-keys', recommendation: 'Use Firebase security rules and environment config', }, { id: 'azure-storage-key', name: 'Azure Storage Account Key', pattern: /DefaultEndpointsProtocol=https;AccountName=[^;]+;AccountKey=[^;]+/gi, severity: 'critical', category: 'credentials', recommendation: 'Use Azure Key Vault or managed identities', }, { id: 'heroku-api-key', name: 'Heroku API Key', pattern: /heroku[_-]?api[_-]?key["\s:=]+["']([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})["']/gi, severity: 'critical', category: 'api-keys', recommendation: 'Regenerate key and use Heroku CLI authentication', }, { id: 'sendgrid-api-key', name: 'SendGrid API Key', pattern: /SG\.[a-zA-Z0-9_\-]{22}\.[a-zA-Z0-9_\-]{43}/g, severity: 'critical', category: 'api-keys', recommendation: 'Revoke key and use environment variables', }, { id: 'twilio-api-key', name: 'Twilio API Key', pattern: /SK[a-z0-9]{32}/g, severity: 'critical', category: 'api-keys', recommendation: 'Revoke key and use Twilio environment config', }, { id: 'mailchimp-api-key', name: 'Mailchimp API Key', pattern: /[0-9a-f]{32}-us[0-9]{1,2}/g, severity: 'high', category: 'api-keys', recommendation: 'Regenerate key and use environment variables', }, { id: 'jwt-token', name: 'JWT Token', pattern: /eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}/g, severity: 'high', category: 'tokens', recommendation: 'Never hardcode JWT tokens, generate dynamically', }, { id: 'ssh-private-key', name: 'SSH Private Key', pattern: /-----BEGIN (EC|DSA) PRIVATE KEY-----/g, severity: 'critical', category: 'private-keys', recommendation: 'Remove private key and use SSH agent', }, { id: 'pgp-private-key', name: 'PGP Private Key', pattern: /-----BEGIN PGP PRIVATE KEY BLOCK-----/g, severity: 'critical', category: 'private-keys', recommendation: 'Remove private key and use secure key management', }, { id: 'slack-webhook', name: 'Slack Webhook URL', pattern: /https:\/\/hooks\.slack\.com\/services\/T[a-zA-Z0-9_]+\/B[a-zA-Z0-9_]+\/[a-zA-Z0-9_]+/g, severity: 'high', category: 'webhooks', recommendation: 'Regenerate webhook and use environment variables', }, { id: 'discord-webhook', name: 'Discord Webhook', pattern: /https:\/\/discord\.com\/api\/webhooks\/\d+\/[a-zA-Z0-9_-]+/g, severity: 'high', category: 'webhooks', recommendation: 'Regenerate webhook and use environment variables', }, { id: 'npm-token', name: 'NPM Token', pattern: /npm_[a-zA-Z0-9]{36}/g, severity: 'critical', category: 'tokens', recommendation: 'Revoke token and use .npmrc or CI/CD secrets', }, { id: 'docker-registry-token', name: 'Docker Registry Token', pattern: /docker[_-]?registry[_-]?token["\s:=]+["']([^"']+)["']/gi, severity: 'high', category: 'tokens', recommendation: 'Use docker login or CI/CD secrets', }, { id: 'cloudflare-api-key', name: 'Cloudflare API Key', pattern: /cloudflare[_-]?api[_-]?key["\s:=]+["']([a-f0-9]{37})["']/gi, severity: 'critical', category: 'api-keys', recommendation: 'Use API tokens with restricted permissions', }, { id: 'datadog-api-key', name: 'Datadog API Key', pattern: /datadog[_-]?api[_-]?key["\s:=]+["']([a-f0-9]{32})["']/gi, severity: 'high', category: 'api-keys', recommendation: 'Use environment variables', }, { id: 'anthropic-api-key', name: 'Anthropic API Key', pattern: /sk-ant-api03-[a-zA-Z0-9\-_]{95}/g, severity: 'critical', category: 'api-keys', recommendation: 'Revoke key and use environment variables', }, { id: 'openai-api-key', name: 'OpenAI API Key', pattern: /sk-[a-zA-Z0-9]{48}/g, severity: 'critical', category: 'api-keys', recommendation: 'Revoke key and use environment variables', }, ]; //# sourceMappingURL=secret-patterns.js.map