UNPKG

pury

Version:

🛡️ AI-powered security scanner with advanced threat detection, dual reporting system (detailed & summary), and comprehensive code analysis

68 lines 3 kB
import { FindingType } from '../../types/index.js'; export const ANALYSIS_PROMPTS = { [FindingType.MALWARE]: ` Analyze the code for malicious patterns and behaviors: - Obfuscated or encoded strings that could hide malicious intent - Suspicious function calls or imports (eval, exec, child_process, etc.) - Base64 or hex-encoded content that could contain payloads - Code that attempts to download or execute external content - Techniques used to evade detection or analysis - Patterns commonly found in malware, trojans, or backdoors - Suspicious network operations or unusual file system access - Code that appears to be intentionally obscured or minified`, [FindingType.VULNERABILITY]: ` Look for security vulnerabilities and weaknesses: - SQL injection vulnerabilities in database queries - Cross-site scripting (XSS) opportunities - Command injection through user input - Path traversal vulnerabilities - Insecure deserialization - Authentication and authorization bypass - Cryptographic weaknesses or misuse - Input validation failures - Buffer overflow potential - Race conditions and timing attacks`, [FindingType.SECRET]: ` Detect exposed secrets and sensitive information: - API keys, tokens, and authentication credentials - Database passwords and connection strings - Private keys, certificates, and cryptographic secrets - Cloud provider access keys (AWS, GCP, Azure) - OAuth tokens and JWT secrets - Webhook URLs and sensitive endpoints - Personal identifiable information (PII) - Internal system information that should not be exposed - Hardcoded passwords or authentication bypasses`, [FindingType.CODE_QUALITY]: ` Evaluate code quality and best practices: - Debug statements (console.log, print, etc.) that should be removed - Dead code or unreachable code blocks - Code complexity and maintainability issues - Poor error handling or exception management - Performance anti-patterns - Inconsistent coding style or formatting - Missing input validation - Deprecated or outdated library usage - Security best practice violations`, [FindingType.PERFORMANCE]: ` Identify performance issues and optimization opportunities: - Inefficient algorithms or data structures - Memory leaks or excessive memory usage - Blocking operations that could be asynchronous - Unnecessary loops or repeated calculations - Large object creation in loops - Inefficient database queries or N+1 problems - Missing caching opportunities - Resource-intensive operations without optimization - Synchronous file operations that could be async`, [FindingType.LOCALIZATION]: ` Check for internationalization and localization issues: - Hardcoded strings that should be externalized - Non-English text in code comments or variables - Text that needs translation for international users - Date, number, or currency formatting issues - Cultural assumptions in code logic - Character encoding problems - Locale-specific functionality that needs generalization` }; //# sourceMappingURL=index.js.map