UNPKG

octocode-data-masker

Version:

A TypeScript library for masking sensitive data in strings, including PII, tokens, API keys, and more

1 lines 110 kB
{"version":3,"file":"index.cjs","sources":["../src/regexes/pii.ts","../src/regexes/cryptographic.ts","../src/regexes/financial.ts","../src/regexes/ai-providers.ts","../src/regexes/authentication.ts","../src/regexes/cloud-providers.ts","../src/regexes/aws-keys.ts","../src/regexes/database.ts","../src/regexes/developer-tools.ts","../src/regexes/network-location.ts","../src/regexes/payment-providers.ts","../src/regexes/url-patterns.ts","../src/regexes/code-config.ts","../src/regexes/social-media.ts","../src/regexes/file-storage.ts","../src/regexes/communication-services.ts","../src/regexes/ecommerce-content.ts","../src/regexes/mapping-monitoring.ts","../src/regexes/analytics-modern.ts","../src/regexes/secret-detection-generic.ts","../src/regexes/github-tokens.ts","../src/regexes/slack.ts","../src/regexes/private-keys.ts","../src/regexes/secret-scanner-patterns.ts","../src/regexes/uuid.ts","../src/regexes/index.ts","../src/masking.ts","../src/sensitive-files.ts"],"sourcesContent":["import { SensitiveDataPattern } from '../types';\nexport const piiPatterns: SensitiveDataPattern[] = [\n {\n name: 'emailAddress',\n description: 'Email address (basic validation)',\n regex: /\\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'socialSecurityNumberFormatted',\n description: 'Social Security Number (with dashes)',\n regex: /\\b(?!000|666|9\\d{2})\\d{3}-(?!00)\\d{2}-(?!0000)\\d{4}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'socialSecurityNumberSpaced',\n description: 'Social Security Number (with spaces)',\n regex: /\\b(?!000|666|9\\d{2})\\d{3}\\s(?!00)\\d{2}\\s(?!0000)\\d{4}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'phoneNumberE164',\n description: 'Phone number (E.164 format)',\n regex: /\\+[1-9]\\d{1,14}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'phoneNumberUS',\n description: 'US phone number (formatted)',\n regex: /\\b(?:\\+?1[-.\\s]?)?\\(?[2-9][0-8][0-9]\\)?[-.\\s]?[2-9][0-9]{2}[-.\\s]?[0-9]{4}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'phoneNumberInternational',\n description: 'International phone number with country code',\n regex: /\\+\\d{1,3}[-.\\s]?\\d{1,4}[-.\\s]?\\d{1,4}[-.\\s]?\\d{1,9}\\b/g,\n matchAccuracy: 'medium'\n },\n {\n name: 'driversLicenseNumber',\n description: 'Drivers license number (US format)',\n regex: /\\b[A-Z]{1,2}\\d{7,8}\\b/g,\n matchAccuracy: 'medium'\n },\n {\n name: 'tinEin',\n description: 'Tax Identification Number/Employer Identification Number',\n regex: /\\b\\d{2}-\\d{7}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'medicalRecordNumber',\n description: 'Medical record number (with context)',\n regex: /\\b(?:MRN|medical\\s+record|patient\\s+id)[:=\\s]*[A-Z0-9-]+\\b/gi,\n matchAccuracy: 'medium'\n },\n {\n name: 'canadianSinFormatted',\n description: 'Canadian Social Insurance Number (formatted)',\n regex: /\\b\\d{3}[-\\s]\\d{3}[-\\s]\\d{3}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'ukNationalInsuranceNumber',\n description: 'UK National Insurance Number',\n regex: /\\b[A-CEGHJ-PR-TW-Z]{2}[0-9]{6}[A-D]\\b/g,\n matchAccuracy: 'high'\n }\n];\n","import { SensitiveDataPattern } from '../types';\nexport const cryptographicPatterns: SensitiveDataPattern[] = [\n {\n name: 'openVpnClientConfigPrivateKey',\n description: 'OpenVPN client config private key',\n regex: /<key>\\s*-----BEGIN[^<]*-----END[^<]*<\\/key>/g,\n matchAccuracy: 'high'\n },\n {\n name: 'firebaseServiceAccountPrivateKey',\n description: 'Firebase service account private key (JSON embedded)',\n regex: /\"private_key\":\\s*\"-----BEGIN PRIVATE KEY-----\\\\n[a-zA-Z0-9+/=\\\\n]+\\\\n-----END PRIVATE KEY-----\"/g,\n matchAccuracy: 'high'\n },\n {\n name: 'rsaPrivateKey',\n description: 'RSA private key',\n regex: /-----BEGIN (?:RSA )?PRIVATE KEY-----\\s*[\\s\\S]*?-----END (?:RSA )?PRIVATE KEY-----/g,\n matchAccuracy: 'high'\n },\n {\n name: 'sshPrivateKeyOpenSsh',\n description: 'SSH private key (OpenSSH format)',\n regex: /-----BEGIN OPENSSH PRIVATE KEY-----\\s*[\\s\\S]*?-----END OPENSSH PRIVATE KEY-----/g,\n matchAccuracy: 'high'\n },\n {\n name: 'sshPrivateKeyEc',\n description: 'SSH private key (Elliptic Curve format)',\n regex: /-----BEGIN EC PRIVATE KEY-----\\s*[\\s\\S]*?-----END EC PRIVATE KEY-----/g,\n matchAccuracy: 'high'\n },\n {\n name: 'pgpPrivateKeyBlock',\n description: 'PGP private key block',\n regex: /-----BEGIN PGP PRIVATE KEY BLOCK-----\\s*[\\s\\S]*?-----END PGP PRIVATE KEY BLOCK-----/g,\n matchAccuracy: 'high'\n },\n {\n name: 'pkcs8PrivateKey',\n description: 'PKCS#8 private key (encrypted or unencrypted)',\n regex: /-----BEGIN ENCRYPTED PRIVATE KEY-----\\s*[\\s\\S]*?-----END ENCRYPTED PRIVATE KEY-----|-----BEGIN PRIVATE KEY-----\\s*[\\s\\S]*?-----END PRIVATE KEY-----/g,\n matchAccuracy: 'high'\n },\n {\n name: 'x509Certificate',\n description: 'X.509 certificate (PEM format)',\n regex: /-----BEGIN CERTIFICATE-----\\s*[\\s\\S]*?-----END CERTIFICATE-----/g,\n matchAccuracy: 'high'\n },\n {\n name: 'sshPublicKey',\n description: 'SSH public key (generic format)',\n regex: /(?:ssh-rsa|ecdsa-sha2-nistp\\d+|ssh-ed25519)\\s+[A-Za-z0-9+/]{40,}={0,2}\\s+[^\\s]+/g,\n matchAccuracy: 'medium'\n },\n {\n name: 'dsaPrivateKey',\n description: 'DSA private key',\n regex: /-----BEGIN DSA PRIVATE KEY-----\\s*[\\s\\S]*?-----END DSA PRIVATE KEY-----/g,\n matchAccuracy: 'high'\n },\n {\n name: 'puttyPrivateKey',\n description: 'PuTTY private key file',\n regex: /PuTTY-User-Key-File-[23]:\\s*[\\s\\S]*?Private-MAC:/g,\n matchAccuracy: 'high'\n },\n {\n name: 'pkcs12Certificate',\n description: 'PKCS#12 certificate store file pattern',\n regex: /\\.p12$|\\.pfx$|\\.pkcs12$/gi,\n matchAccuracy: 'high',\n fileContext: /\\.(p12|pfx|pkcs12)$/i\n },\n {\n name: 'javaKeystore',\n description: 'Java KeyStore file pattern',\n regex: /\\.jks$|\\.keystore$/gi,\n matchAccuracy: 'high',\n fileContext: /\\.(jks|keystore)$/i\n },\n {\n name: 'androidKeystore',\n description: 'Android keystore file',\n regex: /\\.keystore$|debug\\.keystore|release\\.keystore/gi,\n matchAccuracy: 'high',\n fileContext: /\\.keystore$/i\n },\n {\n name: 'x509CertificateRequest',\n description: 'X.509 Certificate Signing Request',\n regex: /-----BEGIN (?:NEW )?CERTIFICATE REQUEST-----\\s*[\\s\\S]*?-----END (?:NEW )?CERTIFICATE REQUEST-----/g,\n matchAccuracy: 'high'\n },\n {\n name: 'dhParameters',\n description: 'Diffie-Hellman parameters',\n regex: /-----BEGIN DH PARAMETERS-----\\s*[\\s\\S]*?-----END DH PARAMETERS-----/g,\n matchAccuracy: 'high'\n },\n {\n name: 'sshHostKey',\n description: 'SSH host key',\n regex: /-----BEGIN SSH2 ENCRYPTED PRIVATE KEY-----[\\s\\S]*?-----END SSH2 ENCRYPTED PRIVATE KEY-----/g,\n matchAccuracy: 'high'\n },\n {\n name: 'ageSecretKey',\n description: 'Age encryption tool secret key',\n regex: /\\bAGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'vaultBatchToken',\n description: 'HashiCorp Vault batch token',\n regex: /\\bhvb\\.[\\w-]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'opensslRandomState',\n description: 'OpenSSL random state file',\n regex: /\\.(rnd|dat)$/gi,\n matchAccuracy: 'high',\n fileContext: /\\.(rnd|dat)$/i\n }\n];\n","import { SensitiveDataPattern } from '../types';\nexport const financialPatterns: SensitiveDataPattern[] = [\n {\n name: 'stripePublishableKey',\n description: 'Stripe publishable key',\n regex: /\\bpk_(?:test|live)_[a-zA-Z0-9]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'stripeSecretKey',\n description: 'Stripe secret key',\n regex: /\\bsk_(?:test|live)_[a-zA-Z0-9]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'stripeRestrictedApiKey',\n description: 'Stripe restricted API key',\n regex: /\\brk_(?:test|live)_[a-zA-Z0-9]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'paypalAccessToken',\n description: 'PayPal access token',\n regex: /\\bA21[a-zA-Z0-9._-]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'squareAccessToken',\n description: 'Square access token',\n regex: /\\bsq0[a-z]tp-[a-zA-Z0-9_-]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'squareApplicationId',\n description: 'Square application ID',\n regex: /\\bsq0ids-[a-zA-Z0-9_-]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'stripeWebhookSecret',\n description: 'Stripe webhook endpoint secret',\n regex: /\\bwhsec_[a-zA-Z0-9]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'stripeSecretKey',\n description: 'Stripe secret key (live or test environment)',\n regex: /\\bsk_(?:live|test)_[a-zA-Z0-9]{24}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'stripePublishableKey',\n description: 'Stripe publishable key (live or test environment)',\n regex: /\\bpk_(?:live|test)_[a-zA-Z0-9]{24}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'stripeApiKey',\n description: 'Stripe API Key',\n regex: /sk_live_[0-9a-zA-Z]{24,}/g,\n matchAccuracy: 'high'\n },\n {\n name: 'stripePublishableKey',\n description: 'Stripe Publishable Key',\n regex: /pk_live_[0-9a-zA-Z]{24,}/g,\n matchAccuracy: 'high'\n },\n {\n name: 'stripeTestKey',\n description: 'Stripe Test Key',\n regex: /sk_test_[0-9a-zA-Z]{24,}/g,\n matchAccuracy: 'high'\n },\n {\n name: 'stripeRestrictedKey',\n description: 'Stripe Restricted Key',\n regex: /rk_live_[0-9a-zA-Z]{24,}/g,\n matchAccuracy: 'high'\n }\n];\n","import { SensitiveDataPattern } from '../types';\nexport const aiProviderPatterns: SensitiveDataPattern[] = [\n {\n name: 'anthropicApiKey',\n description: 'Anthropic API key',\n regex: /\\bsk-ant-(?:admin01|api03)-[\\w-]+AA\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'claudeApiKey',\n description: 'Anthropic Claude API key (alternative format)',\n regex: /\\bsk-ant-api03-[a-zA-Z0-9]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'cohereApiKeyAlternative',\n description: 'Cohere API key (alternative format)',\n regex: /\\bco-[a-zA-Z0-9]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'googleAiApiKey',\n description: 'Google AI API key',\n regex: /\\bAIza[0-9A-Za-z_-]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'groqApiKey',\n description: 'Groq API key',\n regex: /\\bgsk_[a-zA-Z0-9]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'huggingFaceToken',\n description: 'Hugging Face API key',\n regex: /\\bhf_[a-zA-Z0-9]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'langfusePublicKey',\n description: 'Langfuse public key',\n regex: /\\bpk-lf-[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'langfuseSecretKey',\n description: 'Langfuse secret key',\n regex: /\\bsk-lf-[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'openaiApiKey',\n description: 'OpenAI API key (project format)',\n regex: /\\bsk-[a-zA-Z0-9]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'perplexityAiApiKey',\n description: 'Perplexity AI API key',\n regex: /\\bpplx-[a-zA-Z0-9]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'replicateApiToken',\n description: 'Replicate API token',\n regex: /\\br8_[a-zA-Z0-9]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'togetherAiApiKey',\n description: 'Together AI API key',\n regex: /\\b[a-f0-9]{16,32}_[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}\\b/g,\n matchAccuracy: 'high'\n }\n];\n","import { SensitiveDataPattern } from '../types';\nexport const authPatterns: SensitiveDataPattern[] = [\n {\n name: 'authorizationBearerToken',\n description: 'Authorization Bearer Token',\n regex: /Authorization:\\s*Bearer\\s+[a-zA-Z0-9\\-._~+/]+/gi,\n matchAccuracy: 'medium'\n },\n {\n name: 'jwtToken',\n description: 'JWT (JSON Web Token - 3-part)',\n regex: /\\beyJ[a-zA-Z0-9\\-_]+\\.[a-zA-Z0-9\\-_]+\\.[a-zA-Z0-9\\-_]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'basicAuthCredentials',\n description: 'Basic Auth Credentials',\n regex: /Authorization:\\s*Basic\\s+([a-zA-Z0-9+/]+={0,2})\\b/gi,\n matchAccuracy: 'medium'\n },\n {\n name: 'sessionIds',\n description: 'Session IDs / Cookies',\n regex: /(?:JSESSIONID|PHPSESSID|ASP\\.NET_SessionId|connect\\.sid|session_id)=([a-zA-Z0-9%:._-]+)/gi,\n matchAccuracy: 'high'\n },\n {\n name: 'oauthClientCredentials',\n description: 'OAuth Client ID/Secret (Generic)',\n regex: /(?:client_id|client_secret)\\s*[:=]\\s*[\"']([a-zA-Z0-9_-]+)[\"']/gi,\n matchAccuracy: 'medium'\n },\n {\n name: 'googleOauthToken',\n description: 'Google OAuth token',\n regex: /\\bya29\\.[a-zA-Z0-9_-]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'apiKeyInHeader',\n description: 'API key in header',\n regex: /(?:X-API-Key|Api-Key|Authorization-Key):\\s*([a-zA-Z0-9_-]+)/gi,\n matchAccuracy: 'medium'\n },\n {\n name: 'onePasswordSecretKey',\n description: '1Password secret key',\n regex: /\\bA3-[A-Z0-9]{6}-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'onePasswordServiceAccountToken',\n description: '1Password service account token',\n regex: /\\bops_eyJ[a-zA-Z0-9+/]+={0,2}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'jsonWebTokenEnhanced',\n description: 'JSON Web Token with enhanced detection',\n regex: /\\bey[a-zA-Z0-9]+\\.ey[a-zA-Z0-9/_-]+\\.(?:[a-zA-Z0-9/_-]+={0,2})?\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'authressServiceClientAccessKey',\n description: 'Authress service client access key',\n regex: /\\b(?:sc|ext|scauth|authress)_[a-z0-9]+\\.[a-z0-9]+\\.acc[_-][a-z0-9-]+\\.[a-z0-9+/_=-]+\\b/gi,\n matchAccuracy: 'high'\n }\n];\n","import { SensitiveDataPattern } from '../types';\nexport const cloudProviderPatterns: SensitiveDataPattern[] = [\n {\n name: 'googleApiKey',\n description: 'Google API key',\n regex: /\\bAIza[a-zA-Z0-9_-]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'googleOAuth2ClientId',\n description: 'Google OAuth2 client ID',\n regex: /\\b[0-9]+-[a-z0-9]+\\.apps\\.googleusercontent\\.com\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'googleOauth',\n description: 'Google OAuth Client Secret',\n regex: /(\"client_secret\":\"[a-zA-Z0-9-_]{24}\")/g,\n matchAccuracy: 'high'\n },\n {\n name: 'googleServiceAccount',\n description: 'Google Service Account',\n regex: /\"type\": \"service_account\"/g,\n matchAccuracy: 'high'\n },\n {\n name: 'azureStorageAccountKey',\n description: 'Azure storage account key',\n regex: /DefaultEndpointsProtocol=https?;AccountName=[a-z0-9]+;AccountKey=[a-zA-Z0-9+/]+={0,2};EndpointSuffix=core\\.windows\\.net/g,\n matchAccuracy: 'high'\n },\n {\n name: 'azureSubscriptionId',\n description: 'Azure subscription ID',\n regex: /\\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\.onmicrosoft\\.com\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'azureCosmosDbKey',\n description: 'Azure Cosmos DB key',\n regex: /AccountEndpoint=https:\\/\\/[a-z0-9-]+\\.documents\\.azure\\.com:443\\/;AccountKey=[a-zA-Z0-9+/]+={0,2}/g,\n matchAccuracy: 'high'\n },\n {\n name: 'azureServiceBusConnectionString',\n description: 'Azure Service Bus connection string',\n regex: /Endpoint=sb:\\/\\/[a-z0-9-]+\\.servicebus\\.windows\\.net\\/;SharedAccessKeyName=[a-zA-Z0-9]+;SharedAccessKey=[a-zA-Z0-9+/]+={0,2}/g,\n matchAccuracy: 'high'\n },\n {\n name: 'dropboxAccessToken',\n description: 'Dropbox access token',\n regex: /\\bsl\\.[a-zA-Z0-9_-]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'dropboxAppKey',\n description: 'Dropbox app key',\n regex: /\\b[a-z0-9]{15}\\.(app|apps)\\.dropbox\\.com\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'planetScaleConnectionString',\n description: 'PlanetScale connection string',\n regex: /mysql:\\/\\/[a-zA-Z0-9_-]+:[a-zA-Z0-9_=-]+@[a-z0-9.-]+\\.psdb\\.cloud\\/[a-zA-Z0-9_-]+\\?sslaccept=strict/g,\n matchAccuracy: 'high'\n },\n {\n name: 'gcpServiceAccountEmail',\n description: 'GCP service account email',\n regex: /\\b[a-z0-9-]+@[a-z0-9-]+\\.iam\\.gserviceaccount\\.com\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'gcpProjectId',\n description: 'GCP project ID',\n regex: /\"project_id\":\\s*\"[a-z0-9-]+\"/g,\n matchAccuracy: 'high'\n },\n {\n name: 'cloudinaryUrl',\n description: 'Cloudinary URL',\n regex: /cloudinary:\\/\\/.*/g,\n matchAccuracy: 'high'\n },\n {\n name: 'firebaseUrl',\n description: 'Firebase URL',\n regex: /.*firebaseio\\.com/g,\n matchAccuracy: 'high'\n },\n {\n name: 'sendgridApiKeyV2',\n description: 'SendGrid API Key (v2)',\n regex: /\\bSG\\.[A-Za-z0-9_-]{22}\\.[A-Za-z0-9_-]{43}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'mailgunApiKey',\n description: 'Mailgun API Key',\n regex: /key-[0-9a-z]{32}/g,\n matchAccuracy: 'high'\n },\n {\n name: 'firebaseApiKey',\n description: 'Firebase API Key',\n regex: /AIza[0-9A-Za-z_-]{35}/g,\n matchAccuracy: 'high'\n },\n {\n name: 'discordBotToken',\n description: 'Discord Bot Token',\n regex: /[MN][A-Za-z\\d]{23}\\.[\\w-]{6}\\.[\\w-]{27}/g,\n matchAccuracy: 'high'\n },\n {\n name: 'discordWebhook',\n description: 'Discord Webhook',\n regex: /https:\\/\\/discord\\.com\\/api\\/webhooks\\/[0-9]{18}\\/[A-Za-z0-9_-]{68}/g,\n matchAccuracy: 'high'\n },\n {\n name: 'telegramBotToken',\n description: 'Telegram Bot Token',\n regex: /[0-9]{8,10}:[A-Za-z0-9_-]{35}/g,\n matchAccuracy: 'high'\n },\n {\n name: 'npmToken',\n description: 'NPM Token',\n regex: /npm_[a-zA-Z0-9]{36}/g,\n matchAccuracy: 'high'\n },\n {\n name: 'dockerHubToken',\n description: 'Docker Hub Token',\n regex: /dckr_pat_[a-zA-Z0-9_-]{36}/g,\n matchAccuracy: 'high'\n },\n {\n name: 'pypiApiToken',\n description: 'PyPI API Token',\n regex: /pypi-[a-zA-Z0-9_-]{84}/g,\n matchAccuracy: 'high'\n },\n {\n name: 'gitlabPersonalAccessToken',\n description: 'GitLab Personal Access Token',\n regex: /glpat-[a-zA-Z0-9_-]{20}/g,\n matchAccuracy: 'high'\n },\n {\n name: 'azureDevOpsToken',\n description: 'Azure DevOps Personal Access Token',\n regex: /[a-z0-9]{52}/g,\n matchAccuracy: 'low'\n },\n {\n name: 'basicAuthCredentials',\n description: 'Basic Auth Credentials',\n regex: /Basic [A-Za-z0-9+/]+=*/g,\n matchAccuracy: 'medium'\n },\n {\n name: 'sendgridApiKey',\n description: 'SendGrid API key',\n regex: /\\bSG\\.[0-9A-Za-z_-]{20,}\\.[0-9A-Za-z_-]{40,}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'mailchimpApiKey',\n description: 'MailChimp API key',\n regex: /\\b[0-9a-f]{32}-us[0-9]{1,2}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'twilioApiKeyTruffleHog',\n description: 'Twilio API Key (TruffleHog pattern)',\n regex: /SK[a-z0-9]{32}/g,\n matchAccuracy: 'high'\n },\n {\n name: 'twilioAccountSid',\n description: 'Twilio Account SID',\n regex: /\\bAC[0-9a-fA-F]{32}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'squareAccessToken',\n description: 'Square access token',\n regex: /\\bsq0atp-[a-zA-Z0-9_-]{26}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'squareOauthSecret',\n description: 'Square OAuth secret',\n regex: /\\bsq0csp-[a-zA-Z0-9_-]{43}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'paypalBraintreeAccessToken',\n description: 'PayPal/Braintree access token',\n regex: /\\baccess_token\\$(?:sandbox|production)\\$[0-9a-z]{16}\\$[0-9a-f]{32}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'airtablePersonalAccessToken',\n description: 'Airtable Personal Access Token',\n regex: /\\bpat[a-zA-Z0-9]{14}\\.[a-zA-Z0-9]{64}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'typeformToken',\n description: 'Typeform token',\n regex: /\\btfp_[a-zA-Z0-9_-]{43}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'figmaToken',\n description: 'Figma token',\n regex: /\\bfigd_[a-zA-Z0-9_-]{43}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'planetScaleToken',\n description: 'PlanetScale token',\n regex: /\\bpscale_tkn_[a-zA-Z0-9_-]{43}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'renderToken',\n description: 'Render token',\n regex: /\\brnd_[a-zA-Z0-9_-]{43}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'intercomToken',\n description: 'Intercom access token',\n regex: /\\bdG9rOi[a-zA-Z0-9+/]{46,48}={0,2}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'shopifyPrivateAppPassword',\n description: 'Shopify private app password',\n regex: /\\bshppa_[a-fA-F0-9]{32}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'shopifyAccessToken',\n description: 'Shopify access token',\n regex: /\\bshpat_[a-fA-F0-9]{32}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'shopifyWebhookToken',\n description: 'Shopify webhook token',\n regex: /\\bshpwh_[a-fA-F0-9]{32}\\b/g,\n matchAccuracy: 'high'\n }\n];\n","import { SensitiveDataPattern } from '../types';\nexport const awsPatterns: SensitiveDataPattern[] = [\n {\n name: 'awsAccessKeyId',\n description: 'AWS access key ID',\n regex: /\\b(?:AKIA|ABIA|ACCA|ASCA|ASIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ANWA)[0-9A-Z]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'awsAccountId',\n description: 'AWS Account ID',\n regex: /\\b['\"]?(AWS|aws|Aws)?_?(?:ACCOUNT|account|Account)_?(?:ID|id|Id)?['\"]?\\s*(?::|=>|=)\\s*['\"]?[0-9]{4}-?[0-9]{4}-?[0-9]{4}['\"]?\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'awsAmiId',\n description: 'AWS AMI ID',\n regex: /\\bami-[a-f0-9]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'awsApiGatewayUrl',\n description: 'AWS API Gateway endpoint URL',\n regex: /\\b[0-9a-z]+\\.execute-api\\.[0-9a-z._-]+\\.amazonaws\\.com\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'awsAppSyncGraphqlKey',\n description: 'AWS AppSync GraphQL API key',\n regex: /\\bda2-[a-z0-9]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'awsEc2InstanceId',\n description: 'AWS EC2 instance ID',\n regex: /\\bi-[a-f0-9]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'awsEbsSnapshotId',\n description: 'AWS EBS snapshot ID',\n regex: /\\bsnap-[a-f0-9]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'awsEbsVolumeId',\n description: 'AWS EBS volume ID',\n regex: /\\bvol-[a-f0-9]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'awsIamRoleArn',\n description: 'AWS IAM role ARN',\n regex: /\\barn:aws:iam::[0-9]{12}:role\\/[a-zA-Z0-9_+=,.@-]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'awsLambdaFunctionArn',\n description: 'AWS Lambda function ARN',\n regex: /\\barn:aws:lambda:[a-z0-9-]+:[0-9]{12}:function:[a-zA-Z0-9_-]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'awsMwsToken',\n description: 'AWS MWS token',\n regex: /\\bamzn\\.mws\\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'awsRdsEndpoint',\n description: 'AWS RDS database endpoint',\n regex: /\\b[0-9a-z._-]+\\.rds\\.amazonaws\\.com\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'awsRegion',\n description: 'AWS Region configuration',\n regex: /\\b['\"]?(AWS|aws|Aws)?_?(?:REGION|region|Region)['\"]?\\s*(?::|=>|=)\\s*['\"]?(us|eu|ap|sa|ca|me|af|cn|gov)[-]?(east|west|north|south|central|southeast|northeast)?[-]?[0-9]?['\"]?\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'awsS3BucketArn',\n description: 'AWS S3 bucket ARN',\n regex: /\\barn:aws:s3:::[a-zA-Z0-9._-]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'awsS3BucketUrl',\n description: 'AWS S3 bucket URL',\n regex: /\\bs3:\\/\\/[0-9a-z._/-]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'awsSecretAccessKey',\n description: 'AWS Secret Access Key',\n regex: /\\b['\"]?(AWS|aws|Aws)?_?(?:SECRET|secret|Secret)_?(?:ACCESS|access|Access)_?(?:KEY|key|Key)['\"]?\\s*(?::|=>|=)\\s*['\"]?([A-Za-z0-9/+=]{40})['\"]?\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'awsSecurityGroupId',\n description: 'AWS security group ID',\n regex: /\\bsg-[a-f0-9]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'awsSessionToken',\n description: 'AWS Session Token',\n regex: /\\b['\"]?(AWS|aws|Aws)?_?(?:SESSION|session|Session)_?(?:TOKEN|token|Token)['\"]?\\s*(?::|=>|=)\\s*['\"]?[A-Za-z0-9/+=]{100,}['\"]?\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'awsSnsTopicArn',\n description: 'AWS SNS topic ARN',\n regex: /\\barn:aws:sns:[a-z0-9-]+:[0-9]{12}:[a-zA-Z0-9_-]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'awsSqsQueueUrl',\n description: 'AWS SQS queue URL',\n regex: /\\bhttps:\\/\\/sqs\\.[a-z0-9-]+\\.amazonaws\\.com\\/[0-9]{12}\\/[a-zA-Z0-9_-]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'awsSubnetId',\n description: 'AWS subnet ID',\n regex: /\\bsubnet-[a-f0-9]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'awsVpcId',\n description: 'AWS VPC ID',\n regex: /\\bvpc-[a-f0-9]+\\b/g,\n matchAccuracy: 'high'\n }\n];\n","import { SensitiveDataPattern } from '../types';\nexport const databasePatterns: SensitiveDataPattern[] = [\n {\n name: 'postgresqlConnectionString',\n description: 'PostgreSQL database connection string with credentials',\n regex: /postgresql:\\/\\/[^:]+:[^@]+@[^/]+\\/[^?\\s]+/gi,\n matchAccuracy: 'high'\n },\n {\n name: 'databaseUrlWithCredentials',\n description: 'Generic database URL with embedded credentials',\n regex: /(?:postgres|mysql|mongodb|redis):\\/\\/[^:]+:[^@]+@[^\\s/]+/gi,\n matchAccuracy: 'medium'\n },\n {\n name: 'databasePasswordInUrl',\n description: 'Database password in connection string parameters',\n regex: /(?:password|pwd)=([^&\\s;]+)/gi,\n matchAccuracy: 'medium'\n },\n {\n name: 'databaseUserInUrl',\n description: 'Database username in connection string parameters',\n regex: /(?:user|username|uid)=([^&\\s;]+)/gi,\n matchAccuracy: 'low',\n isGeneralId: true\n },\n {\n name: 'elasticsearchAuthentication',\n description: 'Elasticsearch username and password in connection strings',\n regex: /https?:\\/\\/[^:]+:[^@]+@[^/]+:9200/gi,\n matchAccuracy: 'high'\n },\n {\n name: 'redisAuthPassword',\n description: 'Redis AUTH password',\n regex: /AUTH\\s+([a-zA-Z0-9_-]{8,})/gi,\n matchAccuracy: 'medium'\n },\n {\n name: 'couchDbCredentials',\n description: 'CouchDB credentials in URL',\n regex: /http[s]?:\\/\\/[^:]+:[^@]+@[^/]+:5984/gi,\n matchAccuracy: 'high'\n },\n {\n name: 'influxDbToken',\n description: 'InfluxDB token',\n regex: /\\btoken=[a-zA-Z0-9_-]{80,100}\\b/g,\n matchAccuracy: 'medium'\n },\n {\n name: 'neo4jCredentials',\n description: 'Neo4j database credentials in URL',\n regex: /bolt[s]?:\\/\\/[^:]+:[^@]+@[^/]+:7687/gi,\n matchAccuracy: 'high'\n },\n {\n name: 'faunaDbKey',\n description: 'FaunaDB key',\n regex: /\\bfn[a-zA-Z0-9]{40}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'cassandraConnectionString',\n description: 'Cassandra connection string with credentials',\n regex: /cassandra:\\/\\/[^:]+:[^@]+@[^/]+:9042/gi,\n matchAccuracy: 'high'\n },\n {\n name: 'timescaleDbConnectionString',\n description: 'TimescaleDB connection string with credentials',\n regex: /timescaledb:\\/\\/[^:]+:[^@]+@[^/]+\\/[^?\\s]+/gi,\n matchAccuracy: 'high'\n },\n {\n name: 'clickhouseConnectionString',\n description: 'ClickHouse connection string with credentials',\n regex: /clickhouse:\\/\\/[^:]+:[^@]+@[^/]+:8123/gi,\n matchAccuracy: 'high'\n },\n {\n name: 'mongodbConnectionString',\n description: 'MongoDB connection string with credentials',\n regex: /\\bmongodb:\\/\\/[a-zA-Z0-9._-]+:[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+:[0-9]+\\/[a-zA-Z0-9._-]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'redisConnectionString',\n description: 'Redis connection string with credentials',\n regex: /\\bredis:\\/\\/[a-zA-Z0-9._-]+:[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+:[0-9]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'databricksApiToken',\n description: 'Databricks API token',\n regex: /\\bdapi[a-f0-9]{32}(?:-\\d)?\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'pineconeEnvironment',\n description: 'Pinecone environment and API key',\n regex: /pinecone[\\s\\w]*(?:api|key|env)[\\s:=]*[\"']?([a-zA-Z0-9_-]{32})[\"']?/gi,\n matchAccuracy: 'medium'\n }\n];\n","import { SensitiveDataPattern } from '../types';\nexport const developerToolsPatterns: SensitiveDataPattern[] = [\n {\n name: 'gitlabPersonalAccessToken',\n description: 'GitLab personal access token',\n regex: /\\bglpat-[A-Za-z0-9_-]{20,50}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'gitlabDeployToken',\n description: 'GitLab deploy token',\n regex: /\\bgldt-[A-Za-z0-9_-]{20,50}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'gitlabRunnerToken',\n description: 'GitLab runner token',\n regex: /\\bglrt-[A-Za-z0-9_-]{20,50}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'gitlabCicdJobToken',\n description: 'GitLab CI/CD Job Token',\n regex: /\\bglcbt-[0-9a-zA-Z]{1,5}_[0-9a-zA-Z_-]{20}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'dockerHubAccessToken',\n description: 'Docker Hub access token',\n regex: /\\bdckr_pat_[a-zA-Z0-9]{22}_[a-zA-Z0-9]{18}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'artifactoryApiKey',\n description: 'Artifactory API key',\n regex: /\\bAKCp[A-Za-z0-9]{69}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'atlassianApiToken',\n description: 'Atlassian API token for Jira/Confluence',\n regex: /\\bATATT3[A-Za-z0-9_\\-=]{186}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'npmAccessToken',\n description: 'NPM access token',\n regex: /\\bnpm_[a-zA-Z0-9]{36}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'pypiApiToken',\n description: 'PyPI API token',\n regex: /\\bpypi-[A-Za-z0-9_-]{8,}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'terraformCloudToken',\n description: 'Terraform Cloud API token',\n regex: /\\b[a-zA-Z0-9]{14}\\.[a-zA-Z0-9]{6}\\.[a-zA-Z0-9]{16}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'jetBrainsToken',\n description: 'JetBrains access token',\n regex: /\\bperm:[a-zA-Z0-9_-]{10,}\\b/g,\n matchAccuracy: 'medium'\n },\n {\n name: 'sourcegraphApiKey',\n description: 'Sourcegraph API key',\n regex: /\\bsgp_[a-zA-Z0-9]{32}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'nugetApiKey',\n description: 'NuGet API key',\n regex: /\\boy2[a-z0-9]{43}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'stackhawkApiKey',\n description: 'StackHawk API key',\n regex: /\\bhawk\\.[0-9A-Za-z\\-_]{20}\\.[0-9A-Za-z\\-_]{20}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'bitbucketAppPasswordSpecific',\n description: 'Bitbucket app password (specific format)',\n regex: /\\bATBB[a-zA-Z0-9]{24}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'openweatherApiKey',\n description: 'OpenWeather API key',\n regex: /\\bappid=[0-9a-f]{32}\\b/gi,\n matchAccuracy: 'high'\n },\n {\n name: 'herokuApiKey',\n description: 'Heroku API Key',\n regex: /[h|H][e|E][r|R][o|O][k|K][u|U].*[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}/g,\n matchAccuracy: 'high'\n },\n {\n name: 'linearPersonalApiKey',\n description: 'Linear Personal API key',\n regex: /\\blin_pat_[a-zA-Z0-9_-]{40}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'notionInternalIntegration',\n description: 'Notion internal integration token',\n regex: /\\bntn_[a-zA-Z0-9_-]{43}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'pulumiAccessToken',\n description: 'Pulumi access token',\n regex: /\\bpul-[a-f0-9]{40}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'sentryAuthTokenSpecific',\n description: 'Sentry auth token (with context)',\n regex: /sentry[\\s\\w]*(?:auth|token)[\\s:=]*[\"']?([a-f0-9]{64})[\"']?/gi,\n matchAccuracy: 'medium'\n },\n {\n name: 'bugsnagApiKeySpecific',\n description: 'Bugsnag API key (with context)',\n regex: /bugsnag[\\s\\w]*(?:api|key)[\\s:=]*[\"']?([a-f0-9]{32})[\"']?/gi,\n matchAccuracy: 'medium'\n },\n {\n name: 'rollbarAccessTokenSpecific',\n description: 'Rollbar access token (with context)',\n regex: /rollbar[\\s\\w]*(?:access|token)[\\s:=]*[\"']?([a-f0-9]{32})[\"']?/gi,\n matchAccuracy: 'medium'\n }\n];\n","import { SensitiveDataPattern } from '../types';\nexport const networkLocationPatterns: SensitiveDataPattern[] = [\n {\n name: 'macAddress',\n description: 'MAC address',\n regex: /\\b([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'ipv4Address',\n description: 'IPv4 address',\n regex: /\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b/g,\n matchAccuracy: 'low'\n },\n {\n name: 'ipv6Address',\n description: 'IPv6 address',\n regex: /\\b(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}\\b/g,\n matchAccuracy: 'low'\n },\n {\n name: 'privateNetworkRange',\n description: 'Private network IP ranges',\n regex: /\\b(?:10\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)|172\\.(?:1[6-9]|2[0-9]|3[01])\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)|192\\.168\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'sshHostFingerprint',\n description: 'SSH host fingerprint',\n regex: /\\b[0-9a-f]{2}(:[0-9a-f]{2}){15}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'wifiPassword',\n description: 'WiFi password in config',\n regex: /(?:password|psk)\\s*[=:]\\s*[\"']([^\"']{8,})[\"']/gi,\n matchAccuracy: 'medium'\n }\n];\n","import { SensitiveDataPattern } from '../types';\nexport const paymentProviderPatterns: SensitiveDataPattern[] = [\n {\n name: 'squareAccessToken',\n description: 'Square access token',\n regex: /\\bEAAAE[A-Za-z0-9_-]{100,}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'adyenApiKey',\n description: 'Adyen API key',\n regex: /\\bAQE[a-zA-Z0-9]{70,}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'applePayMerchantId',\n description: 'Apple Pay merchant ID',\n regex: /\\bmerchant\\.[a-zA-Z0-9.-]+\\b/g,\n matchAccuracy: 'medium'\n },\n {\n name: 'razorpayApiKey',\n description: 'Razorpay API key',\n regex: /\\brzp_[a-zA-Z0-9]{32}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'paypalAccessToken',\n description: 'PayPal access token',\n regex: /\\bA21AA[a-zA-Z0-9_-]{50,}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'paypalBraintreeAccessToken',\n description: 'PayPal/Braintree access token',\n regex: /\\baccess_token\\$production\\$[0-9a-z]{16}\\$[0-9a-f]{32}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'squareAccessTokenSpecific',\n description: 'Square access token (specific format)',\n regex: /\\bsq0atp-[0-9A-Za-z\\-_]{22}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'squareOauthSecret',\n description: 'Square OAuth secret',\n regex: /\\bsq0csp-[0-9A-Za-z\\-_]{43}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'squareApiKey',\n description: 'Square API key',\n regex: /\\bsq0[a-z]{3}-[a-zA-Z0-9_-]{22,43}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'finicityApiToken',\n description: 'Finicity API token',\n regex: /finicity.{0,50}[a-f0-9]{32}/gi,\n isGeneralId: true,\n matchAccuracy: 'medium'\n },\n {\n name: 'finnhubAccessToken',\n description: 'Finnhub access token',\n regex: /finnhub.{0,50}[a-z0-9]{20}/gi,\n isGeneralId: true,\n matchAccuracy: 'medium'\n },\n {\n name: 'flutterwavePublicKey',\n description: 'Flutterwave public key',\n regex: /\\bFLWPUBK_TEST-[a-h0-9]{32}-X\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'flutterwaveSecretKey',\n description: 'Flutterwave secret key',\n regex: /\\bFLWSECK_TEST-[a-h0-9]{32}-X\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'flutterwaveEncryptionKey',\n description: 'Flutterwave encryption key',\n regex: /\\bFLWSECK_TEST-[a-h0-9]{12}\\b/g,\n matchAccuracy: 'high'\n }\n];\n","import { SensitiveDataPattern } from '../types';\nexport const urlPatterns: SensitiveDataPattern[] = [\n {\n name: 'urlWithQueryParams',\n description: 'URL with Query Parameters',\n regex: /(https?:\\/\\/[^\\s?]+)\\?.*$/gi,\n matchAccuracy: 'medium'\n }\n];\n","import { SensitiveDataPattern } from '../types';\nexport const codeConfigPatterns: SensitiveDataPattern[] = [\n {\n name: 'hardcodedSecretsInJsonYaml',\n description: 'Hardcoded Secrets in JSON / YAML',\n regex: /(?:\"(?:password|secret|api_key|private_key|token)\"\\s*:\\s*\"[^\"]{8,}\"|'(?:password|secret|api_key|private_key|token)'\\s*:\\s*'[^']{8,}')/gi,\n matchAccuracy: 'medium'\n },\n {\n name: 'environmentVariables',\n description: 'Environment Variables',\n regex: /(?:process\\.env\\.|ENV\\[|getenv\\(|os\\.environ\\[)['\"]((?:API_KEY|SECRET|PASSWORD|TOKEN|PRIVATE_KEY|DB_PASS)[^'\"]*)['\"]/gi,\n matchAccuracy: 'medium'\n },\n {\n name: 'configFilePasswords',\n description: 'Config File Passwords',\n regex: /(?:password|passwd|pwd)\\s*[:=]\\s*['\"]([^'\"]{6,})['\"]/gi,\n matchAccuracy: 'medium'\n },\n {\n name: 'databaseCredentialsInConfig',\n description: 'Database Credentials in Config',\n regex: /(?:db_password|database_password|db_pass)\\s*[:=]\\s*['\"]([^'\"]{4,})['\"]/gi,\n matchAccuracy: 'medium'\n },\n {\n name: 'apiKeysInComments',\n description: 'API Keys in Comments',\n regex: /\\/\\/.*(?:api.key|token|secret)[:=\\s]+([a-zA-Z0-9_-]{20,})/gi,\n matchAccuracy: 'low'\n },\n {\n name: 'hardcodedJwtSecrets',\n description: 'Hardcoded JWT Secrets',\n regex: /jwt[_-]?secret\\s*[:=]\\s*['\"]([^'\"]{16,})['\"]/gi,\n matchAccuracy: 'high'\n },\n {\n name: 'privateKeysInConfig',\n description: 'Private Keys in Config',\n regex: /(?:private[_-]?key|rsa[_-]?key)\\s*[:=]\\s*['\"]([^'\"]{50,})['\"]/gi,\n matchAccuracy: 'medium'\n },\n {\n name: 'encryptionKeys',\n description: 'Encryption Keys',\n regex: /(?:encryption[_-]?key|cipher[_-]?key|secret[_-]?key)\\s*[:=]\\s*['\"]([^'\"]{16,})['\"]/gi,\n matchAccuracy: 'medium'\n },\n {\n name: 'sessionSecrets',\n description: 'Session Secrets',\n regex: /session[_-]?secret\\s*[:=]\\s*['\"]([^'\"]{16,})['\"]/gi,\n matchAccuracy: 'medium'\n },\n {\n name: 'cookieSecrets',\n description: 'Cookie Secrets',\n regex: /cookie[_-]?secret\\s*[:=]\\s*['\"]([^'\"]{16,})['\"]/gi,\n matchAccuracy: 'medium'\n },\n {\n name: 'kubernetesSecretYaml',\n description: 'Kubernetes Secret in YAML format',\n regex: /\\bkind:\\s*[\"']?secret[\"']?[\\s\\S]*?\\bdata:\\s*[\\s\\S]*?([a-zA-Z0-9_-]+:\\s*[a-zA-Z0-9+/]{10,}={0,3})/gi,\n matchAccuracy: 'high',\n fileContext: /\\.ya?ml$/i\n }\n];\n","import { SensitiveDataPattern } from '../types';\nexport const socialMediaPatterns: SensitiveDataPattern[] = [\n {\n name: 'twitterBearerToken',\n description: 'Twitter Bearer token',\n regex: /\\bAAAAAAAAAAAAAAAAAAAAA[a-zA-Z0-9%]{50,}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'facebookAccessToken',\n description: 'Facebook access token',\n regex: /\\bEAA[a-zA-Z0-9]{80,120}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'facebookOauth',\n description: 'Facebook OAuth Token',\n regex: /[f|F][a|A][c|C][e|E][b|B][o|O][o|O][k|K].*['|\"][0-9a-f]{32}['|\"]/g,\n matchAccuracy: 'high'\n },\n {\n name: 'twitterOauth',\n description: 'Twitter OAuth Token',\n regex: /[t|T][w|W][i|I][t|T][t|T][e|E][r|R].*['|\"][0-9a-zA-Z]{35,44}['|\"]/g,\n matchAccuracy: 'high'\n }\n];\n","import { SensitiveDataPattern } from '../types';\nexport const fileStoragePatterns: SensitiveDataPattern[] = [\n {\n name: 'dropboxAccessToken',\n description: 'Dropbox access token',\n regex: /\\bsl\\.[a-zA-Z0-9_-]{120,140}\\b/g,\n matchAccuracy: 'high'\n }\n];\n","import { SensitiveDataPattern } from '../types';\nexport const communicationServicePatterns: SensitiveDataPattern[] = [\n {\n name: 'sendGridApiKey',\n description: 'SendGrid API key',\n regex: /\\bSG\\.[a-zA-Z0-9_-]{22}\\.[a-zA-Z0-9_-]{43}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'mailgunApiKey',\n description: 'Mailgun API key',\n regex: /\\bkey-[0-9a-zA-Z]{32}\\b/g,\n matchAccuracy: 'medium'\n },\n {\n name: 'telegramBotToken',\n description: 'Telegram bot token',\n regex: /\\b[0-9]{8,10}:[a-zA-Z0-9_-]{35}\\b/g,\n matchAccuracy: 'high'\n }\n];\n","import { SensitiveDataPattern } from '../types';\nexport const ecommerceContentPatterns: SensitiveDataPattern[] = [\n {\n name: 'shopifyStorefrontApiAccessToken',\n description: 'Shopify storefront API access token',\n regex: /\\bshpatf_[0-9a-f]{32}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'hubSpotApiKey',\n description: 'HubSpot API key',\n regex: /\\bpat-[a-zA-Z0-9-]{36}\\b/g,\n matchAccuracy: 'medium'\n },\n {\n name: 'contentfulAccessToken',\n description: 'Contentful access token',\n regex: /\\bCFPAT-[0-9a-zA-Z]{20}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'sanityIoApiToken',\n description: 'Sanity.io API token',\n regex: /\\bsk\\.[a-zA-Z0-9]{60,}\\b/g,\n isGeneralId: true,\n matchAccuracy: 'medium'\n },\n {\n name: 'wooCommerceConsumerKey',\n description: 'WooCommerce consumer key',\n regex: /\\bck_[a-f0-9]{40}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'wooCommerceConsumerSecret',\n description: 'WooCommerce consumer secret',\n regex: /\\bcs_[a-f0-9]{40}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'mailchimpApiKeySpecific',\n description: 'MailChimp API key (specific format)',\n regex: /\\b[0-9a-f]{32}-[a-z]{2,3}[0-9]{1,2}\\b/g,\n matchAccuracy: 'high'\n }\n];\n","import { SensitiveDataPattern } from '../types';\nexport const mappingMonitoringPatterns: SensitiveDataPattern[] = [\n {\n name: 'mapboxAccessTokenPublic',\n description: 'Mapbox public access token',\n regex: /\\bpk\\.[a-zA-Z0-9]{60,}\\b/g,\n matchAccuracy: 'high'\n }, {\n name: 'grafanaCloudApiKey',\n description: 'Grafana Cloud API key',\n regex: /\\bglc_[a-zA-Z0-9]{32}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'mailchimpApiKey',\n description: 'Mailchimp API key',\n regex: /\\b[0-9a-f]{32}-[a-z]{2}\\b/g,\n matchAccuracy: 'medium'\n },\n {\n name: 'newRelicApiKey',\n description: 'New Relic API key',\n regex: /\\bNRAK-[A-Z0-9]{27}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'honeybadgerApiKey',\n description: 'Honeybadger API key',\n regex: /\\b[a-f0-9]{32}\\b/g,\n matchAccuracy: 'medium'\n }\n];\n","import { SensitiveDataPattern } from '../types';\nexport const analyticsModernPatterns: SensitiveDataPattern[] = [\n {\n name: 'posthogApiKey',\n description: 'PostHog API key',\n regex: /\\bphc_[a-zA-Z0-9_-]{43}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'posthogPersonalApiKey',\n description: 'PostHog personal API key',\n regex: /\\bphx_[a-zA-Z0-9_-]{43}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'googleAnalytics4MeasurementId',\n description: 'Google Analytics 4 Measurement ID',\n regex: /\\bG-[A-Z0-9]{10}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'datadogApiKeySpecific',\n description: 'Datadog API key (with context)',\n regex: /datadog[\\s\\w]*api[\\s\\w]*key[\\s:=]*[\"']?([a-f0-9]{32})[\"']?/gi,\n matchAccuracy: 'medium'\n },\n {\n name: 'datadogApplicationKeySpecific',\n description: 'Datadog application key (with context)',\n regex: /datadog[\\s\\w]*app[\\s\\w]*key[\\s:=]*[\"']?([a-f0-9]{40})[\"']?/gi,\n matchAccuracy: 'medium'\n },\n {\n name: 'honeycombApiKey',\n description: 'Honeycomb API key',\n regex: /\\bhcaik_[a-zA-Z0-9_-]{32}\\b/g,\n matchAccuracy: 'high'\n }\n];\n","import { SensitiveDataPattern } from '../types';\nexport const secretDetectionGenericPatterns: SensitiveDataPattern[] = [\n {\n name: 'genericPassword',\n description: 'Generic password pattern in keys',\n regex: /passw(or)?d/ig,\n matchAccuracy: 'medium'\n },\n {\n name: 'genericPasswordShort',\n description: 'Short password pattern',\n regex: /^pw$/i,\n matchAccuracy: 'medium'\n },\n {\n name: 'genericPass',\n description: 'Generic pass pattern',\n regex: /^pass$/i,\n matchAccuracy: 'medium'\n },\n {\n name: 'genericSecret',\n description: 'Generic secret pattern',\n regex: /secret/i,\n matchAccuracy: 'medium'\n },\n {\n name: 'genericSecretPattern',\n description: 'Generic Secret Pattern',\n regex: /[s|S][e|E][c|C][r|R][e|E][t|T].*['|\"][0-9a-zA-Z]{32,45}['|\"]/g,\n matchAccuracy: 'medium'\n },\n {\n name: 'genericApiKeyPattern',\n description: 'Generic API Key Pattern',\n regex: /[a|A][p|P][i|I][_]?[k|K][e|E][y|Y].*['|\"][0-9a-zA-Z]{32,45}['|\"]/g,\n matchAccuracy: 'medium'\n },\n {\n name: 'passwordInUrl',\n description: 'Password in URL',\n regex: /[a-zA-Z]{3,10}:\\/\\/[^\\\\/\\s:@]{3,20}:[^\\\\/\\s:@]{3,20}@.{1,100}[\"'\\s]/g,\n matchAccuracy: 'high'\n },\n {\n name: 'genericApiKey',\n description: 'Generic API key pattern',\n regex: /api[-._]?key/i,\n matchAccuracy: 'medium'\n },\n {\n name: 'genericSessionId',\n description: 'Generic session ID pattern',\n regex: /session[-._]?id/i,\n matchAccuracy: 'medium'\n },\n {\n name: 'connectSid',\n description: 'Express session connect.sid',\n regex: /^connect\\.sid$/,\n matchAccuracy: 'high'\n },\n {\n name: 'creditCardNumber',\n description: 'Credit card number pattern',\n regex: /^\\d{4}[- ]?\\d{4}[- ]?\\d{4}[- ]?\\d{4}$/,\n matchAccuracy: 'high'\n }\n];\n","import { SensitiveDataPattern } from '../types';\nexport const githubTokenPatterns: SensitiveDataPattern[] = [\n {\n name: 'githubPersonalAccessToken',\n description: 'GitHub Personal Access Token',\n regex: /\\bghp_[A-Za-z0-9_]{36}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'githubOAuthAccessToken',\n description: 'GitHub OAuth Access Token',\n regex: /\\bgho_[A-Za-z0-9_]{36}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'githubServerToServerToken',\n description: 'GitHub Server-to-server Token',\n regex: /\\bghs_[A-Za-z0-9_]{36}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'githubRefreshToken',\n description: 'GitHub Refresh Token',\n regex: /\\bghr_[A-Za-z0-9_]{36}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'githubFineGrainedPersonalAccessToken',\n description: 'GitHub Fine-grained Personal Access Token',\n regex: /\\bgithub_pat_[A-Za-z0-9_]{82}\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'githubPersonalAccessToken',\n description: 'GitHub personal access token',\n regex: /\\bghp_[A-Za-z0-9_]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'githubFineGrainedToken',\n description: 'GitHub fine-grained token',\n regex: /\\bgithub_pat_[0-9a-zA-Z]+_[0-9a-zA-Z]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'githubAppInstallationToken',\n description: 'GitHub app installation token',\n regex: /\\bghs_[0-9a-zA-Z]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'githubRefreshToken',\n description: 'GitHub refresh token',\n regex: /\\bghr_[A-Za-z0-9_]{76}\\b/g,\n matchAccuracy: 'high'\n }\n];\n","import { SensitiveDataPattern } from '../types';\nexport const slackEnhancedPatterns: SensitiveDataPattern[] = [\n {\n name: 'slackAppLevelToken',\n description: 'Slack app-level token',\n regex: /\\bxapp-[0-9]-[a-zA-Z0-9_-]+\\b/g,\n matchAccuracy: 'high'\n },\n {\n name: 'slackGenericToken',\n description: 'Slack Generic Token Pattern',\n regex: /\\b[s|S][l|L][a|A][c|C][k|K].*['|\"][0-9a-zA-Z]{35,44}['|\"]/g,\n matchAccuracy: 'medium'\n }, {\n name: 'slackTokenGeneric',\n description: 'Slack token (generic pattern)',\n regex: /\\bxox(?:a|b|p|o|s|r)-(?:\\d+-)(?:\\d+|\\w+)(?:-\\d+)?/gi,\n matchAccuracy: 'high'\n }\n];\n","import { SensitiveDataPattern } from '../types';\nexport const privateKeyPatterns: SensitiveDataPattern[] = [\n {\n name: 'privateKeyGeneric',\n description: 'Generic Private Key Block',\n regex: /-----BEGIN\\s?((?:DSA|RSA|EC|PGP|OPENSSH|[A-Z]{2,16})?\\s?PRIVATE KEY(\\sBLOCK)?)-----[\\s\\S]{1,10000}?-----END\\s?\\1-----/gm,\n matchAccuracy: 'high'\n },\n {\n name: 'rsaPrivateKey',\n description: 'RSA Private Key',\