Skip to content

Commit 77116d8

Browse files
committed
feat(alert): add new fields for Host and User in alert display
Signed-off-by: Manuel Abascal <mjabascal10@gmail.com>
1 parent 43defbc commit 77116d8

5 files changed

Lines changed: 32 additions & 13 deletions

File tree

Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="d-flex align-items-center mr-1 mb-1">
22
<span [ngbTooltip]="tooltip" class="badge bg-primary-300 d-flex align-items-center justify-content-center py-1 px-2">
3-
<i [ngClass]="iconClass" class="mr-1 font-size-sm"></i>
3+
<i [ngClass]="iconClass" class="mr-1 font-size-sm top-0"></i>
44
{{ value }}
55
</span>
66
</div>

frontend/src/app/data-management/alert-management/shared/components/alert-entity-display/alert-entity-display.component.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
<div *ngIf="isInclude(field.field, [ALERT_TARGET_BYTES_SENT_FIELD ,ALERT_ADVERSARY_BYTES_SENT_FIELD])">
66
<app-alert-badge-field [tooltip]="'Bytes sent'" [iconClass]="'icon-arrow-up-right2'" [value]="getValue(field.field)"></app-alert-badge-field>
77
</div>
8+
<div *ngIf="isInclude(field.field, [ALERT_TARGET_HOST_FIELD ,ALERT_ADVERSARY_HOST_FIELD])">
9+
<app-alert-badge-field [tooltip]="'Host'" [iconClass]="'icon-display'" [value]="getValue(field.field)"></app-alert-badge-field>
10+
</div>
11+
<div *ngIf="isInclude(field.field, [ALERT_ADVERSARY_USER_FIELD ,ALERT_TARGET_USER_FIELD])">
12+
<app-alert-badge-field [tooltip]="'User'" [iconClass]="'icon-user'" [value]="getValue(field.field)"></app-alert-badge-field>
13+
</div>
814
<div *ngIf="isInclude(field.field, [ALERT_TARGET_URL_FIELD ,ALERT_ADVERSARY_URL_FIELD])">
915
<app-alert-badge-field [tooltip]="'Url'" [iconClass]="'icon-link'" [value]="getValue(field.field)"></app-alert-badge-field>
1016
</div>
@@ -23,6 +29,12 @@
2329
<div *ngIf="isInclude(field.field, [ALERT_TARGET_GEOLOCATION_ASO_FIELD, ALERT_ADVERSARY_GEOLOCATION_ASO_FIELD])">
2430
<app-alert-badge-field [tooltip]="'Aso'" [iconClass]="'icon-briefcase'" [value]="getValue(field.field)"></app-alert-badge-field>
2531
</div>
32+
<div *ngIf="isInclude(field.field, [ALERT_TARGET_GEOLOCATION_ASO_FIELD, ALERT_ADVERSARY_GEOLOCATION_ASO_FIELD])">
33+
<app-alert-badge-field [tooltip]="'Aso'" [iconClass]="'icon-briefcase'" [value]="getValue(field.field)"></app-alert-badge-field>
34+
</div>
35+
<div *ngIf="isInclude(field.field, [ALERT_TARGET_GEOLOCATION_ASO_FIELD, ALERT_ADVERSARY_GEOLOCATION_ASO_FIELD])">
36+
<app-alert-badge-field [tooltip]="'Aso'" [iconClass]="'icon-briefcase'" [value]="getValue(field.field)"></app-alert-badge-field>
37+
</div>
2638
<app-alert-ip *ngIf="isInclude(field.field, [ALERT_TARGET_IP_FIELD ,ALERT_ADVERSARY_IP_FIELD])" [alert]="alert" [type]="type"></app-alert-ip>
2739
</ng-container>
2840
</div>

