-
Notifications
You must be signed in to change notification settings - Fork 75
Expand file tree
/
Copy pathguide-soc-ai.component.html
More file actions
173 lines (163 loc) · 8.71 KB
/
Copy pathguide-soc-ai.component.html
File metadata and controls
173 lines (163 loc) · 8.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<div class="w-100 h-100">
<div class="card-header d-flex justify-content-between align-items-center">
<h4 class="card-title mb-0 text-primary">SOC AI</h4>
</div>
<div class="card-body">
<p class="mb-4">
SOC AI enhances your security operations by integrating advanced language models directly into your alert investigation workflow.
It automatically analyzes alerts, identifies patterns, prioritizes threats, and provides actionable insights to accelerate incident response.
Connect any of the supported AI providers below to get started.
If your provider is not listed, you can use the <strong>Custom</strong> tab to configure any service that supports the OpenAI-compatible chat completions format.
</p>
<div *ngIf="loading" class="d-flex justify-content-center p-5">
<app-utm-spinner [loading]="true" label="Loading configuration..."></app-utm-spinner>
</div>
<ng-container *ngIf="!loading">
<!-- Provider tabs -->
<ngb-tabset [activeId]="activeProvider" (tabChange)="onTabChange($event)">
<ngb-tab *ngFor="let provider of providers" [id]="provider.id">
<ng-template ngbTabTitle>
<img [src]="provider.logo" [alt]="provider.name" class="provider-logo mr-1">
{{ provider.name }}
</ng-template>
<ng-template ngbTabContent>
<div class="mt-3">
<!-- Provider description -->
<p class="step-guide mb-4" [innerHTML]="provider.description"></p>
<!-- Dynamic fields -->
<div class="row">
<ng-container *ngFor="let field of provider.fields">
<!-- Text / Password / Number inputs -->
<div *ngIf="field.type === 'text' || field.type === 'password' || field.type === 'number'"
class="col-lg-6 col-md-12 mb-3">
<label class="pb-1 d-flex justify-content-between align-items-center">
<span>
<i [ngClass]="field.required && !formValues[field.key] ? 'text-danger' : 'text-success'"
class="icon-circle2 mr-1"></i>
{{ field.label }}
</span>
<i *ngIf="field.tooltip" [ngbTooltip]="field.tooltip"
class="icon-question3 text-primary" placement="auto"></i>
</label>
<input [type]="field.type"
[(ngModel)]="formValues[field.key]"
[placeholder]="field.placeholder || ''"
[required]="field.required"
class="form-control">
<small *ngIf="field.required && !formValues[field.key]" class="text-danger">
{{ field.label }} is required
</small>
</div>
<!-- Select -->
<div *ngIf="field.type === 'select'" class="col-lg-6 col-md-12 mb-3">
<label class="pb-1 d-flex justify-content-between align-items-center">
<span>
<i [ngClass]="field.required && !formValues[field.key] ? 'text-danger' : 'text-success'"
class="icon-circle2 mr-1"></i>
{{ field.label }}
</span>
<i *ngIf="field.tooltip" [ngbTooltip]="field.tooltip"
class="icon-question3 text-primary" placement="auto"></i>
</label>
<ng-select *ngIf="formValues[field.key] !== '__custom__'"
[items]="field.options"
bindLabel="label"
bindValue="value"
[(ngModel)]="formValues[field.key]"
[clearable]="false"
[searchable]="false"
[placeholder]="'Select ' + field.label">
</ng-select>
<div *ngIf="formValues[field.key] === '__custom__'" class="input-group">
<input type="text"
[(ngModel)]="customModelValue"
placeholder="Enter model name"
class="form-control">
<div class="input-group-append">
<button class="btn btn-outline-secondary" type="button"
(click)="formValues[field.key] = ''">
<i class="icon-arrow-left32"></i>
</button>
</div>
</div>
<small *ngIf="field.required && !formValues[field.key] && formValues[field.key] !== '__custom__'" class="text-danger">
{{ field.label }} is required
</small>
</div>
<!-- Headers table -->
<div *ngIf="field.type === 'headers' && formValues['authType'] !== 'none'" class="col-12 mb-3">
<label class="pb-1">
<i class="icon-circle2 mr-1 text-success"></i>
{{ field.label }}
</label>
<table class="table table-sm table-bordered mb-2">
<thead>
<tr class="bg-light">
<th style="width: 35%">Header Name</th>
<th>Header Value</th>
<th style="width: 50px"></th>
</tr>
</thead>
<tbody>
<tr *ngFor="let row of headerRows; let i = index">
<td>
<input type="text" [(ngModel)]="row.key"
(ngModelChange)="syncHeadersToForm()"
placeholder="e.g. Authorization"
class="form-control form-control-sm">
</td>
<td>
<input type="text" [(ngModel)]="row.value"
(ngModelChange)="syncHeadersToForm()"
placeholder="e.g. Bearer sk-xxx"
class="form-control form-control-sm">
</td>
<td class="text-center">
<i class="icon-cross2 cursor-pointer text-danger"
(click)="removeHeaderRow(i)"
ngbTooltip="Remove header"></i>
</td>
</tr>
<tr *ngIf="headerRows.length === 0">
<td colspan="3" class="text-center text-muted py-2">
No headers configured. Click "Add Header" to add one.
</td>
</tr>
</tbody>
</table>
<button class="btn btn-sm utm-button utm-button-primary" (click)="addHeaderRow()">
<i class="icon-plus2 mr-1"></i> Add Header
</button>
</div>
<!-- Toggle -->
<div *ngIf="field.type === 'toggle'" class="col-lg-6 col-md-12 mb-3">
<app-utm-toggle
[active]="formValues[field.key] === 'true'"
[label]="field.label"
[emitAtStart]="false"
(toggleChange)="onToggle(field.key, $event)">
</app-utm-toggle>
</div>
</ng-container>
</div>
<!-- Save & Activate -->
<div class="d-flex justify-content-end align-items-center mt-3 border-top pt-3">
<button class="btn utm-button utm-button-primary" (click)="save()"
[disabled]="!isFormValid() || saving">
<i [ngClass]="saving ? 'icon-spinner2 spinner' : 'icon-cog5'" class="mr-1"></i>
Save configuration
</button>
<app-app-module-activate-button [module]="module.SOC_AI" [type]="'integration'"
[disabled]="!configReady"
[serverId]="serverId"
(disableModuleClicked)="disableModule()"
class="ml-2">
</app-app-module-activate-button>
</div>
</div>
</ng-template>
</ngb-tab>
</ngb-tabset>
</ng-container>
</div>
</div>