Skip to content

Commit 762826f

Browse files
mjabascal10Kbayeroc3s4rfred
authored
Bugfix/10.4/621 the system lets you remove the last integration tenant without disabling the integration (#651)
* Improvement integrations component * Refactor guides generation process . * Refactor guides generation process . * Refactor guides generation process . * Add fortiweb filter * Added new integrations(). * Update pfsense_fw.conf Updating pfsense filter * Update ibm_aix.conf Updating aix filter * Update fortiweb.conf Updating fortiweb filter * Update netflow.conf Updating netflow filter * Added pfsense changeset * Add pfsense changeset * Add pfsense changeset * Added confirmation for disabling the log collector action. * Added pfsense changeset * Added netflow changeset * Added netflow changeset * Added netflow changeset * Added aix changeset * Refactor changesets * Disabled modules UFW and LINUX_LOGS * Fixed integration bugs * Disabled modules UFW and LINUX_LOGS * Adding modules to log-firewall-* index-pattern * Update README.md * Migrate agent configurations * Update UTMStack Version * Update UTMStack Agent Version * Fixed the Enable Integration button for Syslog * Added theadWinds menu * Added theadWinds menu * Added theadWinds menu * Added theadWinds menu * Added theadWinds menu * Added theadWinds menu * Fixed menu url validation * Added theadWinds logo * Set timeout to mailSender bean * Set timeout to mailSender bean * Added shm-size param to selenium * Added shm-size param to selenium * Fixing selenium service * Trigger web-pdf workflow * Updating installer shm volume * Updating dockerfile comment * Set timeout to mailSender bean * Remove tls syslog servers * Validate UTF8 messages and create buffer for syslog messages * Close syslog connections * Accept multiple connections in syslog servers * Refactor threat intelligence component * Removed SSL protocol * Fixed Data Parsing processed events is not matching between outside and inside component (#622) * Set threat winds changeset * Fix ibm aix id * Updated pfsense filter * Fixed The system lets you remove the last integration tenant without disabling the integration (#621) * Fixed Validation for character-limited fields (#644) * Fixed Index-Pattern search continues displaying information despite no results found(#645) * Updated module category for aix and pfsense integration * Fixed the space problem between the iframe and the header. * Updated module category for aix and pfsense integration * Fixed Index-Pattern search continues displaying information despite no results found (#645) --------- Co-authored-by: Yorjander Hernandez Vergara <[email protected]> Co-authored-by: Freddy R. Laffita Almaguer <[email protected]>
1 parent 6650b0e commit 762826f

File tree

10 files changed

+83
-13
lines changed

10 files changed

+83
-13
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<databaseChangeLog
3+
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
6+
7+
<changeSet id="20240424001" author="Manuel">
8+
9+
<sql dbms="postgresql" splitStatements="true" stripComments="true">
10+
<![CDATA[
11+
12+
UPDATE utm_module
13+
SET module_category = 'Device'
14+
WHERE module_name IN ('FORTIWEB', 'AIX');
15+
16+
]]>
17+
</sql>
18+
</changeSet>
19+
</databaseChangeLog>

backend/src/main/resources/config/liquibase/master.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,7 @@
5959

6060
<include file="/config/liquibase/changelog/20240419001_updating_pfsense_filter.xml" relativeToChangelogFile="false"/>
6161

62+
<include file="/config/liquibase/changelog/20240424001_updating_category_aix_fortiweb.xml" relativeToChangelogFile="false"/>
63+
6264

6365
</databaseChangeLog>

frontend/src/app/app-module/conf/int-generic-group-config/int-generic-group-config.component.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {ModalService} from '../../../core/modal/modal.service';
33
import {UtmToastService} from '../../../shared/alert/utm-toast.service';
44
import {ModalConfirmationComponent} from '../../../shared/components/utm/util/modal-confirmation/modal-confirmation.component';
55
import {EncryptService} from '../../../shared/services/util/encrypt.service';
6+
import {ModuleChangeStatusBehavior} from '../../shared/behavior/module-change-status.behavior';
67
import {IntCreateGroupComponent} from '../../shared/components/int-create-group/int-create-group.component';
78
import {UtmModuleGroupConfService} from '../../shared/services/utm-module-group-conf.service';
89
import {UtmModuleGroupService} from '../../shared/services/utm-module-group.service';
@@ -30,7 +31,8 @@ export class IntGenericGroupConfigComponent implements OnInit {
3031
private toast: UtmToastService,
3132
private encryptService: EncryptService,
3233
private utmModuleGroupConfService: UtmModuleGroupConfService,
33-
private modalService: ModalService) {
34+
private modalService: ModalService,
35+
private moduleChangeStatusBehavior: ModuleChangeStatusBehavior) {
3436
}
3537

3638
ngOnInit() {
@@ -66,8 +68,10 @@ export class IntGenericGroupConfigComponent implements OnInit {
6668
deleteGroup(group: UtmModuleGroupType) {
6769
const deleteModal = this.modalService.open(ModalConfirmationComponent, {centered: true});
6870
deleteModal.componentInstance.header = 'Delete tenant';
69-
deleteModal.componentInstance.message = 'By deleting ' + group.groupName + ' tenant UTMStack no longer receive' +
70-
' logs from this source.' + ' Are you sure that you want to delete this tenant?';
71+
deleteModal.componentInstance.message = 'By deleting ' + group.groupName + ' tenant, UTMStack will no longer receive logs from this source.' +
72+
(this.groups.length === 1 ? ' Since this is the only tenant, the module associated with it will be deactivated.' : '') +
73+
' Are you sure that you want to delete this tenant?';
74+
7175
deleteModal.componentInstance.confirmBtnText = 'Delete';
7276
deleteModal.componentInstance.confirmBtnIcon = 'icon-stack-cancel';
7377
deleteModal.componentInstance.confirmBtnType = 'delete';
@@ -78,7 +82,11 @@ export class IntGenericGroupConfigComponent implements OnInit {
7882

7983
deleteAction(group: UtmModuleGroupType) {
8084
this.utmModuleGroupService.delete(group.id).subscribe(response => {
81-
this.toast.showSuccessBottom('Tenant group saved successfully');
85+
if (this.groups.length === 1) {
86+
this.moduleChangeStatusBehavior.setStatus(false);
87+
} else {
88+
this.toast.showSuccessBottom('Tenant group deleted successfully');
89+
}
8290
this.getGroups();
8391
}, error => {
8492
this.toast.showError('Error deleting tenant',
@@ -92,6 +100,7 @@ export class IntGenericGroupConfigComponent implements OnInit {
92100
this.savingConfig = false;
93101
this.pendingChanges = false;
94102
this.changes = {keys: [], moduleId: this.moduleId};
103+
this.configValidChange.emit(this.tenantGroupConfigValid());
95104
this.toast.showSuccessBottom('Configuration saved successfully');
96105
}, () => {
97106
this.toast.showError('Error saving configuration',
@@ -112,7 +121,7 @@ export class IntGenericGroupConfigComponent implements OnInit {
112121
required = group.moduleGroupConfigurations.filter(value => value.confRequired === true);
113122
valid = required.filter(value => value.confValue !== null && value.confValue);
114123
});
115-
return valid.length === required.length;
124+
return this.groups.length > 0 && valid.length === required.length;
116125
}
117126

118127
checkConfigValue(config: string): boolean {
@@ -127,7 +136,7 @@ export class IntGenericGroupConfigComponent implements OnInit {
127136
} else {
128137
this.changes.keys[index].confValue = integrationConfig.confValue;
129138
}
130-
this.configValidChange.emit(this.tenantGroupConfigValid());
139+
// this.configValidChange.emit(this.tenantGroupConfigValid());
131140
}
132141

133142
cancelConfig(group: UtmModuleGroupType) {
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import {Inject, Injectable} from '@angular/core';
2+
import {BehaviorSubject, Observable} from 'rxjs';
3+
4+
@Injectable({providedIn: 'root'})
5+
export class ModuleChangeStatusBehavior {
6+
private $moduleChangeStatusBehavior = new BehaviorSubject<boolean>(null);
7+
public moduleStatus$: Observable<boolean> = this.$moduleChangeStatusBehavior.asObservable();
8+
9+
setStatus(status: boolean) {
10+
this.$moduleChangeStatusBehavior.next(status);
11+
}
12+
}

frontend/src/app/app-module/shared/components/app-module-activate-button/app-module-activate-button.component.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
import {Component, Input, OnInit} from '@angular/core';
1+
import {Component, Input, OnDestroy, OnInit} from '@angular/core';
22
import {NgbModal} from '@ng-bootstrap/ng-bootstrap';
3+
import {Subject} from 'rxjs';
4+
import {takeUntil, filter} from 'rxjs/operators';
35
import {UtmToastService} from '../../../../shared/alert/utm-toast.service';
46
import {NavBehavior} from '../../../../shared/behaviors/nav.behavior';
7+
import {ModuleChangeStatusBehavior} from '../../behavior/module-change-status.behavior';
58
import {ModuleRefreshBehavior} from '../../behavior/module-refresh.behavior';
69
import {UtmModulesEnum} from '../../enum/utm-module.enum';
710
import {UtmModulesService} from '../../services/utm-modules.service';
@@ -14,7 +17,7 @@ import {AppModuleDeactivateComponent} from '../app-module-deactivate/app-module-
1417
templateUrl: './app-module-activate-button.component.html',
1518
styleUrls: ['./app-module-activate-button.component.css']
1619
})
17-
export class AppModuleActivateButtonComponent implements OnInit {
20+
export class AppModuleActivateButtonComponent implements OnInit, OnDestroy {
1821
@Input() module: UtmModulesEnum;
1922
@Input() type: string;
2023
@Input() disabled = false;
@@ -23,15 +26,21 @@ export class AppModuleActivateButtonComponent implements OnInit {
2326
moduleDetail: UtmModuleType;
2427
changingStatus: any;
2528
activatable: boolean;
29+
destroy$: Subject<void> = new Subject<void>();
2630

2731
constructor(private utmModulesService: UtmModulesService,
2832
public modalService: NgbModal,
2933
private toastService: UtmToastService,
3034
private moduleRefreshBehavior: ModuleRefreshBehavior,
31-
private navBehavior: NavBehavior) {
35+
private navBehavior: NavBehavior,
36+
private moduleChangeStatusBehavior: ModuleChangeStatusBehavior) {
3237
}
3338

3439
ngOnInit() {
40+
this.moduleChangeStatusBehavior.moduleStatus$
41+
.pipe(filter(value => value !== null),
42+
takeUntil(this.destroy$))
43+
.subscribe( value => this.changeModuleStatus(value));
3544
this.getModuleDetail(this.module);
3645
}
3746

@@ -78,4 +87,9 @@ export class AppModuleActivateButtonComponent implements OnInit {
7887
});
7988
}
8089

90+
ngOnDestroy() {
91+
this.destroy$.next();
92+
this.destroy$.complete();
93+
}
94+
8195
}

frontend/src/app/incident-response/shared/component/ir-create-rule/ir-create-rule.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@
8888
</div>
8989
<div class="form-group">
9090
<label class="pb-1" for="description">Description
91-
({{ 512 - formRule.get('description').value.length }})</label>
91+
({{ maxLength - formRule.get('description').value.length }})</label>
9292
<textarea [ngClass]="inputClass.resolveClassInput(formRule.get('description'))"
93+
[maxLength]="maxLength"
9394
class="border-1 border-grey-600 form-control" formControlName="description"
9495
id="description"
9596
name=""

frontend/src/app/incident-response/shared/component/ir-create-rule/ir-create-rule.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export class IrCreateRuleComponent implements OnInit {
3838
typing = true;
3939
rulePrefix: string = createElementPrefix(PrefixElementEnum.INCIDENT_RESPONSE_AUTOMATION);
4040
valuesMap: Map<string, string[]> = new Map();
41+
maxLength = 512;
4142

4243
constructor(private incidentResponseRuleService: IncidentResponseRuleService,
4344
public activeModal: NgbActiveModal,

frontend/src/app/shared/components/utm/index-pattern/index-pattern-create/index-pattern-create.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@ export class IndexPatternCreateComponent implements OnInit {
179179
}
180180

181181
private onError(error) {
182-
// this.alertService.error(error.error, error.message, null);
182+
this.totalItems = 0;
183+
this.indexes = [];
184+
this.loading = false;
183185
}
184186

185187
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
.bg-dark{
22
background-color: black!important;
33
}
4+
5+
.utm-navbar-secondary {
6+
height: 50px!important;
7+
}
8+
9+
.iframe-position {
10+
position: absolute;
11+
width: 100%;
12+
top: -5px;
13+
}

frontend/src/app/threatwind/threatwind.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<div class="bg-dark">
2-
<iframe style="height: 89vh" [src]="iframeSrc | safe:'resourceUrl'" width="100%"></iframe>
1+
<div class="bg-dark iframe-position">
2+
<iframe style="height: 89.4vh" [src]="iframeSrc | safe:'resourceUrl'" width="100%"></iframe>
33
</div>
44

55

0 commit comments

Comments
 (0)