frontend/src/app/data-management/alert-management/shared/components/alert-entity-display/alert-entity-display.component.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ import {Component, Input, OnChanges, OnInit, SimpleChanges} from '@angular/core'
22
import {
33
ALERT_ADVERSARY_BYTES_SENT_FIELD,
44
ALERT_ADVERSARY_DOMAIN_FIELD, ALERT_ADVERSARY_GEOLOCATION_ASN_FIELD, ALERT_ADVERSARY_GEOLOCATION_ASO_FIELD,
5-
ALERT_ADVERSARY_GEOLOCATION_LATITUDE_FIELD, ALERT_ADVERSARY_GEOLOCATION_LONGITUDE_FIELD,
5+
ALERT_ADVERSARY_GEOLOCATION_LATITUDE_FIELD, ALERT_ADVERSARY_GEOLOCATION_LONGITUDE_FIELD, ALERT_ADVERSARY_HOST_FIELD,
66
ALERT_ADVERSARY_IP_FIELD,
7-
ALERT_ADVERSARY_URL_FIELD,
7+
ALERT_ADVERSARY_URL_FIELD, ALERT_ADVERSARY_USER_FIELD,
88
ALERT_TARGET_BYTES_SENT_FIELD,
99
ALERT_TARGET_DOMAIN_FIELD,
1010
ALERT_TARGET_FIELD, ALERT_TARGET_GEOLOCATION_ASN_FIELD, ALERT_TARGET_GEOLOCATION_ASO_FIELD,
1111
ALERT_TARGET_GEOLOCATION_LATITUDE_FIELD,
12-
ALERT_TARGET_GEOLOCATION_LONGITUDE_FIELD,
12+
ALERT_TARGET_GEOLOCATION_LONGITUDE_FIELD, ALERT_TARGET_HOST_FIELD,
1313
ALERT_TARGET_IP_FIELD,
14-
ALERT_TARGET_URL_FIELD
14+
ALERT_TARGET_URL_FIELD, ALERT_TARGET_USER_FIELD
1515
} from '../../../../../shared/constants/alert/alert-field.constant';
1616
import {UtmAlertType} from '../../../../../shared/types/alert/utm-alert.type';
1717
import {UtmFieldType} from '../../../../../shared/types/table/utm-field.type';
@@ -32,6 +32,10 @@ export class AlertEntityDisplayComponent implements OnInit, OnChanges {
3232
ALERT_TARGET_URL_FIELD = ALERT_TARGET_URL_FIELD;
3333
ALERT_TARGET_DOMAIN_FIELD = ALERT_TARGET_DOMAIN_FIELD;
3434
ALERT_ADVERSARY_DOMAIN_FIELD = ALERT_ADVERSARY_DOMAIN_FIELD;
35+
ALERT_ADVERSARY_HOST_FIELD = ALERT_ADVERSARY_HOST_FIELD;
36+
ALERT_ADVERSARY_USER_FIELD = ALERT_ADVERSARY_USER_FIELD;
37+
ALERT_TARGET_USER_FIELD = ALERT_TARGET_USER_FIELD;
38+
ALERT_TARGET_HOST_FIELD = ALERT_TARGET_HOST_FIELD;
3539
ALERT_TARGET_GEOLOCATION_LATITUDE_FIELD = ALERT_TARGET_GEOLOCATION_LATITUDE_FIELD;
3640
ALERT_ADVERSARY_GEOLOCATION_LATITUDE_FIELD = ALERT_ADVERSARY_GEOLOCATION_LATITUDE_FIELD;
3741
ALERT_TARGET_GEOLOCATION_LONGITUDE_FIELD = ALERT_TARGET_GEOLOCATION_LONGITUDE_FIELD;
@@ -55,6 +59,8 @@ export class AlertEntityDisplayComponent implements OnInit, OnChanges {
5559
}
5660

5761
ngOnInit() {
62+
console.log('type', this.type);
63+
console.log('field', this.field);
5864
if (this.alert[this.key]) {
5965
this.fields = Object.keys(this.alert[this.key]);
6066
if (this.alert[this.key].geolocation) {

frontend/src/app/data-management/alert-management/shared/components/data-field-render/data-field-render.component.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
22
import {
33
ALERT_ADVERSARY_FIELD, ALERT_ADVERSARY_IP_FIELD,
4-
ALERT_DESTINATION_IP_FIELD, ALERT_IMPACT_FIELD,
4+
ALERT_DESTINATION_IP_FIELD, ALERT_ECHOES_FIELD,
5+
ALERT_IMPACT_FIELD,
56
ALERT_NOTE_FIELD,
67
ALERT_SEVERITY_FIELD_LABEL,
78
ALERT_SOURCE_IP_FIELD,
89
ALERT_STATUS_FIELD,
910
ALERT_TAGS_FIELD,
10-
ALERT_TARGET_FIELD, ALERT_TARGET_IP_FIELD,
11-
ALERT_ECHOES_FIELD
11+
ALERT_TARGET_FIELD,
12+
ALERT_TARGET_IP_FIELD
1213
} from '../../../../../shared/constants/alert/alert-field.constant';
1314
import {UtmDateFormatEnum} from '../../../../../shared/enums/utm-date-format.enum';
1415
import {UtmAlertType} from '../../../../../shared/types/alert/utm-alert.type';

frontend/src/app/shared/constants/alert/alert-field.constant.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,13 +218,13 @@ export const ALERT_FIELDS: UtmFieldType[] = [
218218
label: 'Target Host',
219219
field: ALERT_TARGET_HOST_FIELD,
220220
type: ElasticDataTypesEnum.STRING,
221-
visible: false,
221+
visible: true,
222222
},
223223
{
224224
label: 'Target User',
225225
field: ALERT_TARGET_USER_FIELD,
226226
type: ElasticDataTypesEnum.STRING,
227-
visible: false,
227+
visible: true,
228228
}
229229
]
230230
},
@@ -292,13 +292,13 @@ export const ALERT_FIELDS: UtmFieldType[] = [
292292
label: 'Adversary Host',
293293
field: ALERT_ADVERSARY_HOST_FIELD,
294294
type: ElasticDataTypesEnum.STRING,
295-
visible: false,
295+
visible: true,
296296
},
297297
{
298298
label: 'Adversary User',
299-
field: ALERT_ADVERSARY_URL_FIELD,
299+
field: ALERT_ADVERSARY_USER_FIELD,
300300
type: ElasticDataTypesEnum.STRING,
301-
visible: false,
301+
visible: true,
302302
}
303303
]
304304
},

0 commit comments

Comments
 (0)