main
ts 535 lines 13.3 KB
Raw
1 import type { FormType } from "@/components/auth/types.d"
2 import { createRouter, createWebHistory } from "vue-router"
3 import { AuthUserRole, RouteRole } from "@/types/auth.d"
4 import { Layout } from "@/types/theme.d"
5 import { authCheck } from "@/utils/auth"
6 import AuthPage from "@/views/Auth.vue"
7 import OverviewPage from "@/views/Overview.vue"
8
9 // TODO-FE: refactor
10 const router = createRouter({
11 history: createWebHistory(import.meta.env.BASE_URL),
12 routes: [
13 {
14 path: "/",
15 redirect: "/overview"
16 },
17 {
18 path: "/overview",
19 name: "Overview",
20 component: OverviewPage,
21 meta: { title: "Overview", auth: true, roles: RouteRole.All }
22 },
23 {
24 path: "/indices",
25 redirect: "/indices/management",
26 meta: {
27 auth: true,
28 roles: RouteRole.All
29 },
30 children: [
31 {
32 path: "management",
33 name: "Indices",
34 component: () => import("@/views/Indices.vue"),
35 meta: { title: "Index Management" }
36 },
37 {
38 path: "snapshots",
39 name: "Snapshots",
40 component: () => import("@/views/Snapshots.vue"),
41 meta: { title: "Snapshot & Restore" }
42 }
43 ]
44 },
45 {
46 path: "/connectors",
47 name: "Connectors",
48 component: () => import("@/views/Connectors.vue"),
49 meta: { title: "Connectors", auth: true, roles: RouteRole.All }
50 },
51 {
52 path: "/agents",
53 meta: {
54 auth: true,
55 roles: RouteRole.All
56 },
57 children: [
58 {
59 path: "",
60 name: "Agents",
61 component: () => import("@/views/agents/Agents.vue"),
62 meta: { title: "Agents" }
63 },
64 {
65 path: ":id",
66 name: "Agent",
67 component: () => import("@/views/agents/Overview.vue"),
68 meta: { title: "Agent", skipPin: true }
69 },
70 {
71 path: "sysmon-config",
72 name: "SysmonConfig",
73 component: () => import("@/views/agents/SysmonConfig.vue"),
74 meta: { title: "Sysmon Config" }
75 },
76 {
77 path: "detection-rules",
78 name: "DetectionRules",
79 component: () => import("@/views/agents/DetectionRules.vue"),
80 meta: { title: "Detection Rules" }
81 },
82 {
83 path: "groups",
84 name: "Groups",
85 component: () => import("@/views/agents/Groups.vue"),
86 meta: { title: "Groups" }
87 },
88 {
89 path: "copilot-actions",
90 name: "CopilotActions",
91 component: () => import("@/views/agents/CopilotActions.vue"),
92 meta: { title: "CoPilot Actions" }
93 },
94 {
95 path: "/copilot-searches",
96 name: "CopilotSearches",
97 component: () => import("@/views/agents/CopilotSearches.vue"),
98 meta: {
99 title: "CoPilot Searches"
100 }
101 },
102 {
103 path: "vulnerability-overview",
104 name: "VulnerabilityOverview",
105 component: () => import("@/views/agents/VulnerabilityOverview.vue"),
106 meta: { title: "Vulnerability Overview" }
107 },
108 {
109 path: "sca-overview",
110 name: "ScaOverview",
111 component: () => import("@/views/agents/ScaOverview.vue"),
112 meta: { title: "SCA Overview" }
113 },
114 {
115 path: "sca-policies",
116 name: "ScaPolicies",
117 component: () => import("@/views/agents/ScaPolicies.vue"),
118 meta: { title: "SCA Policies" }
119 },
120 {
121 path: "/patch-tuesday",
122 name: "PatchTuesday",
123 component: () => import("@/views/agents/PatchTuesdayOverview.vue"),
124 meta: { title: "Patch Tuesday" }
125 }
126 ]
127 },
128 {
129 path: "/graylog",
130 redirect: "/graylog/management",
131 meta: {
132 auth: true,
133 roles: RouteRole.All
134 },
135 children: [
136 {
137 path: "management",
138 name: "Graylog-Management",
139 component: () => import("@/views/graylog/Management.vue"),
140 meta: { title: "Graylog Management" }
141 },
142 {
143 path: "metrics",
144 name: "Graylog-Metrics",
145 component: () => import("@/views/graylog/Metrics.vue"),
146 meta: { title: "Graylog Metrics" }
147 },
148 {
149 path: "pipelines",
150 name: "Graylog-Pipelines",
151 component: () => import("@/views/graylog/Pipelines.vue"),
152 meta: { title: "Graylog Pipelines" }
153 }
154 ]
155 },
156 {
157 path: "/alerts",
158 redirect: "/alerts/siem",
159 meta: {
160 auth: true,
161 roles: RouteRole.All
162 },
163 children: [
164 {
165 path: "siem",
166 name: "Alerts-SIEM",
167 component: () => import("@/views/alerts/AlertsGraylog.vue"),
168 meta: { title: "SIEM" }
169 },
170 {
171 path: "mitre",
172 name: "Alerts-Mitre",
173 component: () => import("@/views/alerts/Mitre.vue"),
174 meta: { title: "MITRE ATT&CK" }
175 },
176 {
177 path: "atomic-red-team",
178 name: "Alerts-AtomicRedTeam",
179 component: () => import("@/views/alerts/AtomicRedTeam.vue"),
180 meta: { title: "Atomic Red Team" }
181 }
182 ]
183 },
184 {
185 path: "/event-search",
186 name: "EventSearch",
187 component: () => import("@/views/EventSearch.vue"),
188 meta: { title: "Event Search", auth: true, roles: RouteRole.All }
189 },
190 {
191 path: "/dashboards",
192 name: "Dashboards",
193 component: () => import("@/views/Dashboards.vue"),
194 meta: { title: "Dashboards", auth: true, roles: RouteRole.All }
195 },
196 {
197 path: "/dashboards/:id",
198 name: "DashboardView",
199 component: () => import("@/views/DashboardView.vue"),
200 meta: { title: "Dashboard Viewer", auth: true, roles: RouteRole.All }
201 },
202 {
203 path: "/artifacts",
204 name: "Artifacts",
205 component: () => import("@/views/Artifacts.vue"),
206 meta: { title: "Artifacts", auth: true, roles: RouteRole.All }
207 },
208 /*
209 {
210 path: "/soc",
211 redirect: "/soc/alerts",
212 meta: {
213 auth: true,
214 roles: RouteRole.All
215 },
216 children: [
217 {
218 path: "alerts",
219 name: "Soc-Alerts",
220 component: () => import("@/views/soc/Alerts.vue"),
221 meta: { title: "SOC Alerts" }
222 },
223 {
224 path: "cases",
225 name: "Soc-Cases",
226 component: () => import("@/views/soc/Cases.vue"),
227 meta: { title: "SOC Cases" }
228 },
229 {
230 path: "users",
231 name: "Soc-Users",
232 component: () => import("@/views/soc/Users.vue"),
233 meta: { title: "SOC Users" }
234 },
235 {
236 path: "pending-alerts",
237 name: "Soc-PendingAlerts",
238 component: () => import("@/views/soc/PendingAlerts.vue"),
239 meta: { title: "SOC Pending Alerts" }
240 }
241 ]
242 },
243 */
244 {
245 path: "/incident-management",
246 redirect: "/incident-management/alerts",
247 meta: {
248 auth: true,
249 roles: RouteRole.All
250 },
251 children: [
252 {
253 path: "sources",
254 name: "IncidentManagement-Sources",
255 component: () => import("@/views/incidentManagement/Sources.vue"),
256 meta: { title: "Incident Sources" }
257 },
258 {
259 path: "alerts",
260 name: "IncidentManagement-Alerts",
261 component: () => import("@/views/incidentManagement/Alerts.vue"),
262 meta: { title: "Incident Alerts" }
263 },
264 {
265 path: "cases",
266 name: "IncidentManagement-Cases",
267 component: () => import("@/views/incidentManagement/Cases.vue"),
268 meta: { title: "Incident Cases" }
269 },
270 {
271 path: "case-templates",
272 name: "IncidentManagement-CaseTemplates",
273 component: () => import("@/views/incidentManagement/CaseTemplates.vue"),
274 meta: {
275 title: "Case Templates",
276 // Admin/analyst only — templates are SOC-team-managed playbooks.
277 roles: [AuthUserRole.Admin, AuthUserRole.Analyst]
278 }
279 },
280 {
281 path: "sigma",
282 name: "IncidentManagement-Sigma",
283 component: () => import("@/views/incidentManagement/Sigma.vue"),
284 meta: { title: "Sigma rules" }
285 }
286 ]
287 },
288 {
289 path: "/ai-analyst",
290 name: "AiAnalyst",
291 component: () => import("@/views/AiAnalyst.vue"),
292 meta: { title: "AI Analyst", auth: true, roles: RouteRole.All }
293 },
294 {
295 path: "/detection-catalog",
296 name: "DetectionCatalog",
297 component: () => import("@/views/DetectionCatalog.vue"),
298 meta: { title: "Detections Catalog", auth: true, roles: RouteRole.All }
299 },
300 {
301 path: "/healthcheck",
302 redirect: "/healthcheck/alerts",
303 meta: {
304 auth: true,
305 roles: RouteRole.All
306 },
307 children: [
308 {
309 path: "alerts",
310 name: "Healthcheck",
311 component: () => import("@/views/Healthcheck.vue"),
312 meta: { title: "Healthcheck Alerts" }
313 },
314 {
315 path: "metrics",
316 name: "Metrics",
317 component: () => import("@/views/Metrics.vue"),
318 meta: { title: "Metrics Overview" }
319 }
320 ]
321 },
322 {
323 path: "/customers",
324 name: "Customers",
325 component: () => import("@/views/Customers.vue"),
326 meta: { title: "Customers", auth: true, roles: RouteRole.All }
327 },
328 {
329 path: "/logs",
330 name: "Logs",
331 component: () => import("@/views/Logs.vue"),
332 meta: { title: "Logs", auth: true, roles: RouteRole.All }
333 },
334 {
335 path: "/users",
336 name: "Users",
337 component: () => import("@/views/Users.vue"),
338 meta: { title: "Users", auth: true, roles: RouteRole.All }
339 },
340 {
341 path: "/external-services",
342 redirect: "/external-services/third-party-integrations",
343 meta: {
344 auth: true,
345 roles: RouteRole.All
346 },
347 children: [
348 {
349 path: "third-party-integrations",
350 name: "ExternalServices-ThirdPartyIntegrations",
351 component: () => import("@/views/externalServices/ThirdPartyIntegrations.vue"),
352 meta: { title: "Third Party Integrations" }
353 },
354 {
355 path: "network-connectors",
356 name: "ExternalServices-NetworkConnectors",
357 component: () => import("@/views/externalServices/NetworkConnectors.vue"),
358 meta: { title: "Network Connectors" }
359 },
360 {
361 path: "shuffle-app-auth",
362 name: "ExternalServices-ShuffleAppAuth",
363 component: () => import("@/views/externalServices/ShuffleAppAuth.vue"),
364 meta: { title: "Shuffle App Auth" }
365 }
366 ]
367 },
368 // {
369 // path: "/report-creation",
370 // name: "ReportCreation",
371 // component: () => import("@/views/ReportCreation.vue"),
372 // meta: { title: "Report Creation", auth: true, roles: RouteRole.All }
373 // },
374 {
375 path: "/report-creation",
376 redirect: "/report-creation/general",
377 meta: {
378 auth: true,
379 roles: RouteRole.All
380 },
381 children: [
382 {
383 path: "general",
384 name: "ReportCreation",
385 component: () => import("@/views/ReportCreation.vue"),
386 meta: { title: "General Reports" }
387 },
388 {
389 path: "vulnerability-reports",
390 name: "VulnerabilityReports",
391 component: () => import("@/components/vulnerabilities/VulnerabilityReports.vue"),
392 meta: { title: "Vulnerability Reports" }
393 },
394 {
395 path: "sca-reports",
396 name: "SCAReports",
397 component: () => import("@/components/sca/SCAReports.vue"),
398 meta: { title: "SCA Reports" }
399 }
400 ]
401 },
402 {
403 path: "/scheduler",
404 name: "Scheduler",
405 component: () => import("@/views/Scheduler.vue"),
406 meta: { title: "Scheduler", auth: true, roles: RouteRole.All }
407 },
408 {
409 path: "/cloud-security-assessment",
410 name: "CloudSecurityAssessment",
411 component: () => import("@/views/CloudSecurityAssessment.vue"),
412 meta: { title: "Cloud Sec. Assess.", auth: true, roles: RouteRole.All }
413 },
414 {
415 path: "/web-vulnerability-assessment",
416 name: "WebVulnerabilityAssessment",
417 component: () => import("@/views/WebVulnerabilityAssessment.vue"),
418 meta: { title: "Web Vuln. Assess.", auth: true, roles: RouteRole.All }
419 },
420 {
421 path: "/github-audit",
422 name: "GitHubAudit",
423 component: () => import("@/views/GitHubAuditOverview.vue"),
424 meta: {
425 title: "GitHub Audit",
426 auth: true,
427 roles: RouteRole.All
428 }
429 },
430 {
431 path: "/customer-portal",
432 name: "CustomerPortal",
433 component: () => import("@/views/CustomerPortal.vue"),
434 meta: { title: "Customer Portal", auth: true, roles: RouteRole.All }
435 },
436 {
437 path: "/license",
438 meta: {
439 auth: true,
440 roles: RouteRole.All
441 },
442 children: [
443 {
444 path: "",
445 name: "License",
446 component: () => import("@/views/license/License.vue"),
447 meta: { title: "License" }
448 },
449 {
450 path: "success",
451 name: "LicenseSuccess",
452 component: () => import("@/views/license/Success.vue"),
453 meta: { title: "License Success", skipPin: true }
454 },
455 {
456 path: "cancel",
457 name: "LicenseCancel",
458 component: () => import("@/views/license/Cancel.vue"),
459 meta: { title: "License Cancel", skipPin: true }
460 }
461 ]
462 },
463 {
464 path: "/sso-config",
465 name: "SSOConfig",
466 component: () => import("@/views/SSOConfig.vue"),
467 meta: { title: "SSO Config", auth: true, roles: RouteRole.All }
468 },
469
470 {
471 path: "/profile",
472 name: "Profile",
473 component: () => import("@/views/Profile.vue"),
474 meta: { title: "Profile", auth: true, roles: RouteRole.All }
475 },
476 {
477 path: "/login",
478 name: "Login",
479 component: AuthPage,
480 props: { formType: "signin" as FormType },
481 meta: {
482 title: "Login",
483 theme: { layout: Layout.Blank, boxed: { enabled: false }, padded: { enabled: false } },
484 checkAuth: true,
485 skipPin: true
486 }
487 },
488 {
489 path: "/sso-callback",
490 name: "SSOCallback",
491 component: AuthPage,
492 props: { formType: "signin" as FormType },
493 meta: {
494 title: "SSO Login",
495 theme: { layout: Layout.Blank, boxed: { enabled: false }, padded: { enabled: false } },
496 checkAuth: true,
497 skipPin: true
498 }
499 },
500 /*
501 {
502 path: "/register",
503 name: "Register",
504 component: AuthPage,
505 props: { formType: "signup" as FormType },
506 meta: {
507 title: "Register",
508 theme: { layout: Layout.Blank, boxed: { enabled: false }, padded: { enabled: false } },
509 checkAuth: true,
510 skipPin: true
511 }
512 },
513 */
514 {
515 path: "/logout",
516 name: "Logout",
517 redirect: "/login"
518 },
519 {
520 path: "/:pathMatch(.*)*",
521 name: "NotFound",
522 component: () => import("@/views/NotFound.vue"),
523 meta: {
524 theme: { layout: Layout.Blank, boxed: { enabled: false }, padded: { enabled: false } },
525 skipPin: true
526 }
527 }
528 ]
529 })
530
531 router.beforeEach(route => {
532 return authCheck(route)
533 })
534
535 export default router