Skip to content

Commit b7aff81

Browse files
committed
Merge remote-tracking branch 'origin/release/v10.8.1' into release/v10.8.1
2 parents c2f5795 + 9785a94 commit b7aff81

23 files changed

Lines changed: 146 additions & 97 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,10 @@
55
- Added support for RedHat; UTMStack can now be installed on both Ubuntu and RedHat.
66
- Improved log delivery from ARM-based agents on Windows, now sending native system logs.
77
- Added support for macOS ARM64; agents can now be installed on that platform.
8-
- Improved agent information displayed in the Sources panel, providing more accurate OS details and agent versions.
8+
- Improved agent information displayed in the Sources panel, providing more accurate OS details and agent versions.
9+
10+
11+
### Bug Fixes
12+
-- Compliance Report Scheduling: Improved the stability of the selection process when creating new report schedules.
13+
-- Improved field rendering in Log Explorer by consolidating list-based fields into a single entry for better readability and consistency.
14+
-- Improved field rendering for tags and note fields in Alerts.

agent/collectors/macos.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package collectors
55

66
import (
77
"bufio"
8+
"os"
89
"os/exec"
910
"path/filepath"
1011

@@ -29,6 +30,11 @@ func getCollectorsInstances() []Collector {
2930
func (d Darwin) SendLogs() {
3031
path := utils.GetMyPath()
3132
collectorPath := filepath.Join(path, "utmstack-collector-mac")
33+
host, err := os.Hostname()
34+
if err != nil {
35+
utils.Logger.ErrorF("error getting hostname: %v", err)
36+
host = "unknown"
37+
}
3238

3339
cmd := exec.Command(collectorPath)
3440

@@ -62,9 +68,11 @@ func (d Darwin) SendLogs() {
6268
continue
6369
}
6470

71+
messageWithHost := config.GetMessageFormated(host, validatedLog)
72+
6573
logservice.LogQueue <- logservice.LogPipe{
6674
Src: string(config.DataTypeMacOs),
67-
Logs: []string{validatedLog},
75+
Logs: []string{messageWithHost},
6876
}
6977
}
7078

aws/processor/sendData.go

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"encoding/json"
77
"fmt"
88
"net/http"
9-
"strings"
109
"time"
1110

1211
"github.com/threatwinds/logger"
@@ -27,45 +26,36 @@ var transport = &http.Transport{
2726
var client = &http.Client{Transport: transport, Timeout: 2 * time.Second}
2827

2928
func SendToLogstash(data []TransformedLog) *logger.Error {
30-
var logStrings []string
31-
for _, log := range data {
32-
body, err := json.Marshal(log)
29+
for _, str := range data {
30+
body, err := json.Marshal(str)
3331
if err != nil {
3432
utils.Logger.ErrorF("error encoding log to JSON: %v", err)
3533
continue
3634
}
37-
logStrings = append(logStrings, string(body))
38-
}
39-
40-
if len(logStrings) == 0 {
41-
return nil
42-
}
43-
44-
var logs string
45-
for _, str := range logStrings {
46-
logs += str + configuration.UTMLogSeparator
35+
if err := sendLogs(body); err != nil {
36+
utils.Logger.ErrorF("error sending logs to logstach: %v", err)
37+
continue
38+
}
4739
}
40+
return nil
41+
}
4842

43+
func sendLogs(log []byte) error {
4944
url := fmt.Sprintf(configuration.LogstashEndpoint, configuration.GetLogstashHost(), configuration.GetLogstashPort())
5045

51-
req, err := http.NewRequest("POST", url, bytes.NewBufferString(logs))
46+
req, err := http.NewRequest("POST", url, bytes.NewBuffer(log))
5247
if err != nil {
5348
return utils.Logger.ErrorF("error creating request: %v", err.Error())
5449
}
5550

5651
resp, err := client.Do(req)
5752
if err != nil {
58-
if !strings.Contains(err.Error(), "Client.Timeout exceeded while awaiting headers") {
59-
utils.Logger.ErrorF("error sending logs with error: %v", err.Error())
60-
}
6153
return utils.Logger.ErrorF("error sending logs: %v", err.Error())
6254
}
6355
defer resp.Body.Close()
6456

6557
if resp.StatusCode != http.StatusOK {
6658
return utils.Logger.ErrorF("error sending logs with http code %d", resp.StatusCode)
6759
}
68-
69-
utils.Logger.Info("successfully sent %d logs to Logstash", len(logStrings))
7060
return nil
7161
}

frontend/src/app/compliance/compliance-schedule/compliance-schedule.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ import {
1818
UtmComplianceScheduleDeleteComponent
1919
} from '../shared/components/utm-compliance-schedule-delete/utm-compliance-schedule-delete.component';
2020
import {ComplianceScheduleService} from '../shared/services/compliance-schedule.service';
21+
import {CronDescriptionGeneratorService} from '../shared/services/cron-description-generator.service';
2122
import {ComplianceScheduleFilterType} from '../shared/type/compliance-schedule-filter.type';
2223
import {ComplianceScheduleType} from '../shared/type/compliance-schedule.type';
2324
import {ComplianceStandardType} from '../shared/type/compliance-standard.type';
24-
import {CronDescriptionGeneratorService} from "../shared/services/cron-description-generator.service";
2525

2626

2727
@Component({

frontend/src/app/compliance/shared/components/utm-compliance-select/utm-compliance-select.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
placeholder="Standard"
1919
style="width: 50%"
2020
></ng-select>
21-
<ng-select (change)="filterBySelect($event,'type')"
21+
<ng-select (change)="getDashboardList()"
2222
[(ngModel)]="section"
2323
[clearable]="true"
2424
[items]="standardSections"
@@ -47,7 +47,7 @@
4747
class="cursor-pointer text-blue-800 d-flex justify-content-between align-items-center">
4848
<span class="span-small-icon">
4949
<i [ngClass]="idReport === report.id?'icon-radio-checked':'icon-radio-unchecked'"></i>
50-
<span class="text-blue-800 ml-2">{{report.associatedDashboard.name}}</span>
50+
<span class="text-blue-800 ml-2">{{report.configReportName ? report.configReportName :report.associatedDashboard.name}}</span>
5151
</span>
5252
<span class="span-small-icon">
5353
<i *ngIf="report.associatedDashboard.description" [ngbTooltip]="report.associatedDashboard.description"
@@ -80,7 +80,7 @@
8080
</tbody>
8181
</table>
8282
</div>
83-
<div *ngIf="complianceReports && complianceReports.length>0" class="mb-4 mt-2">
83+
<div [hidden]="complianceReports && complianceReports.length === 0" class="mb-4 mt-2">
8484
<div class="row justify-content-center">
8585
<ngb-pagination
8686
(pageChange)="loadPage($event)"

frontend/src/app/compliance/shared/components/utm-compliance-select/utm-compliance-select.component.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class UtmComplianceSelectComponent implements OnInit {
2929
section: number;
3030
loading = true;
3131
totalItems: any;
32-
page = 1;
32+
page = 0;
3333
itemsPerPage = 10;
3434
complianceReports: ComplianceReportType[] = [];
3535
searching = false;
@@ -42,8 +42,8 @@ export class UtmComplianceSelectComponent implements OnInit {
4242

4343
ngOnInit() {
4444
this.requestParams = {
45-
page: this.page - 1,
46-
size: this.itemsPerPage,
45+
page: 0,
46+
size: 1000,
4747
sort: this.sortBy,
4848
'name.contains': null
4949
};
@@ -61,14 +61,14 @@ export class UtmComplianceSelectComponent implements OnInit {
6161
}
6262

6363
loadPage(page: any) {
64-
this.requestParams.page = page - 1;
64+
this.page = page > 0 ? page - 1 : page;
6565
this.getDashboardList();
6666
}
6767

6868
getDashboardList() {
6969
const query = {
70-
page: this.page - 1,
71-
size: 1000,
70+
page: this.page,
71+
size: this.itemsPerPage,
7272
sort: 'id,asc',
7373
'standardSectionId.equals': this.section,
7474
'configSolution.contains': this.solution
@@ -81,15 +81,15 @@ export class UtmComplianceSelectComponent implements OnInit {
8181

8282
getSections() {
8383
const query = {
84-
page: this.page - 1,
84+
page: 0,
8585
size: 1000,
8686
sort: 'id,asc',
8787
'standardId.equals': this.standard,
8888
'standardSectionName.contains': this.solution
8989
};
9090
this.cpStandardSectionService.query(query).subscribe(response => {
9191
this.standardSections = response.body;
92-
this.section = !!this.section ? this.section : this.standardSections[0].id;
92+
this.section = this.standardSections.length > 0 ? this.standardSections[0].id : null;
9393
this.getDashboardList();
9494
if (this.idReport) {
9595
this.getSelectedDashboard(this.idReport);
@@ -98,7 +98,8 @@ export class UtmComplianceSelectComponent implements OnInit {
9898
}
9999

100100
getStandardList() {
101-
this.cpStandardService.query({page: 0, size: 1000}).subscribe(
101+
this.cpStandardService.query({page: 0, size: 1000})
102+
.subscribe(
102103
(res: HttpResponse<any>) => {
103104
this.standards = res.body;
104105
this.standard = !!this.standard ? this.standard : this.standards[0].id;

frontend/src/app/data-management/alert-management/alert-view/alert-view.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ <h5 class="card-title mb-0 text-uppercase label-header">
160160
*ngIf="(td.visible)">
161161
<app-data-field-render (refreshData)="onRefreshData($event)" [data]="alert"
162162
[field]="td"
163+
[tags]="tags"
163164
[dataType]="dataType"
164165
[showStatusChange]="true"></app-data-field-render>
165166
</td>

frontend/src/app/data-management/alert-management/shared/components/alert-actions/alert-apply-note/alert-apply-note.component.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22
placement="top"
33
tooltipClass="utm-tooltip-top">
44
<span #notePopober=ngbPopover
5-
[ngbPopover]="colContent"
5+
[ngbPopover]="showIcon ? colContent : ''"
66
[popoverTitle]="colTitle"
77
autoClose="outside"
8-
class="text-blue-800 position-relative cursor-pointer small-md-icon"
8+
[ngClass]="{'text-blue-800 position-relative cursor-pointer': showIcon}"
9+
class="small-md-icon"
910
container="body"
1011
placement="auto"
1112
popoverClass="utm-popover"
1213
triggers="click">
13-
<i [ngClass]="creating?'icon-spinner2 spinner':note==='' ? 'icon-pencil3' : 'icon-pencil4'"></i>
14+
<i *ngIf="showIcon" [ngClass]="creating?'icon-spinner2 spinner':note==='' ? 'icon-pencil3' : 'icon-pencil4'"></i>
1415
<span *ngIf="showNote" class="ml-3">
1516
{{note}}
1617
</span>

frontend/src/app/data-management/alert-management/shared/components/alert-actions/alert-apply-note/alert-apply-note.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export class AlertApplyNoteComponent implements OnInit, OnChanges {
1717
@Output() applyNote = new EventEmitter<string>();
1818
note: string;
1919
creating = false;
20+
@Input( )showIcon = true;
2021

2122
constructor(private alertServiceManagement: AlertManagementService,
2223
private utmToastService: UtmToastService,

frontend/src/app/data-management/alert-management/shared/components/alert-actions/alert-apply-tags/alert-tags-apply.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
placement="auto"
33
container="body"
44
tooltipClass="utm-tooltip-top" (click)="addNewTagRule()" *ngIf="tags;else loadingTag">
5-
<span class="text-blue-800 position-relative cursor-pointer small-md-icon text-center d-inline"
6-
>
5+
<span [ngClass]="{'text-blue-800 position-relative cursor-pointer': showIcon}"
6+
class="small-md-icon text-center d-inline">
77

8-
<i [ngClass]="icon" [ngStyle]="{'color':color}"></i>
8+
<i *ngIf="showIcon" [ngClass]="icon" [ngStyle]="{'color':color}"></i>
99
<span *ngIf="selected.length>1" class="tag-count badge badge-danger">
1010
{{selected.length <= 5 ? selected.length : '+5'}}
1111
</span>

0 commit comments

Comments
 (0)