sicua
Version:
A tool for analyzing project structure and dependencies
263 lines (262 loc) • 5.43 kB
JavaScript
;
/**
* Constants for sensitive data detection across security analyzers
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.NON_SENSITIVE_TERMS = exports.CLIENT_EXPLICIT_SENSITIVE = exports.CLIENT_HIGH_SENSITIVITY = exports.ENV_SENSITIVE_KEYWORDS = exports.POTENTIAL_SENSITIVE_KEYWORDS = exports.EXPLICIT_SENSITIVE_KEYWORDS = exports.LOW_SENSITIVITY_KEYWORDS = exports.MEDIUM_SENSITIVITY_KEYWORDS = exports.HIGH_SENSITIVITY_KEYWORDS = exports.SENSITIVE_PATTERNS = exports.SENSITIVE_VARIABLE_NAMES = exports.CONSOLE_SENSITIVE_KEYWORDS = exports.SENSITIVE_DATA_KEYWORDS = void 0;
// General sensitive data keywords for multiple detectors
exports.SENSITIVE_DATA_KEYWORDS = [
// Authentication & Authorization
"password",
"passwd",
"pwd",
"passphrase",
"passcode",
"token",
"jwt",
"access_token",
"refresh_token",
"bearer_token",
"auth",
"authentication",
"authorization",
"oauth",
"session",
"sessionid",
"session_token",
"session_key",
// Secrets & Keys
"secret",
"key",
"private_key",
"public_key",
"api_key",
"client_secret",
"client_id",
"webhook_secret",
"signing_key",
"encryption_key",
"decryption_key",
"master_key",
// Personal Information (PII)
"ssn",
"social_security",
"social_security_number",
"credit_card",
"creditcard",
"card_number",
"cc_number",
"cvv",
"cvc",
"pin",
"account_number",
"routing_number",
"license_number",
"passport",
"visa",
"mastercard",
// Sensitive Business Data
"salary",
"income",
"wage",
"financial",
"billing",
"medical",
"health",
"diagnosis",
"treatment",
"patient",
"confidential",
"classified",
"restricted",
"internal",
];
// Console logging specific sensitive keywords
exports.CONSOLE_SENSITIVE_KEYWORDS = [
"password",
"passwd",
"pwd",
"secret",
"token",
"auth",
"api_key",
"apikey",
"private_key",
"privatekey",
"jwt",
"session",
"cookie",
"credit_card",
"creditcard",
"ssn",
"private",
"confidential",
"sensitive",
];
// Hardcoded secret specific sensitive variable names
exports.SENSITIVE_VARIABLE_NAMES = [
// Authentication variables
"password",
"passwd",
"pwd",
"passphrase",
"token",
"jwt",
"access_token",
"refresh_token",
"auth",
"authentication",
"authorization",
"session",
"sessionid",
"session_token",
// API and service keys
"api_key",
"apikey",
"private_key",
"privatekey",
"client_secret",
"client_id",
"webhook_secret",
"encryption_key",
"decryption_key",
"signing_key",
// Database and connection strings
"database_url",
"db_url",
"connection_string",
"db_password",
"db_user",
"db_host",
// Service-specific secrets
"stripe_secret",
"paypal_secret",
"aws_secret",
"github_secret",
"google_secret",
"facebook_secret",
];
// SecurityContext sensitive patterns
exports.SENSITIVE_PATTERNS = [
/password/i,
/secret/i,
/token/i,
/api[_-]?key/i,
/private[_-]?key/i,
/credit[_-]?card/i,
/ssn/i,
/social[_-]?security/i,
/personal[_-]?data/i,
/pii/i,
/encrypt/i,
/decrypt/i,
/hash/i,
/bcrypt/i,
/jwt/i,
];
// High sensitivity data (immediate red flags)
exports.HIGH_SENSITIVITY_KEYWORDS = [
"password",
"secret",
"private_key",
"ssn",
"credit_card",
"cvv",
"passport",
"license_number",
];
// Medium sensitivity data (requires context)
exports.MEDIUM_SENSITIVITY_KEYWORDS = [
"token",
"auth",
"session",
"api_key",
"client_secret",
"jwt",
"oauth",
"webhook",
"signing_key",
];
// Low sensitivity data (context dependent)
exports.LOW_SENSITIVITY_KEYWORDS = [
"user",
"email",
"phone",
"address",
"name",
"id",
"identifier",
"reference",
"code",
];
// Explicit sensitive keywords (high confidence detection)
exports.EXPLICIT_SENSITIVE_KEYWORDS = [
"password",
"secret",
"token",
"private_key",
"api_key",
"client_secret",
"jwt",
"session_token",
"access_token",
];
// Potential sensitive keywords (medium confidence detection)
exports.POTENTIAL_SENSITIVE_KEYWORDS = [
"auth",
"session",
"cookie",
"jwt",
"api",
"client",
"user",
"credential",
"login",
];
// Environment variable sensitive keywords
exports.ENV_SENSITIVE_KEYWORDS = [
"SECRET",
"PASSWORD",
"KEY",
"TOKEN",
"PRIVATE",
"CREDENTIAL",
"AUTH",
"API_KEY",
"WEBHOOK",
];
// Client storage high sensitivity (never store client-side)
exports.CLIENT_HIGH_SENSITIVITY = [
"password",
"secret",
"private_key",
"ssn",
"credit_card",
];
// Client storage explicit sensitive (obvious sensitive data)
exports.CLIENT_EXPLICIT_SENSITIVE = [
"password",
"secret",
"token",
"private_key",
];
exports.NON_SENSITIVE_TERMS = [
"filter",
"filters",
"search",
"sort",
"preference",
"preferences",
"setting",
"settings",
"theme",
"language",
"locale",
"timezone",
"accessibility",
"ui",
"display",
"view",
"layout",
"sidebar",
];