get_security_status
Retrieve current security configuration settings and audit information to monitor and verify storage security policies and access controls.
Instructions
Get current security configuration and audit information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:805-839 (handler)The main handler function executing the tool logic: constructs SecurityStatusResponse using SECURITY_CONFIG, getRateLimitStoreSize(), and getAuditLog() to provide security configuration, rate limit status, recent audit log entries, and server information.// Handler for security status async function handleSecurityStatus() { const auditLog = getAuditLog(); const securityStatus: SecurityStatusResponse = { security_config: SECURITY_CONFIG, rate_limit_status: { active_limits: getRateLimitStoreSize(), current_window: SECURITY_CONFIG.RATE_LIMIT_WINDOW }, audit_log: { total_entries: auditLog.length, recent_entries: auditLog.slice(-10).map(entry => ({ timestamp: new Date(entry.timestamp).toISOString(), tool: entry.toolName, success: entry.success, error: entry.error || 'none' })) }, server_info: { name: 'supabase-storage-mcp', version: '1.0.0', uptime: process.uptime(), node_version: process.version } }; return { content: [ { type: 'text', text: JSON.stringify(securityStatus, null, 2) } ] }; }
- src/index.ts:234-242 (registration)Tool registration in ListToolsRequestSchema handler, defining name, description, and empty input schema.{ name: 'get_security_status', description: 'Get current security configuration and audit information', inputSchema: { type: 'object', properties: {}, additionalProperties: false } },
- src/modules/types.ts:105-126 (schema)TypeScript interface defining the structure of the security status response output.export interface SecurityStatusResponse { security_config: SecurityConfig; rate_limit_status: { active_limits: number; current_window: number; }; audit_log: { total_entries: number; recent_entries: Array<{ timestamp: string; tool: string; success: boolean; error: string; }>; }; server_info: { name: string; version: string; uptime: number; node_version: string; }; }
- src/modules/security.ts:18-49 (helper)Security configuration constant used by the handler for rate limit window and other settings.export const SECURITY_CONFIG: SecurityConfig = { ENABLE_RATE_LIMITING: true, ENABLE_THREAT_DETECTION: true, ENABLE_AUDIT_LOGGING: true, ENABLE_INPUT_VALIDATION: true, ENABLE_FILE_SECURITY: true, // Rate limiting configuration RATE_LIMIT_WINDOW: 60000, // 1 minute MAX_REQUESTS_PER_WINDOW: 100, GLOBAL_RATE_LIMIT: 1000, IP_RATE_LIMIT: 200, USER_RATE_LIMIT: 500, // File security limits MAX_FILE_SIZE: 50 * 1024 * 1024, // 50MB MAX_BATCH_SIZE: 500, ALLOWED_MIME_TYPES: [ 'image/jpeg', 'image/jpg', 'image/png', 'image/webp', 'image/gif', 'image/svg+xml', 'image/bmp', 'image/tiff', 'application/zip', 'application/x-zip-compressed' ], // Security thresholds MAX_PROMPT_LENGTH: 10000, SUSPICIOUS_ACTIVITY_THRESHOLD: 5, HIGH_RISK_SCORE_THRESHOLD: 80, // Session and authentication SESSION_TIMEOUT: 3600, // 1 hour JWT_EXPIRY: 7200 // 2 hours };
- src/modules/security.ts:599-601 (helper)Helper function returning a copy of the audit log entries, used to populate recent audit log in the response.export function getAuditLog(): AuditEntry[] { return [...auditLog]; // Return copy to prevent external modification }