|
| 1 | +# Production Readiness Audit Findings |
| 2 | + |
| 3 | +## Status: ALL HIGH-PRIORITY FIXES COMPLETE |
| 4 | + |
| 5 | +## CONSOLIDATED HIGH-PRIORITY FIXES |
| 6 | + |
| 7 | +### FIX-1: useAction migrations (8 instances) |
| 8 | +- vendors/secondary-fields/update-secondary-fields-form.tsx |
| 9 | +- people/[employeeId]/components/EmployeeDetails.tsx |
| 10 | +- policies/[policyId]/components/PdfViewer.tsx (x3) |
| 11 | +- settings/portal/portal-settings.tsx (x4) |
| 12 | + |
| 13 | +### FIX-2: Missing credentials: 'include' (6 instances) |
| 14 | +- vendors/components/create-vendor-form.tsx |
| 15 | +- people/devices/components/PolicyImagePreview.tsx |
| 16 | +- tasks/automation/hooks/use-task-automation-execution.ts |
| 17 | +- tasks/automation/components/model-selector/use-available-models.tsx |
| 18 | +- integrations/components/PlatformIntegrations.tsx |
| 19 | +- questionnaire/hooks/useQuestionnaireParse.ts |
| 20 | + |
| 21 | +### FIX-3: RBAC gaps (3 instances) |
| 22 | +- controls/[controlId]/components/ControlDeleteDialog.tsx — missing usePermissions |
| 23 | +- components/forms/risks/task/update-task-form.tsx — missing usePermissions |
| 24 | +- settings/portal/portal-settings.tsx — missing usePermissions on mutations |
| 25 | + |
| 26 | +### FIX-4: @db in client components (4 SOA files) |
| 27 | +- questionnaire/soa/components/SubmitApprovalDialog.tsx |
| 28 | +- questionnaire/soa/components/SOADocumentInfo.tsx |
| 29 | +- questionnaire/soa/components/SOAPendingApprovalAlert.tsx |
| 30 | +- questionnaire/soa/components/SOAFrameworkTable.tsx |
| 31 | + |
| 32 | +### FIX-5: Type safety |
| 33 | +- components/task-items/TaskItems.tsx — 2x `as any`, missing Array.isArray |
| 34 | + |
| 35 | +### FIX-6: Manual role parsing (5 files) |
| 36 | +- auditor/page.tsx, layout.tsx, TeamMembersClient.tsx, MemberRow.tsx, MultiRoleCombobox.tsx |
| 37 | + |
| 38 | +### DEFERRED (medium priority — DS migration + tests) |
| 39 | +- ~100+ lucide-react icon imports |
| 40 | +- ~200+ @comp/ui imports |
| 41 | +- ~57 missing test files for usePermissions components |
| 42 | + |
| 43 | +--- |
| 44 | + |
| 45 | +## VENDORS + PEOPLE (complete) |
| 46 | + |
| 47 | +### HIGH |
| 48 | +- [ ] HOOKS: `useAction` in `vendors/[vendorId]/components/secondary-fields/update-secondary-fields-form.tsx` (L13,29) |
| 49 | +- [ ] HOOKS: `useAction` in `people/[employeeId]/components/EmployeeDetails.tsx` (L22,58) |
| 50 | +- [ ] HOOKS: Missing `credentials: 'include'` in `vendors/components/create-vendor-form.tsx` (L66) |
| 51 | +- [ ] HOOKS: Missing `credentials: 'include'` in `people/devices/components/PolicyImagePreview.tsx` (L6) |
| 52 | +- [ ] HOOKS: Direct `@db` in `vendors/backup-overview/components/charts/vendors-by-status.tsx` (L2) |
| 53 | +- [ ] HOOKS: Direct `@db` in `vendors/backup-overview/components/charts/vendors-by-category.tsx` (L2) |
| 54 | +- [ ] HOOKS: Direct `@db` in `people/page.tsx` (L5) |
| 55 | +- [ ] HOOKS: Direct `@db` in `people/dashboard/components/EmployeesOverview.tsx` (L3-4) |
| 56 | +- [ ] HOOKS: Direct `@db` in `people/all/components/TeamMembers.tsx` (L6) |
| 57 | + |
| 58 | +### MEDIUM |
| 59 | +- [ ] DS: 22 lucide-react icon imports across vendors + people |
| 60 | +- [ ] TESTS: Missing tests for 10 usePermissions components (VendorsTable, InherentRiskForm, ResidualRiskForm, VendorResidualRiskChart, VendorInherentRiskChart, create-vendor-task-form, VendorPageClient, DeviceDropdownMenu, EmployeeDetails) |
| 61 | +- [ ] DS: Multiple @comp/ui imports that could use DS |
| 62 | + |
| 63 | +--- |
| 64 | + |
| 65 | +## CONTROLS + POLICIES (complete) |
| 66 | + |
| 67 | +### HIGH |
| 68 | +- [ ] HOOKS: `useAction` x3 in `policies/[policyId]/components/PdfViewer.tsx` (L31,73,99,112) — getPolicyPdfUrl, upload, delete |
| 69 | +- [ ] RBAC: Manual role parsing in `policies/[policyId]/page.tsx` (L75-76) — `role.includes('employee')` |
| 70 | +- [ ] RBAC: Missing permission check on `controls/[controlId]/components/ControlDeleteDialog.tsx` (L75-76) — no usePermissions |
| 71 | + |
| 72 | +### MEDIUM |
| 73 | +- [ ] DS: 11 files with lucide-react icons (controls + policies) |
| 74 | +- [ ] DS: 6+ files with @comp/ui imports (Button, Dialog, Dropdown, Badge) |
| 75 | +- [ ] DS: 3 Badge components with className that DS doesn't support |
| 76 | +- [ ] TESTS: Missing tests for 8 usePermissions components (UpdatePolicyOverview, PublishVersionDialog, PolicyPageTabs, PolicyVersionsTab, PolicyAlerts, PolicyArchiveSheet, PolicyControlMappings, PolicyDetails, PolicyDeleteDialog) |
| 77 | +## TASKS + RISK (complete) |
| 78 | + |
| 79 | +### HIGH |
| 80 | +- [ ] HOOKS: Missing `credentials: 'include'` in `tasks/[taskId]/automation/[automationId]/hooks/use-task-automation-execution.ts` (L56) |
| 81 | +- [ ] HOOKS: Missing `credentials: 'include'` in `tasks/[taskId]/automation/[automationId]/components/model-selector/use-available-models.tsx` (L27) |
| 82 | + |
| 83 | +### MEDIUM |
| 84 | +- [ ] TESTS: Missing tests for 6 usePermissions components (FindingsList, BrowserAutomationsList, CreateFindingSheet, SingleTask, RiskPageClient, RisksTable) |
| 85 | +- [ ] DS: 40+ lucide-react icon imports across tasks + risk |
| 86 | +- [ ] DS: 70+ @comp/ui imports that could use DS |
| 87 | + |
| 88 | +### CLEAN |
| 89 | +- RBAC: All mutation elements properly gated |
| 90 | +- No useAction usage |
| 91 | +- No @db in client components (type-only) |
| 92 | +- Array.isArray checks present |
| 93 | +## FRAMEWORKS + INTEGRATIONS (complete) |
| 94 | + |
| 95 | +### HIGH |
| 96 | +- [ ] HOOKS: Missing `credentials: 'include'` in `integrations/components/PlatformIntegrations.tsx` (L294) |
| 97 | + |
| 98 | +### MEDIUM |
| 99 | +- [ ] DS: 11 files with lucide-react icons |
| 100 | +- [ ] TESTS: Missing tests for 3 usePermissions components (AddFrameworkModal, ToDoOverview, FrameworkDeleteDialog, PlatformIntegrations) |
| 101 | + |
| 102 | +### CLEAN |
| 103 | +- RBAC: All mutation elements properly gated |
| 104 | +- No useAction, no @db in client components |
| 105 | +- No apiClient 3rd arg issues |
| 106 | +## QUESTIONNAIRE + SETTINGS (complete) |
| 107 | + |
| 108 | +### HIGH |
| 109 | +- [ ] HOOKS: `useAction` x4 in `settings/portal/portal-settings.tsx` (L24,29,34,39) — deviceAgent, securityTraining, whistleblower, accessRequestForm |
| 110 | +- [ ] RBAC: Missing usePermissions on `settings/portal/portal-settings.tsx` mutations |
| 111 | +- [ ] HOOKS: Missing `credentials: 'include'` in `questionnaire/hooks/useQuestionnaireParse.ts` (L45) |
| 112 | +- [ ] HOOKS: `@db` import (non-type) in 4 client components: `questionnaire/soa/components/SubmitApprovalDialog.tsx`, `SOADocumentInfo.tsx`, `SOAPendingApprovalAlert.tsx`, `SOAFrameworkTable.tsx` |
| 113 | + |
| 114 | +### MEDIUM |
| 115 | +- [ ] HOOKS: Direct `@db` in `settings/page.tsx` and `settings/portal/page.tsx` (server components, should use serverApi) |
| 116 | +- [ ] TESTS: Missing tests for 12 usePermissions components (2 questionnaire + 10 settings) |
| 117 | +- [ ] DS: 83 @comp/ui imports across questionnaire + settings |
| 118 | +- [ ] DS: 31 lucide-react icon imports |
| 119 | +- [ ] STYLE: `AdditionalDocumentsSection.tsx` exceeds 300 lines (447) |
| 120 | +## SHARED COMPONENTS + HOOKS (complete) |
| 121 | + |
| 122 | +### HIGH |
| 123 | +- [ ] RBAC: Missing usePermissions on `components/forms/risks/task/update-task-form.tsx` — no permission gate on task mutation form |
| 124 | +- [ ] TYPE: 2x `as any` casts in `components/task-items/TaskItems.tsx` (L97,99) |
| 125 | +- [ ] HOOKS: Missing `Array.isArray()` on members in `components/task-items/TaskItems.tsx` (L74) |
| 126 | + |
| 127 | +### MEDIUM |
| 128 | +- [ ] DS: 10 files with lucide-react icons in components/ |
| 129 | +- [ ] TESTS: Missing tests for 8 usePermissions components (transfer-ownership, update-org-advanced-mode, update-org-evidence-approval, update-org-logo, create-new-policy, update-policy-form, TaskItemFocusView, TaskItemsHeader) |
| 130 | +## API ROUTES + ACTIONS (complete) |
| 131 | + |
| 132 | +### HIGH |
| 133 | +- [ ] HOOKS: Missing `credentials: 'include'` in `app/api/training/certificate/route.ts` (L68) |
| 134 | +- [ ] SECURITY: `app/api/user-frameworks/route.ts` — weak string comparison for SECRET_KEY, no rate limiting |
| 135 | +- [ ] SECURITY: `app/api/frameworks/route.ts` — no authentication on GET endpoint |
| 136 | +- [ ] SECURITY: QA/Retool endpoints use plain string comparison (not timing-safe) for secrets |
| 137 | + |
| 138 | +### MEDIUM |
| 139 | +- [ ] SECURITY: Hardcoded test password `Test123456!` in `auth/test-login/route.ts` (L50) |
| 140 | +- [ ] SECURITY: Test endpoints return raw error details |
| 141 | +## AUDITOR + LAYOUT + MISC (complete) |
| 142 | + |
| 143 | +### HIGH |
| 144 | +- [ ] TESTS: Missing tests for 10 usePermissions components in trust portal (TrustSettingsClient, TrustPortalSwitch, TrustPortalCustomLinks, TrustPortalFaqBuilder, TrustPortalAdditionalDocumentsSection, BrandSettings, TrustPortalDomain, AllowedDomainsManager, TrustPortalOverview, TrustPortalVendors) |
| 145 | + |
| 146 | +### MEDIUM |
| 147 | +- [ ] RBAC: Manual role parsing in 5 files (auditor/page.tsx, layout.tsx, TeamMembersClient.tsx, MemberRow.tsx, MultiRoleCombobox.tsx) — should centralize via permissions lib |
| 148 | +- [ ] DS: 4 files with lucide-react icons (AuditorView, TrustPortalSwitch, TrustPortalCustomLinks, AppShellRailNav) |
| 149 | +- [ ] DS: 9 files mixing @comp/ui with DS in trust portal settings |
| 150 | +- [ ] HOOKS: Server action in `trust/portal-settings/actions/check-dns-record.ts` bypasses audit logs |
0 commit comments